:root {
  --bg: #0E0E11;
  --surface: #17171C;
  --card: #1E1E24;
  --elevated: #26262E;
  --border: rgba(255, 255, 255, 0.08);
  --border-md: rgba(255, 255, 255, 0.15);
  --text: #F4F4F6;
  --text-2: rgba(244, 244, 246, 0.70);
  --text-3: rgba(244, 244, 246, 0.44);
}

body {
  overflow: hidden;
  height: 100vh;
}

header {
  height: 64px;
  flex-shrink: 0;
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 320px;
  height: 2px;
  background: linear-gradient(90deg, var(--red) 0%, transparent 100%);
}

.hdr-left {
  gap: 12px;
}

.hdr-school {
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.hdr-div {
  font-size: 1rem;
}

.hdr-eng {
  font-size: 0.7rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
}

.hdr-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hdr-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
  background: rgba(95, 163, 191, 0.12);
  border: 1px solid rgba(95, 163, 191, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

.hdr-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: -0.01em;
}

main {
  display: flex;
  height: calc(100vh - 64px);
}

/* ── 시드 패널 ── */
#seed-panel {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 10px;
}

.sp-sep {
  display: none;
}

.sp-block {
  background: var(--card);
  border: 1px solid var(--border-md);
  border-radius: 12px;
  padding: 14px 16px;
}

.sp-block:first-child {
  padding-top: 14px;
}

.sp-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.57rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--blue);
  background: rgba(95, 163, 191, 0.1);
  border: 1px solid rgba(95, 163, 191, 0.22);
  border-radius: 4px;
  padding: 2px 8px;
  display: inline-block;
  margin-bottom: 12px;
}

#seed-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--blue);
  transition: color 0.4s;
  line-height: 1.15;
  word-break: break-all;
  letter-spacing: -0.02em;
}

#seed-value.seed-frozen {
  color: var(--red);
}

#seed-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

#seed-status {
  background: var(--card);
  border: 1px solid var(--border-md);
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
}

.dot-live {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
  animation: blink 1.4s infinite;
}

.dot-frozen {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.sp-hint {
  background: rgba(95, 163, 191, 0.05);
  border: 1px solid rgba(95, 163, 191, 0.14);
  border-left: 3px solid rgba(95, 163, 191, 0.45);
  border-radius: 8px;
  font-size: 0.76rem;
  color: var(--text-2);
  line-height: 1.9;
  padding: 14px 16px;
}

/* ── 추첨 섹션 ── */
#draw-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  overflow: hidden;
}

.section-label {
  margin-bottom: 10px;
}

.info-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  flex-shrink: 0;
}

#leaders-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.leader-chip {
  background: var(--card);
  border: 1px solid var(--border-md);
  color: var(--text-2);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

#pool-box {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#member-pool {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 8px;
  overflow: hidden;
}

.member-chip {
  background: var(--card);
  border: 1px solid var(--border-md);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: default;
  transition: opacity 0.2s;
}

.chip-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.chip-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: var(--text-3);
}

.fly-chip {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  user-select: none;
}

#btn-draw {
  flex-shrink: 0;
  width: 100%;
  padding: 18px;
  background: var(--red);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

#btn-draw:hover:not(:disabled) {
  background: #a8002c;
}

#btn-draw:active:not(:disabled) {
  transform: scale(0.99);
}

#btn-draw:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── 결과 섹션 ── */
#result-section {
  flex: 1;
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  overflow: hidden;
}

#seed-bar {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sb-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

#frozen-seed {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--red);
}

#btn-copy {
  background: none;
  border: 1px solid var(--border-md);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

#btn-copy:hover {
  background: var(--card);
}

#btn-copy-announce {
  background: none;
  border: 1px solid rgba(95, 163, 191, 0.4);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

#btn-copy-announce:hover {
  background: rgba(95, 163, 191, 0.08);
}

#team-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, auto);
  align-content: start;
  gap: 10px;
  overflow: hidden;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  transition: transform 0.3s;
}

.tc-num {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tc-leader {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-radius: 8px;
  padding: 8px 12px;
  flex-shrink: 0;
}

.tc-crown {
  font-size: 0.85rem;
}

.tc-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.tc-members {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-member-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--card);
  transition: opacity 0.2s, transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ── 덱 영역 (섞인 카드 파일 대기 공간) ── */
#card-deck {
  flex-shrink: 0;
  min-height: 25%;
  background: var(--surface);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: flex-start;
}
