/* Auth */
.auth-container {
    max-width: 320px;
    margin: auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tagline {
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-buttons {
    display: flex;
    gap: 8px;
}

.auth-buttons button {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
}

#btn-login {
    background: var(--primary);
}

#btn-register {
    background: var(--bg-card);
}

/* Lobby */
.lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid #223;
}

.header-actions {
    display: flex;
    gap: 4px;
}

.lobby-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.new-game-section, .games-section {
    margin-bottom: 24px;
}

.new-game-section h2, .games-section h2 {
    font-size: 16px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.new-game-form {
    display: flex;
    gap: 8px;
}

.new-game-form input {
    flex: 1;
}

#btn-new-game {
    background: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

.suggestions {
    background: var(--bg-surface);
    border: 1px solid #334;
    border-radius: var(--radius);
    margin-top: 4px;
    max-height: 120px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
}

.suggestion-item:hover {
    background: var(--bg-card);
}

.games-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.game-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s;
}

.game-card:active {
    background: #1a4a80;
}

.game-card .game-opponent {
    font-weight: 600;
    font-size: 15px;
}

.game-card .game-scores {
    font-size: 13px;
    color: var(--text-dim);
}

.game-card .game-turn {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.game-turn.your-turn {
    background: var(--success);
    color: #000;
}

.game-turn.their-turn {
    background: var(--bg-surface);
    color: var(--text-dim);
}

.game-turn.finished {
    background: var(--text-dim);
    color: #000;
}

/* Game header */
.game-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-surface);
    gap: 8px;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 700;
}

.score.you { color: var(--accent); }
.score.opp { color: var(--text-dim); }
.score-sep { color: var(--text-dim); font-weight: 400; }

.turn-indicator {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.turn-indicator.your-turn {
    background: var(--success);
    color: #000;
}

.turn-indicator.their-turn {
    background: var(--bg-card);
    color: var(--text-dim);
}

.info-bar {
    display: flex;
    justify-content: space-between;
    padding: 4px 16px;
    font-size: 12px;
    color: var(--text-dim);
    background: var(--bg);
}

/* Action bar */
.action-bar {
    display: flex;
    gap: 6px;
    padding: 6px 12px 12px;
    justify-content: center;
}

.action-btn {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
}

.action-btn.primary {
    background: var(--primary);
    font-size: 15px;
    padding: 10px 24px;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.modal-content {
    position: relative;
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 20px;
    max-width: 340px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-header .word {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
}

.modal-close {
    background: none;
    font-size: 24px;
    padding: 0 4px;
    color: var(--text-dim);
}

.definition {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
}

.def-entry { margin: 4px 0; }
.def-word { font-weight: 700; display: block; font-size: 17px; margin-bottom: 2px; }
.def-sep { border: none; border-top: 1px solid var(--bg-surface); margin: 10px 0; }

/* Blank picker */
.blank-picker {
    text-align: center;
}

.blank-picker h3 {
    margin-bottom: 12px;
    color: var(--accent);
}

.letter-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.letter-grid button {
    padding: 10px;
    font-size: 16px;
    font-weight: 700;
    background: var(--tile-bg);
    color: var(--tile-text);
    border-radius: 4px;
}

.letter-grid button:active {
    background: var(--accent);
}

/* Stats */
.stats-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-surface);
}

.stats-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.stat-card h3 {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
}

.stat-item .stat-label {
    font-size: 12px;
    color: var(--text-dim);
}

.word-list {
    list-style: none;
}

.word-list li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #223;
    font-size: 14px;
}

.word-list .word-name {
    font-weight: 700;
    color: var(--accent);
}

.word-list .word-count {
    color: var(--text-dim);
}

/* Notification banner */
.banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3000;
    padding: 10px 16px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    background: var(--success);
    color: #000;
    transform: translateY(-100%);
    transition: transform 0.3s;
}

.banner.show {
    transform: translateY(0);
}

/* Move history */
.move-history {
    padding: 12px 16px;
    background: var(--bg-surface);
    max-height: 200px;
    overflow-y: auto;
}

.move-history h3 {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.history-entry {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px solid #112;
}

.history-entry .move-player { color: var(--text-dim); }
.history-entry .move-words { color: var(--accent); font-weight: 600; }
.history-entry .move-score { color: var(--text); }
