/* ============================================================
   Coconutkill — Landing page, auth modal, lobby modal
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --felt:       #0d3b21;
    --felt-dark:  #091f12;
    --gold:       #c9a84c;
    --gold-light: #f0c966;
    --white:      #f8f6f2;
    --panel:      #ffffff;
    --text:       #1a1a2e;
    --muted:      #6b7280;
    --red:        #dc2626;
    /* Team A = player's team = green. Team B = opponents = red. */
    --team-a:     #16a34a;
    --team-b:     #dc2626;
    --radius:     12px;
    --shadow:     0 4px 24px rgba(0,0,0,0.28);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: radial-gradient(ellipse at 50% 0%, #1a5c36 0%, var(--felt-dark) 70%);
    min-height: 100vh;
    color: var(--text);
}

/* ---- Top bar ---- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(9, 31, 18, 0.75);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(201,168,76,0.15);
}

.topbar-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.5px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-display {
    font-size: 14px;
    color: var(--white);
    opacity: 0.85;
}

/* ---- Hero ---- */

.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 24px 80px;
    gap: 48px;
}

.hero { text-align: center; }

.hero-title {
    font-size: clamp(42px, 8vw, 80px);
    font-weight: 800;
    color: var(--gold);
    letter-spacing: -1px;
    line-height: 1;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.hero-sub {
    margin-top: 10px;
    font-size: 17px;
    color: rgba(248,246,242,0.7);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 400;
}

/* ---- Option cards ---- */

.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    width: 100%;
    max-width: 860px;
}

.option-card {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 32px 28px;
    width: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease;
}

.option-card:hover {
    transform: translateY(-4px);
}

.option-card--disabled {
    opacity: 0.45;
    pointer-events: none;
}

.option-icon {
    font-size: 36px;
    line-height: 1;
}

.option-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.option-card p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}

/* ---- Buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 20px;
    transition: background 0.15s, opacity 0.15s, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--gold);
    color: #1a1a0e;
}

.btn-primary:not(:disabled):hover {
    background: var(--gold-light);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-ghost:not(:disabled):hover {
    background: rgba(255,255,255,0.08);
}


.btn-full { width: 100%; margin-top: 4px; }
.btn-sm   { padding: 6px 12px; font-size: 13px; }
.btn-lg   { padding: 14px 28px; font-size: 16px; }

/* ---- Inputs ---- */

.join-input-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.code-input {
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    min-width: 0;
    flex: 1 1 0;
}

.field-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
    background: #fff;
}

.field-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.18);
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
    text-align: left;
    width: 100%;
}

.field-error {
    font-size: 13px;
    color: var(--red);
    text-align: left;
    width: 100%;
}

/* ---- Modal shared ---- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
    padding: 16px;
}

.modal-box {
    background: var(--panel);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
    position: relative;
    width: 100%;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 6px;
}

.modal-close:hover { background: #f3f4f6; }

/* ---- Auth modal ---- */

.auth-modal-box {
    max-width: 420px;
    padding: 36px 32px 32px;
}

.auth-step {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-step h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.auth-hint {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}

.otp-sent-banner {
    background: #ecfdf5;
    border: 1.5px solid #6ee7b7;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: #065f46;
    line-height: 1.6;
    text-align: center;
}

/* ---- Lobby modal ---- */

.lobby-modal-box {
    max-width: 860px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lobby-header { display: flex; flex-direction: column; gap: 8px; }
.lobby-header h2 { font-size: 22px; font-weight: 700; }

.lobby-code-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lobby-code {
    font-family: 'Courier New', monospace;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 5px;
    color: var(--gold);
    background: #1a1a2e;
    padding: 6px 14px;
    border-radius: 8px;
}

.lobby-hint {
    font-size: 13px;
    color: var(--muted);
}

/* Lobby body — three columns */
.lobby-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: start;
    min-height: 240px;
}

.team-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.team-a-color { color: var(--team-a); }
.team-b-color { color: var(--team-b); }

.team-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-slot {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 14px 12px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}

.team-slot.drag-over {
    border-color: var(--gold);
    background: rgba(201,168,76,0.08);
}

/* Unassigned column */
.unassigned-panel {
    width: 200px;
    display: flex;
    flex-direction: column;
}

.unassigned-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lobby-waiting {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin-top: 12px;
    font-style: italic;
}

/* Player card (draggable) */
.player-card {
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.15s;
    font-size: 14px;
    font-weight: 600;
}

.player-card.is-me {
    border-color: var(--gold);
    background: rgba(201,168,76,0.06);
}

.player-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.player-card .badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

.badge-host { background: #fef3c7; color: #92400e; }
.badge-you  { background: #d1fae5; color: #065f46; }

/* Lobby footer */
.lobby-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f3f4f6;
    padding-top: 16px;
}

.lobby-footer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lobby-status {
    font-size: 13px;
    color: var(--muted);
}

/* ---- Utilities ---- */
.hidden { display: none !important; }
