/* ============================================
   Night Train - Narrative Roguelike
   Premium, Cinematic, Atmospheric Design
   ============================================ */

/* CSS Variables */
:root {
    --bg-dark: #0a0d12;
    /* Slightly lighter */
    --bg-panel: rgba(15, 20, 30, 0.85);
    --bg-glass: rgba(40, 45, 60, 0.5);
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-dim: #707080;

    /* Accents */
    --accent-cyan: #00f3ff;
    --accent-purple: #bf00ff;
    --accent-gold: #ffcc33;
    --accent-danger: #ff4d4d;

    /* System */
    --border-glass: rgba(255, 255, 255, 0.15);
    --shadow-premium: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 243, 255, 0.05);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark) url('../assets/images/ui_texture.png') repeat;
    background-size: 512px;
    /* High quality texture scale */
    image-rendering: pixelated;
    /* Keep the contrast sharp */
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* Typography Overrides */
h1,
h2,
h3,
.status-label,
.btn-control {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Film Grain Effect - Animated */
.film-grain {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    animation: grainShift 0.5s steps(10) infinite;
}

@keyframes grainShift {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-2%, -2%);
    }

    20% {
        transform: translate(1%, 3%);
    }

    30% {
        transform: translate(-3%, 1%);
    }

    40% {
        transform: translate(3%, -1%);
    }

    50% {
        transform: translate(-1%, 2%);
    }

    60% {
        transform: translate(2%, -3%);
    }

    70% {
        transform: translate(-2%, 1%);
    }

    80% {
        transform: translate(1%, -2%);
    }

    90% {
        transform: translate(-1%, -1%);
    }
}

/* Screen Shake Animation - for instability feedback */
@keyframes screenShake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-3px, -2px);
    }

    20% {
        transform: translate(3px, 2px);
    }

    30% {
        transform: translate(-2px, 3px);
    }

    40% {
        transform: translate(2px, -3px);
    }

    50% {
        transform: translate(-3px, 2px);
    }

    60% {
        transform: translate(3px, -2px);
    }

    70% {
        transform: translate(-2px, -3px);
    }

    80% {
        transform: translate(2px, 3px);
    }

    90% {
        transform: translate(-1px, -1px);
    }
}

.shake {
    animation: screenShake 0.4s ease-in-out;
}

/* Status Bar (Cockpit Style) */
.status-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 1.2rem;
    background: rgba(5, 5, 8, 0.9);
    border-bottom: 1px solid var(--border-glass);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.status-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    width: 0%;
    height: 2px;
    background: var(--accent-cyan);
    transition: width var(--transition-base);
}

.status-item:hover::after {
    width: 100%;
}

.status-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-bottom: 0.2rem;
}

.status-value {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Main Game Container - Galgame Style */
.game-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    padding: 0;
    gap: 0;
    position: relative;
}

/* Visual Panel - Full Screen */
.visual-panel {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
}

.background-layer {
    width: 100%;
    height: 100%;
    transition: transform 5s linear;
}

.background-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7) contrast(1.1);
}

.npc-layer {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 85%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}

.npc-layer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(0, 0, 0, 0.8));
    animation: portraitFloat 6s ease-in-out infinite;
}

@keyframes portraitFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Dialog Overlay - Lateral floating style (Left Side) */
.dialog-overlay {
    position: absolute;
    bottom: 40px;
    left: 40px;
    width: 420px;
    background: rgba(8, 10, 15, 0.4);
    /* Higher transparency */
    padding: 1rem 1.5rem 0.5rem;
    z-index: 10;
    backdrop-filter: blur(8px) saturate(150%);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}

.npc-layer {
    position: absolute;
    bottom: 0;
    left: 55%;
    /* Shift to right as chat is on left */
    transform: translateX(-50%);
    width: 60%;
    height: 90%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
    transition: left 0.5s ease;
}

.dialog-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.dialog-header .scene-title {
    font-size: 1.2rem;
    color: var(--accent-cyan);
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.dialog-header .scene-npc {
    color: var(--accent-purple);
    font-size: 0.85rem;
}

/* Choices Panel - Right Side */
.choices-panel {
    width: 280px;
    background: var(--bg-panel) url('../assets/images/ui_texture.png') repeat;
    background-blend-mode: overlay;
    backdrop-filter: blur(15px);
    border-left: 1px solid var(--border-glass);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 20;
    box-shadow: inset 5px 0 15px rgba(0, 0, 0, 0.5);
}

/* Legacy .text-panel removed - now using .dialog-overlay */

/* Legacy .scene-header for compatibility */
.scene-header {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
}

.scene-title {
    font-size: 1.2rem;
    color: var(--accent-cyan);
    margin-bottom: 0.3rem;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.scene-npc {
    color: var(--accent-purple);
    font-size: 0.85rem;
    font-style: normal;
}

/* Dialog Text Area - Scrollable with fade effect */
.scene-text {
    max-height: 220px;
    /* Allow more text in narrower container */
    overflow-y: auto;
    margin-bottom: 0.8rem;
    padding-right: 1rem;
    flex-shrink: 0;
    /* Fade effect at the top */
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%);
}

.scene-text::-webkit-scrollbar {
    width: 4px;
}

.scene-text::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.scene-text::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 10px;
    opacity: 0.5;
}

