/* Orologia.io - Custom Stylings */

:root {
    /* Fonts */
    --font-primary: 'Quicksand', system-ui, -apple-system, sans-serif;
    --font-heading: 'Fredoka', var(--font-primary);
    --font-digital: 'Share Tech Mono', monospace;

    /* Light Theme Palette (Warm & Playful) */
    --bg-app: #fdfaf6;
    --bg-card: #ffffff;
    --bg-card-header: #f7f3eb;
    --text-primary: #3d3b3c;
    --text-secondary: #726e6f;
    --border-color: #e5dec9;
    
    /* Brand Colors (Official Google Logo Colors) */
    --primary: #4285F4;       /* Google Blue */
    --primary-light: rgba(66, 133, 244, 0.1);
    --accent: #EA4335;        /* Google Red */
    --accent-light: rgba(234, 67, 53, 0.1);
    --amber: #FBBC05;         /* Google Yellow */
    --amber-light: rgba(251, 188, 5, 0.1);
    --green-correct: #34A853;  /* Google Green */
    --red-incorrect: #EA4335;  /* Google Red */
    
    /* Interactive & Shadow styles */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 15px rgba(66, 133, 244, 0.3);
    
    /* Specific components */
    --clock-face-bg: #ffffff;
    --clock-face-border: #f1ebd9;
    --clock-number: #3d3b3c;
    --led-off-bg: #e2e8f0;
    --led-off-border: #cbd5e1;
    --led-on-hour: #4285F4;
    --led-on-mint: #FBBC05;
    --led-on-minu: #EA4335;
    --led-on-hour-glow: 0 0 15px rgba(66, 133, 244, 0.8), inset 0 0 5px rgba(255, 255, 255, 0.5);
    --led-on-mint-glow: 0 0 15px rgba(251, 188, 5, 0.8), inset 0 0 5px rgba(255, 255, 255, 0.5);
    --led-on-minu-glow: 0 0 15px rgba(234, 67, 53, 0.8), inset 0 0 5px rgba(255, 255, 255, 0.5);
    
    --transition-speed: 0.25s;
}

[data-theme="dark"] {
    /* Dark Theme Palette (Starry Space & Neon) */
    --bg-app: #0b0f19;
    --bg-card: #141b2d;
    --bg-card-header: #1c263d;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #2a3b5a;
    
    --primary: #4285F4;       /* Google Blue */
    --primary-light: rgba(66, 133, 244, 0.15);
    --accent: #EA4335;        /* Google Red */
    --accent-light: rgba(234, 67, 53, 0.15);
    --amber: #FBBC05;         /* Google Yellow */
    --amber-light: rgba(251, 188, 5, 0.15);
    --green-correct: #34A853;  /* Google Green */
    --red-incorrect: #EA4335;  /* Google Red */

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(66, 133, 244, 0.4);
    
    --clock-face-bg: #1e293b;
    --clock-face-border: #2a3b5a;
    --clock-number: #f1f5f9;
    --led-off-bg: #1e293b;
    --led-off-border: #334155;
    --led-on-hour: #4285F4;
    --led-on-mint: #FBBC05;
    --led-on-minu: #EA4335;
    --led-on-hour-glow: 0 0 20px rgba(66, 133, 244, 0.9, inset 0 0 8px rgba(255, 255, 255, 0.6));
    --led-on-mint-glow: 0 0 20px rgba(251, 188, 5, 0.9, inset 0 0 8px rgba(255, 255, 255, 0.6));
    --led-on-minu-glow: 0 0 20px rgba(234, 67, 53, 0.9, inset 0 0 8px rgba(255, 255, 255, 0.6));
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-app);
    color: var(--text-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Header styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 16px 24px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 16px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
    animation: rotateClockwise 12s linear infinite;
    display: inline-block;
}

@keyframes rotateClockwise {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
}

.logo-text h1 .g-blue { color: #4285F4; }
.logo-text h1 .g-red { color: #EA4335; }
.logo-text h1 .g-yellow { color: #FBBC05; }
.logo-text h1 .g-green { color: #34A853; }

.logo-text .tagline {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mode Selector Navigation */
.mode-selector {
    display: flex;
    background-color: var(--bg-app);
    padding: 6px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    gap: 4px;
}

.mode-btn {
    border: none;
    outline: none;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 50px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed) cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mode-btn:hover {
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .mode-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
    background-color: var(--primary);
    color: #ffffff !important;
    box-shadow: var(--shadow-glow);
}

/* Header Controls (Theme & Sound) */
.header-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-app);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: var(--text-primary);
    transition: all var(--transition-speed);
}

.control-btn:hover {
    transform: scale(1.08);
    background-color: var(--bg-card-header);
    border-color: var(--primary);
}

/* Stats and Difficulty Bar */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 16px 24px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 16px;
}

.difficulty-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-label {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.diff-options {
    display: flex;
    background-color: var(--bg-app);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 4px;
    gap: 4px;
}

.diff-btn {
    border: none;
    outline: none;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-primary);
    padding: 6px 14px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    transition: all var(--transition-speed);
}

.diff-btn .diff-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
}

.diff-btn .diff-desc {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

.diff-btn:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .diff-btn:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.diff-btn.active {
    background-color: var(--amber);
}

.diff-btn.active .diff-name,
.diff-btn.active .diff-desc {
    color: #ffffff !important;
}

.stats-counters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-app);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 8px 16px;
    font-weight: 700;
}

