/* ==========================================================================
   GAME 02: DRAW & GUESS PREMIUM STYLESHEET
   ========================================================================== */

.draw-guess-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    gap: 14px;
}

/* -------------------------------------------------------------
   Top HUD (Round, Drawer, Word Blanks, Authoritative Timer)
   ------------------------------------------------------------- */
.dg-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-surface, #10131B);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    gap: 12px;
}

.dg-hud-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 130px;
}

.dg-badge-turn {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--coral, #FF647C);
    letter-spacing: 1px;
}

.dg-badge-role {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dg-badge-role.is-self-drawer {
    color: var(--coral, #FF647C);
}

.dg-hud-word-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
}

.dg-hud-word {
    font-size: 1.4rem;
    letter-spacing: 4px;
    color: var(--coral, #FF647C);
    font-weight: 800;
    text-shadow: 0 0 10px rgba(255, 100, 124, 0.3);
    font-family: var(--font-display);
}

.dg-hud-word.drawer-word {
    color: var(--gold-primary, #F4B860);
    text-shadow: 0 0 10px var(--gold-glow);
    letter-spacing: 2px;
}

.dg-hud-word.selecting {
    color: var(--text-muted);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.dg-hud-word.waiting {
    color: var(--text-muted);
    font-size: 1.1rem;
    letter-spacing: 1px;
    font-style: italic;
}

.dg-hud-word.revealed {
    color: var(--green, #47D18C);
    letter-spacing: 2px;
}

.dg-hud-word.guesser-blanks {
    color: var(--text-primary, #F5F3EE);
    letter-spacing: 2px;
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-wrap: wrap;
}

.dg-blank-char {
    color: var(--text-secondary, #9B9EAA);
    opacity: 0.65;
}

.dg-space-char {
    width: 6px;
    display: inline-block;
}

.dg-hint-letter {
    color: var(--gold-primary, #F4B860);
    text-shadow: 0 0 12px rgba(244, 184, 96, 0.45);
    font-weight: 900;
    animation: hintPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes hintPop {
    0% { transform: scale(1.35); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.dg-punct-char {
    color: var(--text-primary, #F5F3EE);
    font-weight: 700;
}

.dg-hud-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dg-hud-timer-wrapper {
    display: flex;
    justify-content: flex-end;
    min-width: 100px;
}

.dg-timer-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 100, 124, 0.12);
    border: 1.5px solid var(--coral, #FF647C);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--coral, #FF647C);
    transition: all 0.2s ease;
}

.dg-timer-unit {
    font-size: 0.8rem;
    font-weight: 600;
}

.dg-timer-pill.timer-warning {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
    animation: dgPulse 1s infinite alternate;
}

.dg-timer-pill.timer-expired {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
    font-size: 0.95rem;
}

@keyframes dgPulse {
    from {
        transform: scale(1);
        box-shadow: 0 0 4px rgba(239, 68, 68, 0.3);
    }
    to {
        transform: scale(1.06);
        box-shadow: 0 0 14px rgba(239, 68, 68, 0.6);
    }
}

/* -------------------------------------------------------------
   Word Selection View (3-Card Rich Choice Layout)
   ------------------------------------------------------------- */
.word-selection-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    text-align: center;
    background: var(--bg-surface, #10131B);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.word-selection-header {
    margin-bottom: 25px;
}

.word-selection-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.word-selection-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.word-options-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 800px;
}

.word-choice-card {
    background: var(--bg-card, #181C27);
    border: 2px solid var(--border-subtle);
    border-radius: 16px;
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.word-choice-card:hover {
    transform: translateY(-4px);
    border-color: var(--coral);
    box-shadow: 0 10px 25px rgba(255, 100, 124, 0.2);
}

.word-choice-card.diff-easy {
    border-color: rgba(16, 185, 129, 0.4);
}
.word-choice-card.diff-easy:hover {
    border-color: #10b981;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
}

.word-choice-card.diff-medium {
    border-color: rgba(245, 158, 11, 0.4);
}
.word-choice-card.diff-medium:hover {
    border-color: #f59e81;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.2);
}

.word-choice-card.diff-hard {
    border-color: rgba(239, 68, 68, 0.4);
}
.word-choice-card.diff-hard:hover {
    border-color: #ef4444;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.2);
}

.word-choice-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.word-diff-pill {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.word-diff-pill.diff-easy {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.word-diff-pill.diff-medium {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.word-diff-pill.diff-hard {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.word-cat-pill {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 10px;
}

.word-choice-main {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 8px 0;
    text-align: center;
}

.word-choice-footer {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--coral);
    display: flex;
    align-items: center;
    gap: 5px;
}

.word-selection-waiting {
    font-size: 1.15rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px;
}

/* -------------------------------------------------------------
   Play Area Layout & Canvas
   ------------------------------------------------------------- */
.dg-play-area {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    width: 100%;
}

.dg-toolbar {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface, #10131B);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    padding: 10px;
    width: 80px;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.dg-tool-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.dg-tool-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 800;
    letter-spacing: 0.5px;
}

.dg-color-palette {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.dg-color-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s ease;
}

.dg-color-dot.active {
    border-color: var(--text-primary);
    transform: scale(1.18);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.dg-tools-row, .dg-sizes-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.dg-tool-btn {
    width: 100%;
    height: 38px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.dg-tool-btn:hover {
    background: rgba(255, 100, 124, 0.15);
    border-color: var(--coral);
}

.dg-tool-btn.active {
    background: var(--coral);
    border-color: var(--coral);
    color: #FFFFFF;
    box-shadow: 0 0 10px rgba(255, 100, 124, 0.4);
}

.dg-tool-btn.dg-tool-danger {
    color: var(--crimson);
}

.dg-tool-btn.dg-tool-danger:hover {
    background: rgba(225, 29, 72, 0.18);
    border-color: var(--crimson);
}

.dg-canvas-container {
    position: relative;
    width: 100%;
    background: #FFFFFF;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-subtle);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.dg-canvas-container.guesser {
    grid-column: 1 / -1;
}

#drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

/* -------------------------------------------------------------
   Guessing Area & Feedback
   ------------------------------------------------------------- */
.dg-guess-wrapper {
    display: flex;
    gap: 10px;
    width: 100%;
}

.dg-guess-input {
    flex: 1;
    background: var(--bg-card, #181C27);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1.05rem;
    padding: 12px 18px;
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.dg-guess-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.btn-dg-submit {
    width: auto;
    padding: 12px 24px;
    min-height: unset;
    margin: 0;
    font-weight: 700;
}

.dg-guess-feedback-toast {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.dg-guess-feedback-toast.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.dg-correct-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.12);
    border: 1.5px solid #10b981;
    color: #10b981;
    font-weight: 800;
    border-radius: 12px;
    padding: 14px;
    font-size: 1.15rem;
    width: 100%;
    gap: 8px;
}

/* -------------------------------------------------------------
   Results Panels (Turn & Final)
   ------------------------------------------------------------- */
.dg-results-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-surface, #10131B);
    border-radius: 20px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.dg-results-badge {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--coral, #FF647C);
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.dg-results-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary, #F5F3EE);
}

.dg-turn-results-word {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--gold-primary, #F4B860);
    text-shadow: 0 0 10px rgba(244, 184, 96, 0.3);
}

.dg-results-table {
    width: 100%;
    max-width: 550px;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: var(--bg-card, #181C27);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.dg-results-table th, .dg-results-table td {
    padding: 12px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #F5F3EE);
    font-size: 0.95rem;
}

.dg-results-table th {
    color: var(--text-secondary, #9B9EAA);
    font-size: 0.8rem;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(8, 9, 13, 0.4);
}

.dg-next-turn-notice {
    font-size: 0.95rem;
    color: var(--text-secondary, #9B9EAA);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dg-podium-container {
    display: flex;
    gap: 16px;
    margin-bottom: 25px;
    justify-content: center;
    width: 100%;
    max-width: 600px;
}

.dg-results-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

/* -------------------------------------------------------------
   Responsive Breakpoints (Tablet & 390px Mobile)
   ------------------------------------------------------------- */
@media (max-width: 768px) {
    .draw-guess-container,
    .dg-hud,
    .word-selection-wrapper,
    .word-options-container,
    .word-choice-card,
    .dg-play-area,
    .dg-canvas-container,
    .dg-guess-wrapper,
    .dg-results-wrapper,
    .dg-results-table,
    .dg-podium-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .dg-hud-left,
    .dg-hud-word-wrapper,
    .dg-hud-timer-wrapper {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .dg-hud-word {
        overflow-wrap: break-word;
        word-break: break-word;
        max-width: 100%;
    }

    .dg-play-area {
        grid-template-columns: 1fr;
    }
    
    .dg-toolbar {
        flex-direction: row;
        width: 100%;
        max-width: 100%;
        height: auto;
        justify-content: space-between;
        padding: 8px 10px;
        gap: 8px;
        flex-wrap: wrap;
        box-sizing: border-box;
    }
    
    .dg-tool-section {
        flex-direction: row;
        width: auto;
        gap: 6px;
    }

    .dg-color-palette {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .dg-color-dot {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }

    .dg-tools-row, .dg-sizes-row {
        flex-direction: row;
        width: auto;
        gap: 6px;
    }

    .dg-tool-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 0.95rem;
    }

    .dg-tool-title {
        display: none;
    }

    .dg-guess-wrapper {
        flex-wrap: wrap;
        gap: 8px;
    }

    .dg-guess-input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .btn-dg-submit {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .dg-hud {
        padding: 8px 10px;
        gap: 6px;
    }

    .dg-hud-left {
        min-width: 0;
    }

    .dg-badge-turn {
        font-size: 0.65rem;
    }

    .dg-badge-role {
        font-size: 0.8rem;
    }

    .dg-hud-word {
        font-size: 1.15rem;
        letter-spacing: 1.5px;
    }

    .dg-hud-timer-wrapper {
        min-width: 0;
    }

    .dg-timer-pill {
        padding: 4px 8px;
        font-size: 0.95rem;
    }

    .word-options-container {
        grid-template-columns: 1fr;
    }

    .word-choice-card {
        padding: 14px;
    }

    .word-choice-main {
        font-size: 1.15rem;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .dg-podium-container {
        flex-direction: column;
    }

    .dg-guess-wrapper {
        margin-bottom: 20px;
    }
}
