/* ========================================================
   팀 나누기 — "라커룸 드래프트 보드" 디자인
   - 스포츠 드래프트 전광판에서 선수 이름이 팀 컬럼으로 호명되어 배정되는 모습을 모티프로 가져왔다.
   - 시그니처: 참가자가 드래프트 순서대로 호명되며 자신의 팀 컬럼에 카드로 슬라이드되어 쌓인다.
   - 발권기(order)와 구분되는 다크 그린 필드 + 팀별 저지 컬러 팔레트.
   ======================================================== */

.team-container {
    --tm-field: #0f2318;
    --tm-field-light: #16351f;
    --tm-line: rgba(255,255,255,0.08);
    --tm-cream: #eef4ee;
    --tm-muted: rgba(238, 244, 238, 0.55);
    --tm-gold: #facc15;

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.team-container .hidden { display: none !important; }

.tm-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--tm-field);
    background: var(--tm-gold);
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    margin-bottom: 0.9rem;
}

.team-container .page-header {
    background:
        radial-gradient(circle at 85% -10%, rgba(250, 204, 21, 0.12), transparent 55%),
        linear-gradient(180deg, var(--tm-field-light), var(--tm-field));
    border: 1px solid var(--tm-line);
    border-radius: 18px;
}

.team-container .page-header::before { display: none; }

.team-container .page-header h1 {
    font-family: 'Black Han Sans', -apple-system, sans-serif;
    font-weight: 400;
    color: var(--tm-cream);
    -webkit-text-fill-color: var(--tm-cream);
    background: none;
}

.team-container .page-header .description { color: var(--tm-muted); }

/* ── 카드 ── */
.team-container .tool-section.card {
    background: var(--tm-field-light);
    border: 1px solid var(--tm-line);
    color: var(--tm-cream);
}

.team-container .tool-section.card:hover {
    box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(250, 204, 21, 0.14);
}

.team-container .tool-section h2 { color: var(--tm-cream); border-bottom-color: var(--tm-line); }
.team-container .tool-section h2::after { background: var(--tm-gold); }
.team-container .helper-text { color: var(--tm-muted); }
.team-container .tool-guide-text { color: rgba(238, 244, 238, 0.7); }

.team-container .tool-intro-card,
.team-container .tool-usage-steps li,
.team-container .tool-example-card,
.team-container .tool-usecase-chip,
.team-container .tool-related-card {
    background: rgba(255,255,255,0.04) !important;
    color: var(--tm-cream) !important;
}

.team-container .tool-intro-card h4,
.team-container .tool-example-arrow,
.team-container .tool-usecase-chip strong,
.team-container .tool-related-card .tool-related-name {
    color: var(--tm-gold) !important;
}

.team-container .tool-intro-card p,
.team-container .tool-example-card .tool-example-label,
.team-container .tool-related-card .tool-related-desc,
.team-container .tool-meta-bar {
    color: var(--tm-muted) !important;
}

.team-container .tool-example-card .tool-example-input,
.team-container .tool-example-card .tool-example-output {
    background: rgba(0,0,0,0.25);
    border-color: var(--tm-line);
    color: var(--tm-cream);
}

.team-container .tool-meta-bar { border-top-color: var(--tm-line); }
.team-container .tool-meta-bar span strong { color: var(--tm-cream); }
.team-container .tool-guide-section h2 { color: var(--tm-cream); }

.team-container .tool-faq-item { background: rgba(255,255,255,0.04); }
.team-container .tool-faq-item dt { color: var(--tm-cream); }
.team-container .tool-faq-item dt::before { color: var(--tm-gold); }
.team-container .tool-faq-item dd { color: var(--tm-muted); }
.team-container .tool-faq-item dd::before { color: #4ade80; }

/* ── 참가자 칩 입력 ── */
.tm-chip-input-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.9rem;
    border: 2px dashed var(--tm-line);
    border-radius: 12px;
    background: rgba(0,0,0,0.2);
    min-height: 60px;
    align-items: center;
}

.tm-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--tm-gold);
    color: var(--tm-field);
    padding: 0.4rem 0.5rem 0.4rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    animation: tmChipPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tmChipPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.tm-chip-remove {
    background: rgba(0,0,0,0.15);
    border: none;
    color: var(--tm-field);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tm-chip-remove:hover { background: #b91c1c; color: #fff; }

.tm-chip-text-input {
    flex: 1;
    min-width: 140px;
    border: none;
    background: transparent;
    padding: 0.5rem 0.2rem;
    font-size: 0.98rem;
    color: var(--tm-cream);
    outline: none;
}

.tm-chip-text-input::placeholder { color: rgba(238, 244, 238, 0.35); }

.tm-chip-count { font-size: 0.85rem; font-weight: 700; color: var(--tm-muted); margin-top: 0.6rem; }

/* ── 팀 수 스텝퍼 (제비뽑기 winner-count와 동일 패턴) ── */
.tm-count-stepper { display: flex; align-items: center; gap: 0.6rem; }

.tm-count-step-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px dashed var(--tm-line);
    background: rgba(0,0,0,0.2);
    color: var(--tm-cream);
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.18s ease;
}

.tm-count-step-btn:hover { border-color: var(--tm-gold); color: var(--tm-gold); }

.tm-count-value {
    width: 76px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--tm-cream);
    background: rgba(0,0,0,0.2);
    border: 2px dashed var(--tm-line);
    border-radius: 10px;
}

.tm-count-unit { font-weight: 700; color: var(--tm-cream); }