.scene-text p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    animation: slideUpFade 0.6s var(--transition-base);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Message Styles */
.message-user {
    color: var(--accent-cyan);
    font-style: italic;
    text-align: right;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.message-npc {
    border-left: 2px solid var(--accent-purple);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

/* Input Area */
.chat-input-area {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    position: relative;
}

/* Scene Navigation - Compact version */
.scene-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0 0.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0.4rem;
}

.nav-btn {
    background: rgba(255, 204, 51, 0.1);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    transition: all var(--transition-base);
    font-family: inherit;
}

.nav-btn:hover {
    background: var(--accent-gold);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(255, 204, 51, 0.4);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-divider {
    color: var(--text-dim);
    font-size: 0.7rem;
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-base);
}

#chat-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

#btn-send-chat {
    background: var(--bg-glass);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 0 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    transition: all var(--transition-base);
}

#btn-send-chat:hover {
    background: var(--accent-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

#btn-send-chat:disabled,
#chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Indicator */
.chat-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.chat-loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid var(--accent-cyan);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* System message style */
.message-system {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    border-left: 2px solid var(--accent-gold);
    padding-left: 1rem;
    margin-bottom: 1rem;
}

/* Choice Buttons */
.choices-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.choice-btn {
    background: linear-gradient(rgba(40, 45, 60, 0.6), rgba(20, 25, 30, 0.8)), url('../assets/images/button_texture.png') center/cover no-repeat;
    background-blend-mode: luminosity;
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 1.2rem;
    border-radius: 4px;
    /* More rectangular, classic feel */
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(0, 0, 0, 0.5);
    text-transform: none;
    /* Keep natural case */
}

.choice-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.2), transparent);
    transition: width var(--transition-base);
    z-index: 1;
}

.choice-btn span {
    position: relative;
    z-index: 2;
}

.choice-btn:hover {
    border-color: var(--accent-cyan);
    transform: translateX(8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(0, 243, 255, 0.1);
    background-blend-mode: normal;
    /* Recover original color on hover */
}

.choice-btn:hover::before {
    width: 100%;
}

.choice-btn:active {
    transform: translateX(4px) scale(0.98);
}

/* Ending Overlay */
.ending-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 2, 5, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow);
}

.ending-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ending-content {
    max-width: 600px;
    text-align: center;
    padding: 4rem;
}

.ending-title {
    font-size: 3.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.ending-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 2;
    margin-bottom: 3rem;
}

.btn-next-loop {
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 1.2rem 4rem;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.3em;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-next-loop:hover {
    background: var(--accent-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.5);
}

/* Control Bar - Now inside choices-panel */
.control-bar {
    display: none;
    /* Legacy, no longer used */
}

/* Panel Controls (Inside choices-panel) */
.panel-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.panel-divider {
    height: 1px;
    background: var(--border-glass);
    margin-bottom: 1rem;
}

.btn-control {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-control:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--text-primary);
}

.btn-danger:hover {
    background: rgba(255, 77, 77, 0.1);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

/* Responsive - Galgame Layout */
@media (max-width: 1100px) {
    .choices-panel {
        width: 240px;
    }
}

@media (max-width: 900px) {
    .game-container {
        flex-direction: column;
    }

    .choices-panel {
        width: 100%;
        max-height: 150px;
        border-left: none;
        border-top: 1px solid var(--border-glass);
    }

    .dialog-overlay {
        padding: 1rem;
    }

    .scene-text {
        max-height: 80px;
    }
}

/* History Panel */
.history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 8, 0.95);
    z-index: 1500;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.history-overlay.active {
    opacity: 1;
    visibility: visible;
}

.history-panel {
    width: 600px;
    height: 80vh;
    background: rgba(20, 25, 35, 0.9);
    border: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.history-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 35, 50, 0.4);
}

.history-header h2 {
    color: var(--accent-gold);
    margin: 0;
    font-size: 1.2rem;
}