.stat-icon {
    font-size: 18px;
}

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 18px;
    font-family: var(--font-heading);
    color: var(--primary);
}

.hearts-container {
    display: flex;
    gap: 4px;
}

.heart {
    font-size: 18px;
    filter: grayscale(1);
    opacity: 0.3;
    transition: filter 0.3s, opacity 0.3s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.heart.active {
    filter: none;
    opacity: 1;
    transform: scale(1.1);
    animation: heartBeat 2s infinite ease-in-out;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Layout Grid */
.main-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
    align-items: start;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .app-header, .stats-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .mode-selector {
        flex-direction: column;
        border-radius: 16px;
    }
}

/* Panels */
.workspace-panel {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.help-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.sidebar-title {
    background-color: var(--bg-card-header);
    border-bottom: 2px solid var(--border-color);
    padding: 16px;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
}

.sidebar-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.guide-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guide-item p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tick-guide-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 4px;
    margin-top: 4px;
}

.tick-guide-list li {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bullet {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
}

.guide-note {
    font-style: italic;
    font-size: 12px !important;
    background-color: var(--bg-app);
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--amber);
}

.formula-box {
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.formula-box code {
    font-family: var(--font-digital);
    font-size: 13px;
    color: var(--accent);
}

/* Screens */
.game-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.game-screen.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.question-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
}

/* Clock styling & positioning */
.clock-display-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.clock-container {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
}

[data-theme="dark"] .clock-container {
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
}

/* SVG Clock internal styling */
.clock-face {
    fill: var(--clock-face-bg);
    stroke: var(--clock-face-border);
    stroke-width: 8;
    transition: fill var(--transition-speed), stroke var(--transition-speed);
}

.clock-outer-bump {
    fill: var(--clock-face-border);
    transition: fill var(--transition-speed);
}

.clock-rim-accent {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    opacity: 0.15;
}

.clock-ticks-hour {
    stroke: var(--text-primary);
    stroke-width: 5;
    stroke-linecap: round;
}

.clock-ticks-minute {
    stroke: var(--text-secondary);
    stroke-width: 2;
    stroke-linecap: round;
}

.clock-quarter-guide {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 1;
    stroke-dasharray: 2, 4;
}

/* Quarter Sub-ticks styling */
.sub-tick {
    stroke-linecap: round;
}
.sub-tick-15 {
    stroke: var(--primary);
    stroke-width: 3.5;
}
.sub-tick-30 {
    stroke: var(--amber);
    stroke-width: 3.5;
}
.sub-tick-45 {
    stroke: var(--accent);
    stroke-width: 3.5;
}

.clock-number {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    fill: var(--clock-number);
    text-anchor: middle;
    dominant-baseline: central;
    transition: fill var(--transition-speed);
    user-select: none;
}

/* Hands inside clock */
.clock-hand {
    stroke-linecap: round;
    transition: transform 0.05s linear;
}

.hour-hand {
    stroke: var(--primary);
    stroke-width: 11;
}

.minute-hand {
    stroke: var(--accent);
    stroke-width: 7;
}

.clock-center-cap {
    fill: #ffffff;
    stroke: var(--text-primary);
    stroke-width: 4;
}

/* Mode 1 Interactive Options Buttons */
.options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 500px;
}

@media (max-width: 480px) {
    .options-container {
        grid-template-columns: 1fr;
    }
}

.option-btn {
    background-color: var(--bg-card);
    border: 3px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 20px;
    font-family: var(--font-digital);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.option-btn:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    background-color: var(--primary-light);
    color: var(--text-primary);
}

.option-btn:active {
    transform: translateY(-1px);
}

.option-btn.correct {
    background-color: var(--green-correct) !important;
    border-color: var(--green-correct) !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px var(--green-correct) !important;
}