/* ── 버튼 ── */
.team-container .btn-generate {
    background: var(--tm-gold);
    color: var(--tm-field);
    border: none;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(250, 204, 21, 0.28);
}

.team-container .btn-generate:hover { filter: brightness(1.06); box-shadow: 0 8px 24px rgba(250, 204, 21, 0.38); }
.team-container .btn-generate:disabled { opacity: 0.5; box-shadow: none; }

.team-container .clear-btn {
    background: rgba(255,255,255,0.06);
    color: var(--tm-cream);
    border: 1px solid rgba(255,255,255,0.15);
}
.team-container .clear-btn:hover { background: rgba(255,255,255,0.12); }

.team-container .copy-btn {
    background: var(--tm-gold);
    color: var(--tm-field);
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.25);
}

.team-container .error-message {
    background: rgba(178, 58, 46, 0.16);
    color: #e6857a;
    border-left: 4px solid #b23a2e;
}

.team-container .ticket-stub {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(250, 204, 21, 0.3);
}

.share-link-row { display: flex; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.share-link-row .share-link-input { flex: 1; min-width: 200px; }

.team-container .share-link-input {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--tm-cream);
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.88rem;
}

/* ============================================================
   드래프트 보드 (시그니처 요소)
   팀마다 컬럼을 두고, 발표된 참가자가 카드로 슬라이드인되며 쌓인다.
   각 컬럼의 팀 컬러는 JS가 --tm-team-color 커스텀 속성으로 주입한다.
   ============================================================ */
.tm-announce {
    text-align: center;
    font-family: 'Black Han Sans', -apple-system, sans-serif;
    font-size: 1.25rem;
    color: var(--tm-gold);
    min-height: 2rem;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.tm-announce.show { opacity: 1; transform: translateY(0); }

.tm-board {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tm-column {
    flex: 1 1 180px;
    min-width: 170px;
    background: rgba(0,0,0,0.22);
    border: 1px solid var(--tm-line);
    border-top: 4px solid var(--tm-team-color, var(--tm-gold));
    border-radius: 14px;
    padding: 0.9rem;
}

.tm-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}

.tm-column-name {
    font-family: 'Black Han Sans', -apple-system, sans-serif;
    font-size: 1.02rem;
    color: var(--tm-team-color, var(--tm-gold));
}

.tm-column-count {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--tm-muted);
    background: rgba(255,255,255,0.07);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

.tm-column-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 36px;
}

.tm-player-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--tm-line);
    border-left: 3px solid var(--tm-team-color, var(--tm-gold));
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--tm-cream);
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
    animation: tmCardIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

@keyframes tmCardIn {
    0% { opacity: 0; transform: translateY(-10px) scale(0.85); }
    60% { opacity: 1; transform: translateY(2px) scale(1.03); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── 진행 상태 / 완료 배너 ── */
.tm-progress-text { text-align: center; font-weight: 700; color: var(--tm-muted); margin-top: 0.8rem; font-size: 0.9rem; }

.tm-complete-banner {
    text-align: center;
    padding: 1rem;
    margin-top: 1.2rem;
    border: 2px dashed var(--tm-gold);
    border-radius: 12px;
    background: rgba(250, 204, 21, 0.08);
    color: var(--tm-cream);
    font-weight: 700;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tm-complete-banner.show { opacity: 1; transform: translateY(0); }

/* ── 내가 만든 팀나누기 ── */
.tm-my-games-list { display: flex; flex-direction: column; gap: 0.5rem; }

.tm-my-game-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.9rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--tm-line);
    border-radius: 10px;
    text-decoration: none;
    color: var(--tm-cream);
    font-size: 0.85rem;
    font-weight: 600;
}

.tm-my-game-item:hover { border-color: rgba(250, 204, 21, 0.4); background: rgba(255,255,255,0.07); }
.tm-my-game-serial { font-family: 'Courier New', monospace; font-weight: 700; color: var(--tm-muted); }
.tm-my-game-arrow { margin-left: auto; color: var(--tm-gold); font-weight: 700; }

.tm-my-games-rest { margin-top: 0.55rem; }
.tm-my-games-rest.hidden { display: none; }

.tm-my-games-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.7rem;
    padding: 0.55rem 1rem;
    background: transparent;
    border: 2px dashed var(--tm-line);
    border-radius: 10px;
    color: var(--tm-muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tm-my-games-more-btn:hover {
    border-style: solid;
    border-color: var(--tm-gold);
    color: var(--tm-gold);
    background: rgba(255,255,255,0.05);
}

/* ── 반응형 ── */
@media (max-width: 768px) {
    .team-container .page-header h1 { font-size: 1.9rem; }
    .tm-board { gap: 0.7rem; }
    .tm-column { flex: 1 1 140px; min-width: 140px; padding: 0.7rem; }
    .tm-player-card { font-size: 0.84rem; padding: 0.45rem 0.6rem; }
    .share-link-row { flex-direction: column; }
}

@media (max-width: 480px) {
    .team-container .page-header h1 { font-size: 1.55rem; }
    .tm-eyebrow { font-size: 0.65rem; }
    .tm-chip-text-input { min-width: 100px; font-size: 0.95rem; }
    .tm-count-stepper { flex-wrap: wrap; }
    /* 좁은 화면에서는 컬럼을 2열 그리드로 - flex-wrap만으로는 카드가 너무 좁아짐 */
    .tm-board { display: grid; grid-template-columns: repeat(2, 1fr); }
    .tm-column { min-width: 0; }
}