.btn-close-history {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.btn-close-history:hover {
    color: var(--text-primary);
}

.history-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-scene-title {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.history-text {
    line-height: 1.6;
    color: var(--text-secondary);
}

.history-npc-name {
    color: var(--accent-purple);
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

/* Mobile Adaptation (+ New Breakpoints) */
@media (max-width: 600px) {

    /* Hide Non-Essential Elements */
    .dialog-header,
    .choices-panel,
    .thoughts-container,
    .turn-counter,
    .scene-header,
    .nav-divider {
        display: none !important;
    }

    /* Slime & Float Dialog Overlay */
    .dialog-overlay {
        left: 50% !important;
        transform: translateX(-50%) !important;
        bottom: 12px !important;
        width: 94% !important;
        max-width: none !important;
        padding: 0.8rem 1rem 0.5rem !important;
        background: rgba(8, 10, 15, 0.45) !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(6px) !important;
        -webkit-backdrop-filter: blur(6px) !important;
    }

    .npc-layer {
        left: 50% !important;
        width: 85% !important;
        height: 80% !important;
        z-index: 5 !important;
    }

    .status-bar {
        gap: 0.4rem;
        padding: 0.4rem;
        background: rgba(0, 0, 0, 0.2);
    }

    .scene-text {
        max-height: 140px !important;
        margin-bottom: 0.6rem !important;
        mask-image: linear-gradient(to bottom, transparent 0%, black 10%);
    }

    .scene-text p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 0.4rem !important;
    }

    .chat-input-area {
        gap: 0.4rem !important;
    }

    #chat-input {
        padding: 0.5rem 0.8rem !important;
        font-size: 16px !important;
        background: rgba(255, 255, 255, 0.03) !important;
    }

    #btn-send-chat {
        padding: 0 0.8rem !important;
        font-size: 0.75rem !important;
    }

    .scene-nav {
        padding: 0.4rem 0 0.2rem !important;
        gap: 0.4rem !important;
    }

    .nav-btn {
        padding: 0.4rem 0.4rem !important;
        font-size: 0.65rem !important;
    }

    #btn-bgm-mobile {
        display: flex !important;
    }

    #btn-new-game-mobile {
        display: flex !important;
        font-size: 1.1rem !important;
        color: var(--accent-gold) !important;
    }

    /* Active feedback for mobile buttons */
    .btn-help:active,
    .nav-btn:active,
    #btn-send-chat:active {
        transform: scale(0.92);
        opacity: 0.7;
    }
}

/* Tutorial Overlay Settings */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
}

.tutorial-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tutorial-card {
    background: var(--bg-panel) url('../assets/images/ui_texture.png') repeat;
    background-blend-mode: overlay;
    border: 1px solid var(--border-glass);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    padding: 3rem;
    border-radius: 4px;
    box-shadow: var(--shadow-premium);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    animation: slideUpFade 0.8s var(--transition-base);
}

.tutorial-title {
    text-align: center;
    color: var(--accent-cyan);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}

/* Atmospheric Opening Text */
.tutorial-opening {
    text-align: center;
    padding: 1rem 0;
}

.tutorial-opening p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 0.3rem;
}

.tutorial-opening .tutorial-break {
    height: 1rem;
}

.tutorial-opening .tutorial-hint {
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 1.15rem;
    text-shadow: 0 0 10px rgba(255, 204, 51, 0.3);
}

/* Tips Section */
.tutorial-tips {
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--accent-purple);
    padding: 1rem 1.5rem;
}

.tutorial-tips h3 {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    font-weight: normal;
}

.tutorial-tip {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.tutorial-tip strong {
    color: var(--text-primary);
}

.tutorial-tip:last-child {
    margin-bottom: 0;
}

/* Tutorial Mechanics Section */
.tutorial-mechanics {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--accent-cyan);
    padding: 1rem 1.5rem;
}

.tutorial-mechanics h3 {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-weight: normal;
}

.tutorial-mechanic-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.mechanic-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.mechanic-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.mechanic-text strong {
    color: var(--accent-cyan);
}

/* Tutorial Stats Section */
.tutorial-stats {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--accent-gold);
    padding: 1rem 1.5rem;
}

.tutorial-stats h3 {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    font-weight: normal;
}

.tutorial-stat-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.6rem;
}

.tutorial-stat-item strong {
    color: var(--accent-gold);
}

.tutorial-stat-item:last-child {
    margin-bottom: 0;
}

/* Tutorial Goal */
.tutorial-goal {
    text-align: center;
    padding: 1rem;
    border: 1px solid var(--accent-gold);
    background: rgba(255, 204, 51, 0.05);
}

.tutorial-goal p {
    color: var(--accent-gold);
    margin: 0;
}

.btn-tutorial-start {
    align-self: center;
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 1rem 3rem;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-top: 1rem;
}

.btn-tutorial-start:hover {
    background: var(--accent-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}

/* Help Button in Status Bar */
.btn-help {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-dim);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#btn-bgm-mobile,
#btn-new-game-mobile {
    display: none;
    /* Desktop hidden */
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2000;
}

.status-controls {
    display: flex;
    gap: 0.8rem;
    margin-left: auto;
}

.btn-help:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

/* Thoughts Container (Hint System) */
.thoughts-container {
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border-left: 2px solid var(--accent-purple);
    font-size: 0.8rem;
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.thoughts-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.thoughts-header {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.75rem;
}

.turn-counter {
    font-size: 0.75rem;
    color: var(--text-dim);
    opacity: 0.9;
    transition: color 0.3s;
}

.thoughts-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.thoughts-list li {
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    padding-left: 1.2rem;
    position: relative;
    transition: opacity 1s ease-in-out, color 1s ease-in-out;
}

.thoughts-list li::before {
    content: "☐";
    position: absolute;
    left: 0;
    color: var(--text-dim);
}

.thoughts-list li.thought-updated {
    animation: thoughtPulse 1.5s ease-out;
}

@keyframes thoughtPulse {
    0% {
        color: var(--accent-cyan);
        opacity: 1;
    }

    100% {
        color: var(--text-secondary);
        opacity: 0.85;
    }
}