.option-btn.incorrect {
    background-color: var(--red-incorrect) !important;
    border-color: var(--red-incorrect) !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px var(--red-incorrect) !important;
    animation: shake 0.4s ease-in-out;
}

/* Screen shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Mode 2: Digital to Analog Target styling */
.digital-target-wrapper {
    background-color: var(--bg-card);
    border: 3px solid var(--border-color);
    border-radius: 20px;
    padding: 20px 40px;
    box-shadow: var(--shadow-sm);
}

.digital-clock-led {
    font-family: var(--font-digital);
    font-size: 64px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    line-height: 1;
    user-select: none;
}

.glow-orange {
    color: var(--amber);
    text-shadow: 0 0 15px rgba(245, 166, 35, 0.6);
}

.glow-blue {
    color: var(--primary);
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
}

.clock-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 600px;
}

@media (max-width: 500px) {
    .clock-options-grid {
        grid-template-columns: 1fr;
    }
}

.mini-clock-option {
    background-color: var(--bg-card);
    border: 3px solid var(--border-color);
    border-radius: 20px;
    padding: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mini-clock-option svg {
    width: 140px;
    height: 140px;
}

.mini-clock-option:hover {
    transform: scale(1.04);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    background-color: var(--primary-light);
}

.mini-clock-option.correct {
    border-color: var(--green-correct) !important;
    background-color: rgba(46, 204, 113, 0.15) !important;
    box-shadow: 0 0 20px var(--green-correct) !important;
}

.mini-clock-option.incorrect {
    border-color: var(--red-incorrect) !important;
    background-color: rgba(231, 76, 60, 0.15) !important;
    box-shadow: 0 0 20px var(--red-incorrect) !important;
    animation: shake 0.4s ease-in-out;
}

/* Mode 3 Interactive screen design */
.interactive-split-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    width: 100%;
}

@media (max-width: 780px) {
    .interactive-split-layout {
        grid-template-columns: 1fr;
    }
}

.interactive-clock-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.draggable-clock {
    cursor: grab;
}

.draggable-clock:active {
    cursor: grabbing;
}

.drag-hint {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    background-color: var(--bg-app);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px dashed var(--border-color);
}

/* Invisible dragging pads */
.drag-pad {
    fill: transparent;
    cursor: pointer;
}

.drag-pad:hover {
    fill: rgba(74, 144, 226, 0.1);
}

/* Digital Watch & 7-Segment Styles */
:root {
    --segment-off-fill: rgba(61, 59, 60, 0.06);
}

[data-theme="dark"] {
    --segment-off-fill: rgba(241, 245, 249, 0.06);
}

.digital-watch-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.watch-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.watch-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.watch-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.watch-panel-container {
    background-color: var(--bg-card);
    border: 3px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.segment-display-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.segment-digit-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.digit-title {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

#col-digit-h1 .digit-title, #col-digit-h2 .digit-title {
    color: var(--primary);
}

#col-digit-m1 .digit-title {
    color: var(--amber);
}

#col-digit-m2 .digit-title {
    color: var(--accent);
}

.segment-digit {
    width: 50px;
    height: 80px;
}

.svg-digit {
    width: 100%;
    height: 100%;
}

.segment {
    fill: var(--segment-off-fill);
    stroke: var(--bg-card);
    stroke-width: 1.5px;
    transition: fill 0.15s ease, filter 0.15s ease;
}

/* Active Segment colors per digit type */
.segment-digit-wrapper .segment.active-hour {
    fill: var(--primary);
    filter: drop-shadow(0 0 4px var(--primary));
}

.segment-digit-wrapper .segment.active-mint {
    fill: var(--amber);
    filter: drop-shadow(0 0 4px var(--amber));
}

.segment-digit-wrapper .segment.active-minu {
    fill: var(--accent);
    filter: drop-shadow(0 0 4px var(--accent));
}

.digit-value {
    font-family: var(--font-digital);
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

#col-digit-h1 .digit-value, #col-digit-h2 .digit-value {
    color: var(--primary);
}

#col-digit-m1 .digit-value {
    color: var(--amber);
}

#col-digit-m2 .digit-value {
    color: var(--accent);
}

.watch-colon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    margin: 0 4px;
    margin-top: 14px; /* Align visually with digits */
}

.colon-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    animation: colon-blink 1s infinite;
}

