/* ==========================================
   DESIGN SYSTEM CONFIGURATION (CLAY PALETTE)
   ========================================== */
:root {
    /* Base Foundations */
    --bg-main: #dcecf1;            /* Clean light off-white background */
    --text-primary: #3d3a45;       /* Soft dark charcoal for premium contrast */
    --text-muted: #7c7685;
    
    /* Clay Colors Inspired Directly From Images */
    --clay-purple: #d1c5f3;        /* Main display container lilac */
    --clay-peach: #ffb4a2;         /* Primary "Confirm/Start" button */
    --clay-green: #bbf2db;         /* "Add User" and success components */
    --clay-blue: #bfe3f7;          /* Toggle slides & secondary actions */
    --clay-yellow: #fff2b2;        /* Secondary option accents */
    --clay-alert: #f9c0c0;         /* Red alert for Imposter/Delete tags */
    --clay-white: #f3f5f5;         /* Base card fill layers */

    /* Universal Claymorphism Shadow Matrix Formula */
    --clay-shadow-surface: 
        0px 10px 20px rgba(61, 58, 69, 0.05),
        inset 0px -6px 10px rgba(61, 58, 69, 0.08),
        inset 0px 4px 8px rgba(255, 255, 255, 0.8);

    --clay-shadow-button: 
        0px 6px 12px rgba(61, 58, 69, 0.08),
        inset 0px -4px 8px rgba(0, 0, 0, 0.06),
        inset 0px 4px 6px rgba(255, 255, 255, 0.7);

    --clay-shadow-inset:
        inset 0px 4px 8px rgba(61, 58, 69, 0.06),
        inset 0px -2px 4px rgba(255, 255, 255, 0.5);
}

/* ==========================================
   GLOBAL LAYOUT RESET
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent; /* Eliminates mobile blue flash box */
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    overflow-x: hidden;
}

/* Base View Wrappers */
.game-wrapper {
    width: 100%;
    max-width: 440px; /* Perfectly scaled for native mobile device profiles */
    background: transparent;
}

.game-screen {
    display: flex;
    flex-direction: column;
    width: 100%;
    animation: screenFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hidden {
    display: none !important;
}

.screen-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    width: 100%;
}

.screen-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.screen-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: -12px;
    margin-bottom: 24px;
}

/* ==========================================
   CLAYMORPHIC CORE COMPONENT SHAPES
   ========================================== */
.clay-card {
    background: var(--clay-white);
    border-radius: 24px;
    box-shadow: var(--clay-shadow-surface);
    border: 2px solid rgba(255, 255, 255, 0.6);
    padding: 20px;
    margin-bottom: 16px;
}

.clay-btn {
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 14px 24px;
    cursor: pointer;
    box-shadow: var(--clay-shadow-button);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.15s ease;
}

.clay-btn:active {
    transform: scale(0.95);
    box-shadow: inset 0px 4px 6px rgba(0, 0, 0, 0.08);
}

/* Button Theming Variances */
.primary-btn { background-color: var(--clay-blue); }
.success-btn { background-color: var(--clay-peach); width: 100%; font-size: 18px; padding: 16px; }
.alert-btn { background-color: var(--clay-alert); width: 100%; }
.icon-btn { width: 44px; height: 44px; padding: 0; border-radius: 14px; font-size: 20px; }

/* Navigation Placement Layouts */
.nav-container {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    width: 100%;
}
.vertical-stack {
    flex-direction: column;
    gap: 12px;
}

/* ==========================================
   SCREEN 1: PLAYER SETUP SYSTEM
   ========================================== */
.player-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
    width: 100%;
}

.player-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    margin-bottom: 0;
    background-color: var(--clay-white);
    border-radius: 18px;
}

.player-name {
    font-weight: 600;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-btn {
    background: var(--clay-alert);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    box-shadow: var(--clay-shadow-button);
}

/* Dummy Add Block Style Adjustments */
.dummy-add-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    margin-bottom: 0;
    cursor: pointer;
    background-color: var(--clay-green);
    border-radius: 18px;
    transition: transform 0.1s ease;
}
.dummy-add-block:active { transform: scale(0.97); }
.add-icon { font-size: 20px; font-weight: 700; }
.add-text { font-weight: 600; }

