/* ==========================================================================
   PIXEL QUEST - GLOBAL STYLESHEET (AURORA THEME)
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
    --bg-dark: #0a0813;
    --bg-workspace: #181625;
    --bg-canvas: #1e1e1e;
    
    /* Aurora Colors */
    --purple-glow: rgba(147, 51, 234, 0.45);
    --blue-glow: rgba(59, 130, 246, 0.4);
    --cyan-glow: rgba(6, 182, 212, 0.4);
    --pink-glow: rgba(236, 72, 153, 0.35);

    /* Text & Accents */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-cyan: #06b6d4;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    
    /* System States */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --glass-active: rgba(255, 255, 255, 0.12);
    --glass-blur: blur(16px);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-ui: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-ui);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   AURORA BACKGROUND ANIMATIONS
   ========================================================================== */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -10;
    background-color: var(--bg-dark);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    mix-blend-mode: screen;
    will-change: transform;
}

.blob-purple {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--purple-glow) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation: float-slow 25s infinite alternate ease-in-out;
}

.blob-blue {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--blue-glow) 0%, transparent 70%);
    bottom: -15%;
    right: -10%;
    animation: float-slow 30s infinite alternate-reverse ease-in-out;
}

.blob-cyan {
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 70%);
    top: 30%;
    right: 15%;
    animation: float-slow 20s infinite alternate ease-in-out;
}

.blob-pink {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, var(--pink-glow) 0%, transparent 70%);
    bottom: 25%;
    left: 10%;
    animation: float-slow 22s infinite alternate-reverse ease-in-out;
}

@keyframes float-slow {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    50% {
        transform: translate(8%, 6%) scale(1.1) rotate(180deg);
    }
    100% {
        transform: translate(-5%, -8%) scale(0.9) rotate(360deg);
    }
}

/* ==========================================================================
   GLASSMORPHISM STYLES
   ========================================================================== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.clickable {
    cursor: pointer;
    transition: var(--transition-smooth);
}

.clickable:hover {
    background: var(--glass-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(147, 51, 234, 0.15);
}

.clickable:active {
    transform: translateY(0);
    background: var(--glass-active);
}

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */
.app-container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    padding: 20px;
    z-index: 1;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-radius: 16px;
    margin-bottom: 20px;
    height: 70px;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 40%, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-accent {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: 2px;
}

/* Player Stats */
.player-stats {
    display: flex;
    align-items: center;
    gap: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
}

/* Progress bar */
.progress-bar-container {
    width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-percent {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-cyan);
}

/* ==========================================================================
   SCREEN 1: THE HUB
   ========================================================================== */