@keyframes colon-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.watch-explanation-card {
    background-color: var(--bg-card-header);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.watch-explanation-card strong {
    color: var(--text-primary);
}

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

.safe-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    border: 2px solid #94a3b8;
    color: #334155;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

[data-theme="dark"] .safe-btn {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-color: #334155;
    color: #94a3b8;
}

.safe-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #047857;
    color: white;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.safe-game-panel {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border: 3px dashed var(--border-color);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    transition: all 0.3s ease;
    width: 100%;
}

[data-theme="dark"] .safe-game-panel {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

.safe-game-panel.hidden {
    display: none !important;
}

.safe-instructions {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.safe-combination-steps {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.safe-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background-color: var(--bg-card);
    border: 3px solid var(--border-color);
    border-radius: 16px;
    min-width: 70px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.safe-step-indicator.current {
    border-color: var(--amber);
    box-shadow: 0 0 12px rgba(245, 166, 35, 0.4);
    transform: scale(1.08);
}

.safe-step-indicator.completed {
    border-color: var(--green-correct);
    background-color: var(--primary-light);
    transform: scale(0.95);
    opacity: 0.8;
}

[data-theme="dark"] .safe-step-indicator.completed {
    background-color: rgba(16, 185, 129, 0.1);
}

.step-arrow {
    font-size: 18px;
}

.step-target {
    font-family: var(--font-digital);
    font-size: 24px;
    font-weight: 700;
}

.safe-status-row {
    display: flex;
    justify-content: center;
    width: 100%;
}

.safe-status-badge {
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 30px;
    background-color: var(--accent);
    color: white;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.safe-status-badge.unlocked {
    background-color: var(--green-correct);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Safe Mode Clock Face override */
.safe-mode-active .clock-outer-bump {
    fill: #475569;
    stroke: #1e293b;
}

.safe-mode-active .clock-face {
    fill: #475569;
    stroke: #334155;
    stroke-width: 6px;
}

.safe-mode-active .clock-rim-accent {
    stroke: #94a3b8;
}

.safe-mode-active .clock-ticks-hour {
    stroke: #e2e8f0;
    stroke-width: 3px;
}

.safe-mode-active .clock-ticks-minute {
    stroke: #94a3b8;
}

.safe-mode-active .clock-number {
    fill: #f8fafc;
    font-weight: 800;
}

.safe-mode-active .hour-hand {
    stroke: #1e293b;
    stroke-width: 12px;
}

.safe-mode-active .minute-hand {
    stroke: #3b4252;
    stroke-width: 7px;
}

.safe-mode-active .clock-center-cap {
    fill: #e2e8f0;
    stroke: #1e293b;
    stroke-width: 3px;
}

/* Treasure Reveal styling */
.safe-treasure-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: var(--bg-card);
    border: 3px solid var(--green-correct);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 0.9; transform: scale(1.1); }
    80% { transform: scale(0.89); }
    100% { opacity: 1; transform: scale(1); }
}

.treasure-msg {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--green-correct);
    text-align: center;
}

.treasure-img {
    max-width: 220px;
    width: 100%;
    border-radius: 20px;
    border: 4px solid var(--border-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.treasure-img:hover {
    transform: scale(1.05) rotate(2deg);
}

/* Toast Message */
.toast-feedback {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translate(-50%, 100px);
    background-color: var(--bg-card);
    border: 3px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: 50px;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    font-weight: 700;
    font-size: 16px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.toast-feedback.visible {
    transform: translate(-50%, 0);
}

.toast-feedback.success {
    border-color: var(--green-correct);
    color: var(--green-correct);
}

.toast-feedback.fail {
    border-color: var(--red-incorrect);
    color: var(--red-incorrect);
}

.toast-icon {
    font-size: 22px;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    border: 4px solid var(--border-color);
    border-radius: 24px;
    max-width: 420px;
    width: 100%;
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.modal-icon {
    font-size: 64px;
    line-height: 1;
}

.modal-icon.animated {
    animation: bounce 1.5s infinite alternate ease-in-out;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-12px); }
}

.modal-content h2 {
    font-family: var(--font-heading);
    font-size: 26px;
    color: var(--text-primary);
}

.modal-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-stats {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.modal-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
}

.modal-stat-val {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--primary);
}

.modal-action-btn {
    border: none;
    outline: none;
    background-color: var(--primary);
    color: #ffffff;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 16px;
    padding: 14px 32px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: all var(--transition-speed);
    width: 100%;
}

.modal-action-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.6);
}

.modal-action-btn:active {
    transform: scale(0.98);
}

.modal-action-btn.btn-success {
    background-color: var(--green-correct);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
}

.modal-action-btn.btn-success:hover {
    box-shadow: 0 0 25px rgba(46, 204, 113, 0.7);
}

/* Celebration Badge styles */
.badge-display {
    background-color: var(--bg-app);
    border: 2px dashed var(--amber);
    padding: 16px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
    width: 80%;
}

.badge-icon {
    font-size: 40px;
}

.badge-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--amber);
    text-transform: uppercase;
}