/* Secure Inline Input Box Nodes */
.clay-input-node {
    width: 100%;
    border: none;
    background: var(--clay-white);
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    outline: none;
    box-shadow: var(--clay-shadow-inset);
    color: var(--text-primary);
}

/* ==========================================
   SCREEN 2: MULTI-CATEGORY PANELS
   ========================================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.category-item {
    text-align: center;
    font-weight: 600;
    padding: 24px 12px;
    cursor: pointer;
    margin-bottom: 0;
    user-select: none;
}

.category-item.selected {
    background-color: var(--clay-purple);
    transform: translateY(2px);
    box-shadow: var(--clay-shadow-inset);
}

.settings-panel {
    background-color: var(--clay-white);
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Clay Switch Hardware */
.clay-switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 30px;
    flex-shrink: 0;
}

.clay-switch input { opacity: 0; width: 0; height: 0; }

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e3e1e6;
    border-radius: 30px;
    box-shadow: var(--clay-shadow-inset);
    transition: .2s ease;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    box-shadow: var(--clay-shadow-button);
    transition: .2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Active State Switch Sliders */
input:checked + .switch-slider { background-color: var(--clay-blue); }
input:checked + .switch-slider:before { transform: translateX(24px); }

/* ==========================================
   SCREEN 3: SCROLLABLE TIMER SELECTION
   ========================================== */
.timer-picker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0;
}

.picker-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Clay Cylinder Scroll Window Wheel */
.clay-scroll-wheel {
    width: 140px;
    height: 150px;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    background: #f0edf5;
    border-radius: 24px;
    box-shadow: var(--clay-shadow-inset);
    padding: 50px 0; /* Creates spatial boundaries for layout centering */
    scrollbar-width: none; /* Hides generic Firefox scroll bars */
}

.clay-scroll-wheel::-webkit-scrollbar { display: none; } /* Hides Chrome/Safari track lines */

.scroll-item {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
    scroll-snap-align: center;
    transition: font-size 0.15s ease, color 0.15s ease;
}

.scroll-item.selected {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--clay-white);
    box-shadow: var(--clay-shadow-button);
    border-radius: 14px;
    width: calc(100% - 16px);
    margin: 0 auto;
}

/* ==========================================
   SCREEN 4: PASS AND REVEAL VIEWS
   ========================================== */
.pass-instruction-box {
    text-align: left;
    flex-grow: 1;
}

.pass-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

.active-player-highlight {
    font-size: 28px;
    font-weight: 800;
}

.reveal-card {
    background-color: var(--clay-purple);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    user-select: none;
    margin-top: 10px;
    transition: background-color 0.2s ease;
}

.reveal-card.revealed {
    background-color: var(--clay-white);
}

.card-prompt-text {
    font-size: 16px;
    font-weight: 700;
    color: #5d527a;
    padding: 0 20px;
    line-height: 1.4;
}

.card-secret-content h3 {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.secret-word-text {
font-size: 32px;
font-weight: 800;
letter-spacing: -0.5px;
}
.imposter-alert-color {
color: #e56b6b;
}
.hint-text {
font-size: 13px;
font-weight: 600;
color: var(--text-muted);
margin-top: 16px;
background: #f0edf5;
padding: 6px 12px;
border-radius: 10px;
}
/* ==========================================
SCREEN 5: DISCUSSION COUNTDOWN INTERFACES
========================================== */
.countdown-display-panel {
background-color: var(--clay-white);
display: flex;
justify-content: center;
align-items: center;
padding: 40px 20px;
margin-top: 20px;
margin-bottom: 30px;
}
.timer-countdown-digits {
font-size: 64px;
font-weight: 800;
letter-spacing: -2px;
font-variant-numeric: tabular-nums; /* Prevents timer text jumping during countdown frame shifts */
}
/* Alarm Warning Intermittent Pulsing Keyframes */
.timer-pulse-alert {
color: #e56b6b;
animation: urgentPulse 1s infinite alternate;
}
/* ==========================================
ANIMATIONS ARCHITECTURE
========================================== */
@keyframes screenFadeIn {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes urgentPulse {
from { transform: scale(1); }
to { transform: scale(1.05); }
}

.game-brand-header {
    text-align: center;
    margin-bottom: 24px;
}

.brand-title {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -1.5px;
    color: var(--text-primary);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.05);
}