.hub-screen {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.hub-hero {
    text-align: center;
    margin: 30px 0 45px 0;
}

.hub-hero h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 3rem;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.text-glow {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.module-card {
    display: flex;
    gap: 20px;
    padding: 24px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.module-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent-cyan);
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.module-card:hover .module-icon {
    color: #ffffff;
    transform: scale(1.08);
}

/* Icon specific theme overlays */
.module-card[data-module="masks"] .module-icon { color: var(--accent-purple); background: rgba(168, 85, 247, 0.1); }
.module-card[data-module="pen"] .module-icon { color: var(--accent-cyan); background: rgba(6, 182, 212, 0.1); }
.module-card[data-module="typo"] .module-icon { color: var(--accent-pink); background: rgba(236, 72, 153, 0.1); }
.module-card[data-module="colors"] .module-icon { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.module-card[data-module="hierarchy"] .module-icon { color: #10b981; background: rgba(16, 185, 129, 0.1); }

.module-card:hover[data-module="masks"] .module-icon { box-shadow: 0 0 20px rgba(168, 85, 247, 0.3); }
.module-card:hover[data-module="pen"] .module-icon { box-shadow: 0 0 20px rgba(6, 182, 212, 0.3); }
.module-card:hover[data-module="typo"] .module-icon { box-shadow: 0 0 20px rgba(236, 72, 153, 0.3); }
.module-card:hover[data-module="colors"] .module-icon { box-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }
.module-card:hover[data-module="hierarchy"] .module-icon { box-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }

.module-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.module-info h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #ffffff;
}

.module-info p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.4;
    margin-bottom: 16px;
}

.module-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.difficulty {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
}

.difficulty.easy { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.difficulty.medium { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.difficulty.hard { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.levels-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* ==========================================================================
   SCREEN 2: WORKSPACE (PHOTOSHOP SIMULATION)
   ========================================================================== */
.game-screen {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    animation: fade-in 0.4s ease-out;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

/* Game Control Bar */
.game-control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-radius: 12px;
    margin-bottom: 12px;
    height: 54px;
}

.game-title-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.game-title-container h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
}

.separator {
    color: var(--text-muted);
    font-weight: 300;
}

#game-level-indicator {
    color: var(--accent-cyan);
    font-weight: 600;
    font-size: 0.95rem;
}

.level-dots {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    max-width: 280px;
    padding: 2px 4px;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.level-dots::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.level-dot {
    flex-shrink: 0;
}

.level-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.level-dot.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.level-dot.completed {
    background: var(--success);
    border-color: var(--success);
    color: #ffffff;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    font-family: var(--font-ui);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.45);
    background: linear-gradient(135deg, #b366ff, #ff66cc);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-back {
    padding: 8px 14px;
    font-size: 0.8rem;
}

/* Workspace Frame */
.workspace {
    display: flex;
    flex: 1;
    gap: 12px;
    height: calc(100vh - 190px);
    overflow: hidden;
}

/* Left Toolbar */
.sidebar-tools {
    width: 48px;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.tool-btn.active {
    background: var(--accent-cyan);
    color: #000000;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

/* Tooltip */
.tool-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 45px;
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-5px);
    transition: var(--transition-smooth);
    z-index: 10;
}

.tool-btn:hover::after {
    opacity: 0.9;
    transform: translateX(0);
}

/* Right Panels */
.sidebar-panels {
    width: 280px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.panel-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-header h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 700;
}

.panel-content {
    padding: 12px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* Instructions Details */
#level-instructions {
    color: #ffffff;
    font-weight: 400;
}

#level-instructions strong {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Layers Panel Styles */
.layers-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.layer-item.active {
    background: rgba(147, 51, 234, 0.15);
    border-color: rgba(147, 51, 234, 0.3);
    color: #ffffff;
}

.layer-visibility {
    color: var(--text-muted);
    cursor: pointer;
}

.layer-visibility.visible {
    color: var(--text-primary);
}

.layer-thumbnail {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--bg-canvas);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.layer-thumbnail.mask-thumb {
    background: #000;
    margin-left: 2px;
    border: 1px solid var(--text-muted);
    position: relative;
}

.layer-thumbnail.mask-thumb::before {
    content: 'M';
    font-size: 0.5rem;
    position: absolute;
    bottom: 0;
    right: 1px;
    color: #888;
}

.layer-name {
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Tool Properties Styles */
.property-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.property-group:last-child {
    margin-bottom: 0;
}

.property-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

.slider-input {
    flex: 1;
    accent-color: var(--accent-cyan);
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.slider-val {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 32px;
    text-align: right;
    color: #ffffff;
}

.color-indicator {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #ffffff;
    cursor: pointer;
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.5);
}

.color-swatch-list {
    display: flex;
    gap: 6px;
}

.color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.color-swatch.active {
    border-color: #ffffff;
    box-shadow: 0 0 6px currentColor;
}

/* Center Canvas */
.canvas-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.canvas-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 20px;
    transition: var(--transition-smooth);
}

.canvas-wrapper.full-stage {
    padding: 0 !important;
    border: none !important;
    border-radius: 12px;
    box-shadow: none !important;
}

.game-stage {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background-color: #202020;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.canvas-wrapper.full-stage .game-stage {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 12px;
}

/* Checkerboard Background (Photoshop style) */
.checkerboard {
    background-image: 
        linear-gradient(45deg, #2b2b2b 25%, transparent 25%), 
        linear-gradient(-45deg, #2b2b2b 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #2b2b2b 75%), 
        linear-gradient(-45deg, transparent 75%, #2b2b2b 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-color: #1e1e1e;
}

/* Workspace Footer */
/* Old footer (kept for reference, no longer rendered) */
.workspace-footer {
    display: none;
}

/* New clean fullscreen layout */
.workspace-clean {
    position: relative;
    width: 100%;
    max-width: 1400px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.new-header-bar {
    width: 100%;
    max-width: 1400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 10px;
    flex-shrink: 0;
}

.new-bottom-bar {
    width: 100%;
    max-width: 1400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 0 10px;
    flex-shrink: 0;
}

#btn-global-help:hover {
    background: rgba(6, 182, 212, 0.2) !important;
    border-color: var(--accent-cyan) !important;
    color: var(--accent-cyan) !important;
}



/* ==========================================================================
   FEEDBACK OVERLAY & DIALOG
   ========================================================================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 8, 19, 0.7);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.3s ease-out;
}

.feedback-card {
    width: 420px;
    border-radius: 24px;
    padding: 40px 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
}

.feedback-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.text-center {
    text-align: center;
}

.feedback-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-icon.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.feedback-icon.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.feedback-card h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.feedback-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 30px;
}

.feedback-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
}

.f-stat {
    display: flex;
    flex-direction: column;
}

.f-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.f-stat-value {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    margin-top: 4px;
}

.feedback-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.feedback-actions .btn {
    flex: 1;
}

/* ==========================================================================
   MINI-GAMES SPECIFIC ELEMENTS
   ========================================================================== */

/* Game 1: Masks Canvas & Layout */
.masks-container {
    position: relative;
    width: 400px;
    height: 400px;
    overflow: hidden;
}

.masks-canvas-target, .masks-canvas-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.masks-canvas-mask {
    mix-blend-mode: multiply;
}

.brush-preview-cursor {
    position: absolute;
    border: 1px solid #ffffff;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
    display: none;
    z-index: 100;
}

/* Game 2: Pen Tool SVG Node Styling */
.pen-stage {
    width: 100%;
    height: 100%;
    background-color: #1a1a24;
    cursor: none !important;
}

.pen-stage *, .pen-stage-wrapper, .pen-stage-wrapper * {
    cursor: none !important;
}

.pen-rubber-band {
    stroke: var(--accent-cyan);
    stroke-width: 1.5;
    stroke-dasharray: 4 4;
    fill: none;
    pointer-events: none;
    opacity: 0.75;
}

#pen-custom-cursor {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
    transform: translate(0px, 0px); /* Click hotspot is at the tip (0,0) */
    display: none;
}

.pen-target-path-margin {
    stroke: rgba(6, 182, 212, 0.15);
    stroke-width: 14;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.pen-target-path-line {
    stroke: rgba(255, 255, 255, 0.45);
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.pen-user-path {
    stroke: var(--accent-cyan);
    stroke-width: 3.5;
    fill: none;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

#pen-user-graphics {
    transition: opacity 0.4s ease;
}

.fade-error {
    opacity: 0 !important;
}

.pen-guide-circle {
    fill: rgba(6, 182, 212, 0.2);
    stroke: var(--accent-cyan);
    stroke-width: 1.5;
    r: 10;
}

.pen-anchor {
    fill: #1e1e1e;
    stroke: var(--accent-cyan);
    stroke-width: 2;
    cursor: pointer;
}

.pen-anchor.active {
    fill: var(--accent-cyan);
}

.pen-handle-line {
    stroke: #888;
    stroke-width: 1;
}

.pen-handle-node {
    fill: #ffffff;
    stroke: var(--accent-cyan);
    stroke-width: 1.5;
    cursor: pointer;
}

/* Game 3: Typography Spacing Layout */
.typo-stage {
    width: 600px;
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #12111a;
    position: relative;
}

.typo-word-container {
    display: flex;
    position: relative;
    font-weight: 700;
    color: #ffffff;
    font-size: 5rem;
    letter-spacing: 0px;
}

.typo-letter {
    position: relative;
    display: inline-block;
    cursor: ew-resize;
    padding: 0 10px;
    transition: color 0.2s;
}

.typo-letter:hover {
    color: var(--accent-pink);
    background: rgba(236, 72, 153, 0.05);
}

.typo-letter.active {
    color: var(--accent-pink);
}

.typo-quiz-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    padding: 30px;
}

.typo-quiz-question {
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
}

.typo-quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.typo-quiz-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.typo-quiz-card:hover {
    background: rgba(236, 72, 153, 0.08);
    border-color: rgba(236, 72, 153, 0.3);
    transform: translateY(-2px);
}

.typo-quiz-card.selected {
    background: rgba(236, 72, 153, 0.15);
    border-color: var(--accent-pink);
}

.typo-font-sample {
    font-size: 1.6rem;
    margin-bottom: 8px;
    text-align: center;
}

.typo-font-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Game 4: Colors Layout & Curves */
.colors-stage {
    width: 520px;
    height: 380px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    background-color: #12111a;
}

.color-preview-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-target-rect, .color-user-rect {
    flex: 1;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    position: relative;
}

.color-label-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

/* curves adjustment container */
.curves-container {
    width: 240px;
    height: 240px;
    border: 1px solid #555;
    background-color: #1a1a1a;
    position: relative;
    cursor: pointer;
}

.curves-grid-line {
    stroke: #333;
    stroke-width: 1;
}

.curves-diagonal {
    stroke: #555;
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.curves-curve {
    stroke: #ffffff;
    stroke-width: 2;
    fill: none;
}

.curves-point {
    fill: var(--accent-cyan);
    stroke: #ffffff;
    stroke-width: 1.5;
    r: 6;
    cursor: ns-resize;
}

/* Game 5: Visual Hierarchy drag layout */
.hierarchy-stage {
    width: 540px;
    height: 380px;
    background: #111019;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.hierarchy-element {
    position: absolute;
    cursor: move;
    border: 1.5px dashed transparent;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}

.hierarchy-element:hover {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.03);
}

.hierarchy-element.selected {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.06);
}

.h-title {
    color: #ffffff;
    font-weight: 700;
}

.h-subtitle {
    color: var(--text-secondary);
    font-weight: 500;
}

.h-body {
    color: var(--text-muted);
    line-height: 1.4;
}

.h-button {
    background: var(--success);
    color: #ffffff;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Helper styles for layouts in hierarchy */
.hierarchy-guideline {
    position: absolute;
    background-color: rgba(239, 68, 68, 0.35);
    pointer-events: none;
    z-index: 5;
    display: none;
}

.hierarchy-guideline.vertical {
    width: 1.5px;
    height: 100%;
}

.hierarchy-guideline.horizontal {
    height: 1.5px;
    width: 100%;
}

.target-outline-box {
    position: absolute;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.01);
    pointer-events: none;
    border-radius: 4px;
}

/* ==========================================================================
   PEN TOOL TUTORIAL STYLES
   ========================================================================== */
@keyframes draw-arrow {
    0% { stroke-dashoffset: 20; opacity: 0.3; }
    50% { opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0.3; }
}

.tutorial-arrow {
    stroke: #fbbf24;
    stroke-width: 2.5;
    stroke-dasharray: 6 3;
    animation: draw-arrow 2s infinite linear;
    marker-end: url(#arrow-head);
    fill: none;
    pointer-events: none;
}

.tutorial-line {
    stroke: rgba(251, 191, 36, 0.4);
    stroke-width: 1.5;
    stroke-dasharray: 3 3;
    fill: none;
    pointer-events: none;
}

@keyframes pulse-ring-op {
    0% { opacity: 0.4; r: 8px; }
    50% { opacity: 1; r: 14px; }
    100% { opacity: 0.4; r: 8px; }
}

.tutorial-ring {
    stroke: #fbbf24;
    stroke-width: 2;
    fill: rgba(251, 191, 36, 0.08);
    pointer-events: none;
    animation: pulse-ring-op 1.8s infinite ease-in-out;
}

.tutorial-text {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    fill: #fbbf24;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* Modifier Keys HUD Overlay (Bottom Left) */
.keys-hud {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    gap: 8px;
    pointer-events: none;
    z-index: 10;
}

.hud-key {
    background: rgba(10, 8, 19, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.35);
    padding: 5px 12px;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.12s ease-out;
}

.hud-key.active {
    background: var(--accent-cyan);
    color: #000000;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
    transform: translateY(1.5px);
}

#hud-key-alt.active {
    background: var(--accent-purple);
    color: #ffffff;
    border-color: var(--accent-purple);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
}

.hud-key-btn.active {
    background: rgba(6, 182, 212, 0.25) !important;
    color: var(--accent-cyan) !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.75) !important;
}

/* Pulsing Start Guide Node */
@keyframes pulse-guide {
    0% { opacity: 0.4; stroke-width: 1.5; fill: rgba(6, 182, 212, 0.2); }
    50% { opacity: 1; stroke-width: 3.5; fill: rgba(6, 182, 212, 0.75); stroke: #ffffff; }
    100% { opacity: 0.4; stroke-width: 1.5; fill: rgba(6, 182, 212, 0.2); }
}

.pen-guide-circle.pulse-start {
    animation: pulse-guide 1.2s infinite ease-in-out;
}

/* Shake/Bounce Error Feedback Animation */
@keyframes shake-error-anim {
    0% { transform: translate(0, 0); opacity: 1; filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.8)); }
    15% { transform: translate(-8px, 0); }
    30% { transform: translate(8px, 0); }
    45% { transform: translate(-6px, 0); }
    60% { transform: translate(6px, 0); }
    75% { transform: translate(-3px, 0); }
    90% { transform: translate(3px, 0); }
    100% { transform: translate(0, 0); opacity: 0; }
}

.bounce-error {
    animation: shake-error-anim 0.6s ease-in-out;
}

/* New Games Stages Layout */
.clipping-stage {
    width: 680px;
    height: 580px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #12111a;
    position: relative;
    box-sizing: border-box;
}

.shortcuts-stage, .quiz-stage {
    width: 520px;
    height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #12111a;
    position: relative;
    box-sizing: border-box;
}

/* Quiz Option Buttons Styles */
.quiz-option-btn:hover {
    background: rgba(6, 182, 212, 0.1) !important;
    border-color: rgba(6, 182, 212, 0.3) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}
