﻿body {
    font-family: Arial, sans-serif;
    background: #1e1e1e;
    color: #f0d7b5;
    padding: 20px;
    overflow-x: hidden;
}

:root {
    --game-scale: 1;
    --game-scale-inverse: 1;
    --game-base-width: 1718px;
}

@font-face {
    font-family: 'Ithaca';
    src: url('./assets/fonts/Ithaca-LVB75.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

h1 {
    font-family: 'Ithaca', sans-serif;
    margin-bottom: 20px;
    text-align: center;
    font-size: 46px;
    line-height: 1.1;
    letter-spacing: 2px;
    color: #f0d7b5;
    text-shadow:
        3px 3px 0 #0d0908,
        0 0 14px rgba(216, 155, 60, 0.22);
}

#start-screen {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 26px;
    position: relative;
}

#start-screen h1 {
    font-size: 64px;
    letter-spacing: 4px;
    margin-bottom: 6px;
}

#start-screen button {
    background:
        linear-gradient(
            180deg,
            #7b5d3b 0%,
            #4d3735 58%,
            #2f201b 100%
        );
    border: 3px solid #2a1b18;
    border-top-color: #b1844f;
    border-left-color: #b1844f;
    border-bottom: 6px solid #1b100e;
    color: #f0d7b5;
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,0.06),
        0 4px 0 #120d0a,
        0 0 14px rgba(216,155,60,0.14);
}

#start-screen button:hover {
    filter: brightness(1.12);
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,0.08),
        0 4px 0 #120d0a,
        0 0 18px rgba(216,155,60,0.28);
}

#start-screen #support-project-btn {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 218px;
    padding-left: 8px;
    padding-right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    background:
        linear-gradient(
            180deg,
            #e6b64b 0%,
            #b9792c 58%,
            #74421f 100%
        );
    border-top-color: #ffe39a;
    border-left-color: #ffe39a;
    color: #fff5c8;
    font-size: 14px;
    z-index: 10;
}

#start-screen #support-project-btn:hover {
    filter: brightness(1.12);
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,0.10),
        0 4px 0 #3a1f0f,
        0 0 18px rgba(255,205,80,0.32);
}

#version-label {
    position: fixed;
    left: 24px;
    bottom: 22px;
    color: rgba(240, 215, 181, 0.62);
    font-family: 'superhelio _regular', sans-serif;
    font-size: 13px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
    z-index: 10;
    pointer-events: none;
}

.support-heart-gif {
    width: 17px;
    height: 17px;
    object-fit: contain;
    image-rendering: pixelated;
    flex: 0 0 auto;
}

#start-screen.hidden,
#game-shell.hidden,
#game-screen.hidden {
    display: none;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

#game-shell {
    position: relative;
    width: fit-content;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 0 var(--game-base-width);
    align-items: start;
    zoom: var(--game-scale);
}

#game-screen {
    position: relative;
    width: var(--game-base-width);
    min-height: 790px;
    margin: 0;
}

#level-banner-stack {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    top: 14px;
    left: -148px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    z-index: 30;
    pointer-events: auto;
}

.level-banner {
    position: relative;
    width: 120px;
    height: 55px;
    margin-bottom: -18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url("./assets/ui/level_banner.svg") center / 100% 100% no-repeat;
    image-rendering: pixelated;
    cursor: default;
    transition:
        transform 0.16s ease,
        filter 0.16s ease,
        opacity 0.16s ease;
}

.level-banner span {
    position: relative;
    z-index: 1;
    padding-right: 0;
    transform: translate(12px, -2px);
    font-family: 'Ithaca', sans-serif;
    font-size: 36px;
    line-height: 0.9;
    letter-spacing: 1px;
    color: #f0d7b5;
    text-shadow:
        2px 2px 0 #0d0908,
        0 0 8px rgba(255, 206, 98, 0.22);
}

.level-banner.completed {
    opacity: 0.72;
    filter: saturate(0.78) brightness(0.86);
}

.level-banner:hover {
    opacity: 1;
    transform: translateX(10px) scale(1.06);
    filter:
        saturate(1.12)
        brightness(1.1)
        drop-shadow(0 0 10px rgba(216, 155, 60, 0.36));
}

.level-banner.current {
    opacity: 1;
    transform: translateX(12px) scale(1.05);
    filter:
        saturate(1.15)
        brightness(1.08)
        drop-shadow(0 0 8px rgba(216, 155, 60, 0.30));
}

.level-banner.current:hover {
    transform: translateX(18px) scale(1.09);
    filter:
        saturate(1.22)
        brightness(1.16)
        drop-shadow(0 0 12px rgba(255, 206, 98, 0.46));
}

#title-image-frame {
    width: min(760px, 86vw, calc(48vh * 16 / 9));
    margin-bottom: 8px;
    padding: 10px;
    position: relative;
    background:
        linear-gradient(180deg, #7b5d3b 0%, #3b2a22 100%);
    border: 4px solid #1b100e;
    border-top-color: #b1844f;
    border-left-color: #b1844f;
    border-radius: 6px;
    box-shadow:
        inset 0 0 0 3px rgba(255, 218, 139, 0.12),
        inset 0 0 22px rgba(0, 0, 0, 0.45),
        0 8px 0 #120d0a,
        0 18px 24px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
    image-rendering: pixelated;
}

#title-image {
    width: 100%;
    height: auto;
    max-height: none;
    display: block;
    object-fit: contain;
    image-rendering: pixelated;
    border: 3px solid #2a1b18;
    box-sizing: border-box;
}

.title-banner {
    position: absolute;
    top: -110px;
    width: clamp(180px, 13vw, 250px);
    image-rendering: pixelated;
    pointer-events: none;
    z-index: 2;
    filter:
        drop-shadow(0 8px 8px rgba(0,0,0,0.42));
    will-change: filter;
}

.title-banner-left {
    left: max(24px, calc(50% - 760px));
}

.title-banner-right {
    right: max(24px, calc(50% - 760px));
}

.top-layout {
    --top-decoration-space: 24px;
    width: fit-content;
    margin: 10px auto 24px auto;
    padding-top: 10px;
    display: grid;
    grid-template-columns:
        470px
        720px
        480px;
    gap: 24px;
}

.bottom-layout {
    width: 720px;
    margin: 0 auto;
    height: 270px;
}

#shop-screen {
    position: relative;
    width: 100%;
    height: 420px;
    margin: 0 auto 30px auto;
    margin-bottom: 0;
    background: #7bb36a;
    border: 5px solid #7c5f3a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 25px rgba(0,0,0,0.4), 0 0 20px rgba(0,0,0,0.5);
}

/* =======================================================
    SHOPKEEPER
======================================================= */

#shopkeeper {
    position: absolute;
    height: 270px;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    image-rendering: pixelated;
    z-index: 5;
    animation: idleFloat 3s ease-in-out infinite;
}

@keyframes idleFloat {
    0% { transform: translateX(-50%) translateY(0px); }
    50% { transform: translateX(-50%) translateY(2px); }
    100% { transform: translateX(-50%) translateY(0px); }
}

#shopkeeper-dialogue {
    position: absolute;
    bottom: 300px;
    left: 70%;
    transform: translateX(-50%);
    max-width: 160px;
    padding: 10px 14px;
    background: rgba(28,28,28,0.95);
    border: 2px solid #d89b3c;
    border-radius: 10px;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 14px;
    color: #f5f5f5;
    text-align: center;
    box-shadow: 0 0 12px rgba(0,0,0,0.4);
    z-index: 30;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    animation: npcBubbleFloat 4s ease-in-out infinite;
}


@keyframes npcBubbleFloat {
    0% {
        transform: translateX(-50%) translateY(0px);
    }
    50% {
        transform: translateX(-50%) translateY(-2px);
    }
    100% {
        transform: translateX(-50%) translateY(0px);
    }
}

#shopkeeper-hint {
    position: absolute;
    bottom: 240px;
    left: 30%;
    transform: translateX(-50%);
    max-width: 180px;
    padding: 10px 14px;
    background: rgba(28,28,28,0.96);
    border: 2px solid #4fe08f;
    border-left: 5px solid #83ffb5;
    border-radius: 10px;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #eafff1;
    text-align: center;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.45);
    box-shadow:
        0 0 12px rgba(0,0,0,0.4),
        0 0 10px rgba(80,255,140,0.12);
    z-index: 30;
    opacity: 0;
    transition:
        opacity 0.4s ease,
        transform 0.25s ease;
    pointer-events: none;
    animation: npcBubbleFloat 4s ease-in-out infinite;
}

#shopkeeper-hint.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0px);
}

#shopkeeper-warning {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 180px;
    padding: 10px 14px;
    background: rgba(28,28,28,0.96);
    border: 2px solid #d1766a;
    border-left: 5px solid #f1b08d;
    border-radius: 10px;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #fff1e8;
    text-align: center;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.45);
    box-shadow:
        0 0 12px rgba(0,0,0,0.4),
        0 0 10px rgba(209,138,106,0.15);
    z-index: 2000;
    opacity: 0;
    transition:
        opacity 0.4s ease,
        transform 0.25s ease;
    pointer-events: none;
    animation: npcBubbleFloat 4s ease-in-out infinite;
}

#shopkeeper-warning.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0px);
}

#shop-background {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

#shop-background {
    filter:
        saturate(0.8)
        brightness(1.4)
        sepia(0.08);
}

#shelf-left {
    position: absolute;
    left: 10px;
    bottom: 65px;
    height: 180px;
    image-rendering: pixelated;
    z-index: 2;
}

#shelf-right {
    position: absolute;
    right: 10px;
    bottom: 60px;
    height: 180px;
    image-rendering: pixelated;
    z-index: 2;
}

#shelf-left,
#shelf-right {
    filter:
        drop-shadow(0px 18px 14px rgba(0,0,0,0.30))
        drop-shadow(0px 20px 20px rgba(0,0,0,0.25));
}

#lamp {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 85px;
    image-rendering: pixelated;
    z-index: 6;
    filter:
        brightness(1.15)
        drop-shadow(0px 0px 12px rgba(255,220,120,0.55))
        drop-shadow(0px 0px 30px rgba(255,180,70,0.35));
    
    animation: lampSwing 4s ease-in-out infinite;
    transform-origin: top center;
}

@keyframes lampSwing {
    0% {
        transform: translateX(-50%) rotate(-1deg);
    }
    50% {
        transform: translateX(-50%) rotate(1deg);
    }
    100% {
        transform: translateX(-50%) rotate(-1deg);
    }
}


.lamp-glow {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    height: 260px;
    border-radius: 50%;
    background:
        radial-gradient(
            ellipse at center,
            rgba(255,210,120,0.42) 0%,
            rgba(255,190,90,0.22) 35%,
            rgba(255,160,60,0.10) 55%,
            rgba(0,0,0,0) 75%
        );
    filter: blur(30px);
    z-index: 3;
    pointer-events: none;
    animation: glowPulse 2.2s ease-in-out infinite;
    mix-blend-mode: screen;
}

@keyframes glowPulse {
    0% {
        opacity: 0.75;
        filter: blur(28px);
    }

    50% {
        opacity: 1;
        filter: blur(38px);
    }

    100% {
        opacity: 0.75;
        filter: blur(28px);
    }
}

#shop-counter {
    position: absolute;
    width: 430px;
    height: 200px;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    image-rendering: pixelated;
    z-index: 15;
    filter:
        sepia(0.18)
        saturate(0.85)
        brightness(0.92)
        contrast(0.92)
        hue-rotate(-8deg)
        drop-shadow(0px 18px 14px rgba(0,0,0,0.30))
        drop-shadow(1px 20px 7px rgba(0,0,0,0.25));
    
}

.counter-warm-overlay {
    position: absolute;
    width: 430px;
    height: 100px;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,140,40,0.08);
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 21;
}

.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#editor-zone {
    position: absolute;
    width: 720px;
}

.CodeMirror {
    height: 220px;
    overflow: hidden;
    border: 2px solid #8b5a2b;
    border-radius: 10px;
    font-family: Consolas, "Courier New", monospace;
    font-size: calc(18px * var(--game-scale));
    line-height: 1.35;
    letter-spacing: 0;
    border-right: 5px solid #d89b3c;
    box-shadow:inset 0 0 12px rgba(0,0,0,0.45), 0 0 10px rgba(0,0,0,0.25);
}

.CodeMirror pre,
.CodeMirror textarea,
.CodeMirror-code,
.CodeMirror-line,
.CodeMirror-lines,
.CodeMirror-cursor,
.CodeMirror-linenumber {
    font-family: Consolas, "Courier New", monospace;
    font-size: calc(18px * var(--game-scale));
    line-height: 1.35;
    letter-spacing: 0;
    font-variant-ligatures: none;
    text-rendering: geometricPrecision;
}

.CodeMirror pre {
    padding: 0 8px;
}

#money-display {
    position: absolute;
    top: 12px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 50;
    min-width: 92px;
    font-size: 38px;
    font-weight: bold;
    color: rgb(253, 195, 68);
    font-family: 'Ithaca', sans-serif;
    text-shadow:
        2px 2px 0px #000,
        0 0 6px rgba(255,190,60,0.35),
        0 0 12px rgba(255,170,40,0.15);
    filter:
        drop-shadow(0 0 4px rgba(255,190,60,0.18));
}

#money-display img {
    width: 34px;
    height: 34px;
    image-rendering: pixelated;
    transform:
        translateY(-1px);
    filter:
        drop-shadow(0 0 3px rgba(255,210,90,0.35));
}

.money-amount {
    display: inline-block;
    min-width: 58px;
    text-align: left;
    letter-spacing: 2px;
}

.money-gain-popup {
    position: absolute;
    top: 30px;
    right: 0;
    color: #83ffb5;
    font-family: 'Ithaca', sans-serif;
    font-size: 24px;
    letter-spacing: 1px;
    text-shadow:
        2px 2px 0 #000,
        0 0 8px rgba(80,255,140,0.35);
    pointer-events: none;
    animation: moneyGainFloat 0.9s ease-out forwards;
}

@keyframes moneyGainFloat {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.8);
    }

    20% {
        opacity: 1;
        transform: translateY(0) scale(1.08);
    }

    100% {
        opacity: 0;
        transform: translateY(-28px) scale(1);
    }
}

#shop-items {
    position: absolute;
    inset: 0;
    z-index: 16;
}

.shop-item {
    position: relative;
    display: block;
    width: 38px;
    image-rendering: pixelated;
    filter: drop-shadow(0px 3px 2px rgba(0,0,0,0.35));
}

.item-stack {
    position: absolute;
    display: inline-block;
}

.item-count {
    position: absolute;
    right: -4px;
    bottom: -4px;
    min-width: 14px;
    height: 14px;
    padding: 1px 3px;
    background: rgba(0,0,0,0.88);
    border: 1px solid #d8a13d;
    border-radius: 3px;
    color: white;
    font-size: 10px;
    font-family: 'superhelio _regular', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 1px 2px rgba(0,0,0,0.5);
    z-index: 20;
}

.item-stack img {
    display: block;
}


#mission-panel {
    padding: 40px;
    padding-top: 34px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background-image: url("./assets/ui/questpaper.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    image-rendering: pixelated;
    width: 100%;
    box-sizing: border-box;
    margin-top: calc(var(--top-decoration-space) * -1);
}

.quest-panel-header {
    padding: 12px 18px;
    margin-bottom: 10px;
    background: linear-gradient(
            180deg,
            #6f534d 0%,
            #5d4541 100%
        );
    border: 3px solid #4d3735;
    border-radius: 5px;
    box-shadow:
        inset 0 0 0 2px #8a6a63,
        inset 0 2px 0 rgba(255,255,255,0.08);
    font-family:
        'Ithaca',
        sans-serif;
    font-size: 28px;
    color: #f0d7b5;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.28);
}

.quest-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: rgba(255,255,255,0.04);
    border: 2px solid rgba(140,90,40,0.18);
    box-shadow: inset 0 0 12px rgba(255,255,255,0.05);
    position: relative;
    border-radius: 5px;
}

.quest-title {
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(120,70,30,0.22);
    font-family: 'superhelio _regular', sans-serif;
    font-size: 19px;
    font-weight: bold;
    color: #5f3b15;
    letter-spacing: 1px;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.10);
}

.quest-description {
    min-height: 80px;
    padding: 15px;
    background: rgba(190, 161, 122, 0.822);
    border: none;
    border-radius: 5px;
    box-sizing: border-box;
    color: #5b3d22;
    font-size: 16px;
    line-height: 1.6;
    font-family: 'superhelio _regular', sans-serif;
}

.quest-description-expanded {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.quest-story,
.quest-task {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quest-section-label {
    font-size: 13px;
    font-weight: bold;
    color: #5b3d22;
}

#mission-complete-stamp {
    position: absolute;
    left: 50%;
    top: 50%;
    padding: 12px 20px;
    border: 5px solid rgba(130, 34, 28, 0.86);
    border-radius: 6px;
    color: rgba(130, 34, 28, 0.88);
    font-family: 'Ithaca', sans-serif;
    font-size: 42px;
    line-height: 1;
    letter-spacing: 3px;
    text-shadow: 1px 1px 0 rgba(255, 230, 190, 0.16);
    text-transform: uppercase;
    transform: translate(-50%, -50%) rotate(-12deg) scale(1.8);
    opacity: 0;
    pointer-events: none;
    z-index: 20;
    mix-blend-mode: multiply;
}

#mission-complete-stamp.visible {
    animation: stampIn 1.05s ease-out forwards;
}

@keyframes stampIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(-12deg) scale(2.1);
        filter: blur(1px);
    }

    22% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(-12deg) scale(0.88);
        filter: blur(0);
    }

    34% {
        transform: translate(-50%, -50%) rotate(-12deg) scale(1.08);
    }

    48% {
        transform: translate(-50%, -50%) rotate(-12deg) scale(1);
    }

    82% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(-12deg) scale(1);
    }
}

textarea {
  width: 100%;
  height: 200px;
  background: #2d2d2d;
  color: #00ff88;
  border: 1px solid #555;
  padding: 10px;
  font-family: monospace;
  font-size: 16px;
}

button {
    width: 200px;
    padding: 10px 14px;
    background: linear-gradient(180deg, #14c878 0%, #0ca864 100%);
    border: 2px solid #1fdd8b;
    border-bottom: 4px solid #067847;
    border-radius: 8px;
    color: white;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 0 #045c36, 0 0 12px rgba(20,200,120,0.18);
    transition: transform 0.08s ease, filter 0.12s ease;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}

button:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 0 #045c36, 0 0 18px rgba(40,255,160,0.35);
}

button:active {
    transform: translateY(3px);
    box-shadow:0 1px 0 #045c36, 0 0 8px rgba(20,200,120,0.18);
}

#error-box {
  margin-top: 20px;
  color: red;
}

table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 14px;
    color: #f0f0f0;
}

th {
    background:rgba(216,155,60,0.16);
    color: #f3c46b;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 15px;
    padding: 10px 14px;
    border-bottom: 2px solid rgba(216,155,60,0.45);
    position: sticky;
    top: 0;
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: #d7d7d7;
}

tr:hover td {
    background:rgba(255,255,255,0.04);
}

#result-panel {
    height: 430px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(
            180deg,
            rgba(42,42,42,0.98) 0%,
            rgba(28,28,28,0.98) 100%
        );
    border: 2px solid #8b5a2b;
    border-right: 6px solid #d89b3c;
    border-radius: 10px;
    box-shadow:
        inset 0 0 12px rgba(0,0,0,0.45),
        0 0 10px rgba(0,0,0,0.25);
    overflow: hidden;
    box-sizing: border-box;
}

#result-panel h3 {
    margin: 0 0 14px 0;
    padding-left: 4px;
    font-size: 34px;
    line-height: 1.2;
    letter-spacing: 2px;
    color: #f0d7b5;
    font-family: 'Ithaca', sans-serif;
    text-shadow:
        2px 2px 0px rgba(0,0,0,0.5);
}

#result {
    flex: 1;
    overflow: auto;
    padding-left: 4px;
    padding-right: 4px;
}

#result:empty::before {
    content: "Awaiting SQL query...";
    display: block;
    color: rgba(255,255,255,0.25);
    font-family: 'superhelio _regular', sans-serif;
    font-size: 15px;
    line-height: 1.4;
    font-weight: bold;
    letter-spacing: 1px;
}

#result h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: bold;
    color: rgba(243,196,107,0.75);
    font-family: 'superhelio _regular', sans-serif;
    letter-spacing: 1px;
}

/* =======================================================
    HELP PANEL
======================================================= */

#help-panel {
    position: absolute;
    top: 464px;
    left: calc(50% + 395px);
    width: 420px;
    z-index: 35;
}

#help-panel.hidden {
    display: none;
}

#help-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.help-tab {
    width: 42px;
    height: 42px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 3px solid transparent;
    background: transparent;
    box-shadow: none;
    cursor: default;
    outline: none;
}

.help-tab:focus,
.help-tab:focus-visible {
    outline: none;
    box-shadow: none;
}

.help-tab img {
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
    filter: grayscale(1) brightness(0.75);
    opacity: 0.68;
    transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

.help-tab:hover,
.help-tab:active {
    transform: none;
    filter: none;
    box-shadow: none;
}

.help-tab.unlocked {
    cursor: pointer;
    border-color: #ead8b6;
    background: rgba(47, 36, 27, 0.92);
}

.help-tab.unlocked img {
    filter: none;
    opacity: 1;
}

.help-tab:hover img {
    transform: scale(1.18);
}

.help-tab.active {
    box-shadow:
        0 0 0 2px #0d0908,
        0 0 12px rgba(255, 220, 130, 0.28);
}

#help-card {
    min-height: 126px;
    padding: 12px;
    border: 4px solid #a8733d;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

#help-card.hidden {
    display: none;
}

#help-card.help-card-hint {
    background: #a8733d;
    border-color: #c28a4d;
    color: #5f879d;
    box-shadow:
        inset 0 0 0 3px #6d4124,
        0 5px 0 rgba(38, 23, 14, 0.78);
}

#help-card.help-card-hint #help-card-title,
#help-card.help-card-hint #help-card-content {
    background: #efe6c9;
    border: 2px solid #efe6c9;
    border-radius: 0;
}

#help-card.help-card-hint #help-card-title {
    margin-bottom: 0;
    padding: 10px 14px 7px 14px;
    border-bottom: none;
    color: #253060;
}

#help-card.help-card-hint #help-card-content {
    padding: 10px 14px 14px 14px;
    border-top: none;
}

#help-card.help-card-hint #help-card-title::after {
    content: "";
    display: block;
    margin-top: 7px;
    border-bottom: 2px solid #253060;
}

#help-card.help-card-blueprint {
    background:
        linear-gradient(0deg, rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
        #14375e;
    background-size: 18px 18px;
    border-color: #56b8f0;
    color: #eef8ff;
    box-shadow:
        inset 0 0 0 3px rgba(255,255,255,0.08),
        0 6px 0 rgba(5,20,38,0.82);
}

#help-card.help-card-blueprint #help-card-content {
    user-select: none;
}

#help-card-title {
    margin-bottom: 9px;
    padding-bottom: 7px;
    border-bottom: 2px solid currentColor;
    font-weight: bold;
    letter-spacing: 1px;
}

#help-card-content code {
    color: inherit;
    font-family: 'superhelio _regular', sans-serif;
}

/* =======================================================
    KEY SHOP ITEMS
======================================================= */

.shop-key-item .shop-item {
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.shop-key-item:hover .shop-item {
    transform: scale(1.2);
    filter: drop-shadow(0 0 12px rgba(255,220,120,0.9));
}

.shop-item-wrapper {
    transform-origin: bottom center;
}

.shop-radio-decoration {
    pointer-events: none;
    z-index: 24;
}

.shop-radio-decoration .shop-item {
    transform-origin: 50% 82%;
}

.shop-radio-playing .shop-item {
    animation: radioJazzGroove 2.4s ease-in-out infinite;
    filter:
        drop-shadow(0px 3px 2px rgba(0,0,0,0.35))
        drop-shadow(0 0 7px rgba(255,220,120,0.26));
}

@keyframes radioJazzGroove {
    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    24% {
        transform: translateY(-1px) rotate(-1.2deg) scale(1.045);
    }

    52% {
        transform: translateY(0) rotate(0.8deg) scale(1.015);
    }

    76% {
        transform: translateY(-1px) rotate(1.2deg) scale(1.04);
    }
}

#shop-tooltip {
    position: absolute;
    display: none;
    padding: 10px 14px;
    background: linear-gradient(
            180deg,
            #6f534d 0%,
            #5d4541 100%);
    border: 3px solid #4d3735;
    border-radius: 6px;
    box-shadow: inset 0 0 0 2px #8a6a63, 0 0 12px rgba(0,0,0,0.35);
    font-family: 'superhelio _regular', sans-serif;
    font-size: 12px;
    line-height: 1.6;
    color: #f0d7b5;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.35);
    z-index: 999;
    pointer-events: none;
    white-space: nowrap;
}

/* =======================================================
    ITEM AQUIRED POPUP
======================================================= */

#item-popup-overlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.45);
    z-index: 9999;
}

#item-popup {
    position: relative;
    width: 240px;
    image-rendering: pixelated;
    animation:
        popupAppear 0.22s ease-out;
}

#item-popup-bg {
    width: 100%;
    display: block;
    image-rendering: pixelated;
}

#item-popup-title {
    position: absolute;
    top: 45px;
    width: 100%;
    text-align: center;
    font-family: 'Ithaca', sans-serif;
    font-size: 24px;
    letter-spacing: 1px;
    color: #5a3920;
}

#item-popup-icon {
    position: absolute;
    top: 90px;
    left: 50%;
    width: 54px;
    transform: translateX(-50%);
    image-rendering: pixelated;
}

#item-popup-description {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 75px;
    text-align: center;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #4b3824;
}

@keyframes popupAppear {
    0% {
        transform:
            scale(0.7);
        opacity: 0;
    }

    100% {
        transform:
            scale(1);
        opacity: 1;
    }
}

/* =======================================================
    SUPPORT POPUP
======================================================= */

#support-popup-overlay {
    position: fixed;
    inset: 0;
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.55);
    box-sizing: border-box;
    overflow: auto;
    z-index: 9999;
}

#support-popup-overlay.hidden {
    display: none;
}

#support-popup {
    position: relative;
    width: min(460px, calc(100vw - 32px), calc((100vh - 32px) * 0.78));
    aspect-ratio: 460 / 590;
    image-rendering: pixelated;
    animation: popupAppear 0.22s ease-out;
}

#support-popup-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: fill;
    image-rendering: pixelated;
    filter: drop-shadow(0 10px 14px rgba(0,0,0,0.45));
}

#support-popup-close {
    position: absolute;
    top: 7.5%;
    right: 10.4%;
    width: clamp(22px, 6.1vw, 28px);
    height: clamp(22px, 6.1vw, 28px);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 2px solid #5a3920;
    background: rgba(90,57,32,0.18);
    box-shadow: none;
    color: #5a3920;
    font-family: Arial, sans-serif;
    font-size: clamp(14px, 3.9vw, 18px);
    line-height: 0;
    text-shadow: none;
    z-index: 2;
}

#support-popup-close:hover,
#support-popup-close:active {
    transform: none;
    box-shadow: none;
}

#support-popup-title {
    position: absolute;
    top: 12.2%;
    left: 9.1%;
    right: 9.1%;
    text-align: center;
    font-family: 'Ithaca', sans-serif;
    font-size: clamp(25px, 7vw, 34px);
    line-height: 1;
    letter-spacing: 1px;
    color: #5a3920;
}

#support-popup-description {
    position: absolute;
    top: 24.7%;
    left: 12.6%;
    right: 12.6%;
    bottom: 44.7%;
    overflow: auto;
    text-align: center;
    font-family: 'superhelio _regular', sans-serif;
    font-size: clamp(11px, 3vw, 14px);
    line-height: 1.42;
    color: #4b3824;
}

#support-popup-heart {
    position: absolute;
    left: 50%;
    bottom: 37.9%;
    width: clamp(24px, 7.4vw, 34px);
    height: clamp(24px, 7.4vw, 34px);
    transform: translateX(-50%);
    object-fit: contain;
    image-rendering: pixelated;
}

#support-link-list {
    position: absolute;
    left: 50%;
    bottom: 19.7%;
    width: min(232px, 56%);
    display: flex;
    flex-direction: column;
    gap: clamp(7px, 1.7vw, 10px);
    transform: translateX(-50%);
}

.support-popup-link,
#support-coffee-link,
#support-paypal-link {
    width: 100%;
    min-height: clamp(41px, 9.1vw, 50px);
    padding: clamp(8px, 2vw, 10px) 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background:
        linear-gradient(180deg, #14c878 0%, #0ca864 100%);
    border: 2px solid #1fdd8b;
    border-bottom: 4px solid #067847;
    border-radius: 7px;
    box-sizing: border-box;
    color: white;
    font-family: 'superhelio _regular', sans-serif;
    font-size: clamp(12px, 3.25vw, 15px);
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
    box-shadow: 0 3px 0 #045c36, 0 0 10px rgba(20,200,120,0.18);
}

.support-popup-link:hover,
#support-coffee-link:hover,
#support-paypal-link:hover {
    filter: brightness(1.08);
}

#support-coffee-link,
#support-coffee-link:visited {
    background:
        linear-gradient(180deg, #ffd76a 0%, #e09a32 58%, #9a5624 100%);
    border-color: #ffeaa6;
    border-bottom-color: #6f3518;
    color: #fff6d5;
    box-shadow: 0 3px 0 #4d220f, 0 0 10px rgba(255,205,80,0.22);
}

#support-popup-note {
    position: absolute;
    left: 11.3%;
    right: 11.3%;
    bottom: 9.8%;
    text-align: center;
    font-family: 'superhelio _regular', sans-serif;
    font-size: clamp(8px, 2.2vw, 10px);
    line-height: 1.35;
    color: rgba(75,56,36,0.72);
}

/* =======================================================
    LEVEL TRANSITION SCROLL
======================================================= */

#level-transition-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.62);
    z-index: 10050;
}

#level-transition-overlay.hidden {
    display: none;
}

#level-scroll {
    position: relative;
    width: min(560px, 94vw);
    image-rendering: pixelated;
    animation: popupAppear 0.22s ease-out;
}

#level-scroll-image {
    width: 100%;
    display: block;
    image-rendering: pixelated;
    filter: drop-shadow(0 16px 18px rgba(0,0,0,0.52));
}

#level-scroll-content {
    position: absolute;
    top: 17%;
    left: 18%;
    right: 18%;
    bottom: 14%;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #5a3920;
    text-align: center;
    pointer-events: auto;
}

#level-scroll-content.hidden {
    display: none;
}

#level-scroll-label {
    margin-bottom: 8px;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 13px;
    line-height: 1.2;
    letter-spacing: 1px;
    color: rgba(90,57,32,0.68);
    text-transform: uppercase;
}

#level-scroll-title {
    margin-bottom: 14px;
    padding-bottom: 10px;
    width: 100%;
    border-bottom: 4px solid rgba(90,57,32,0.22);
    font-family: 'Ithaca', sans-serif;
    font-size: 34px;
    line-height: 1;
    letter-spacing: 1px;
    color: #5a3920;
}

#level-scroll-description {
    margin-bottom: 13px;
    max-width: 340px;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #4b3824;
}

#level-scroll-list {
    width: 100%;
    min-height: 100px;
    margin-bottom: auto;
    padding: 8px 18px;
    box-sizing: border-box;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 13px;
    line-height: 1.45;
    color: #4b3824;
    text-align: left;
}

#level-scroll-list ul {
    margin: 0;
    padding-left: 20px;
}

.level-scroll-list-intro {
    margin-bottom: 7px;
    font-weight: bold;
    text-align: center;
}

#level-scroll-list li {
    margin-bottom: 5px;
}

#level-scroll-button {
    width: 190px;
    margin-bottom: 10px;
    padding: 9px 12px;
    font-size: 15px;
}

/* =======================================================
    SQL NOTEBOOK UI
======================================================= */

.bottom-layout {
    position: relative;
}

#sql-notebook-ui {
    position: absolute;
    left: -500px;
    display: none;
    z-index: 50;
}

#sql-notebook-image {
    width: 450px;
    image-rendering: pixelated;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.35));
}

#notebook-expand-btn {
    position: absolute;
    top: 10px;
    left: 177px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 2px solid #6f5a38;
    border-top-color: #a89562;
    border-left-color: #a89562;
    border-bottom: 3px solid #3f321f;
    border-radius: 2px;
    background: rgba(216, 199, 139, 0.48);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.12),
        0 1px 0 rgba(0,0,0,0.24);
    z-index: 3;
    image-rendering: pixelated;
}

#notebook-expand-btn:hover {
    filter: brightness(1.08);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.16),
        0 1px 0 rgba(0,0,0,0.24);
}

#notebook-expand-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

#notebook-expand-icon {
    width: 100%;
    display: block;
    image-rendering: pixelated;
}

#notebook-expand-btn:hover #notebook-expand-icon {
    content: url("./assets/ui/expand_hovered.png");
}

#notebook-content {
    position: absolute;
    top: 20px;
    left: 40px;
    width: 340px;
    height: 220px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 12px;
    color: #4b3824;
}

/* =======================================================
    NOTEBOOK TABS
======================================================= */

#notebook-tabs {
    position: absolute;
    top: 6px;
    right: -13px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.notebook-tab {
    width: 35px;
    image-rendering: pixelated;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
}

.notebook-tab:hover {
    transform: translateX(2px);
    filter: brightness(1.08);
}

#large-notebook-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.48);
    z-index: 10020;
}

#large-notebook-overlay.hidden {
    display: none;
}

#large-notebook {
    position: relative;
    width: min(900px, 88vw);
    image-rendering: pixelated;
    animation: popupAppear 0.22s ease-out;
}

#large-notebook-image {
    width: 100%;
    display: block;
    image-rendering: pixelated;
    filter: drop-shadow(0 18px 20px rgba(0,0,0,0.48));
}

#large-notebook-content {
    position: absolute;
    top: 12%;
    left: 8%;
    right: 8%;
    bottom: 10%;
    color: #4b3824;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    z-index: 2;
    pointer-events: auto;
}

.large-notebook-placeholder {
    max-width: 300px;
}

.large-notebook-left-page {
    position: absolute;
    top: -6px;
    left: 10px;
    width: 39%;
    bottom: 6px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.large-notebook-right-page {
    position: absolute;
    top: -16px;
    right: 0;
    width: 43%;
    bottom: 22px;
    overflow: hidden;
    padding: 10px 18px 10px 14px;
    box-sizing: border-box;
}

.large-notebook-page-number {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 43%;
    color: #5d4830;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 12px;
    line-height: 1;
    text-align: center;
    pointer-events: none;
}

.large-notebook-category-title,
.large-notebook-detail-title {
    margin-bottom: 10px;
    font-family: 'Ithaca', sans-serif;
    font-size: 34px;
    line-height: 0.95;
    letter-spacing: 1px;
    color: #4b3824;
}

.large-notebook-category-description {
    margin-bottom: 22px;
    padding-right: 10px;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #5d4830;
}

.large-notebook-entry-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 4px;
    row-gap: 6px;
    min-height: 0;
}

.large-notebook-entry {
    width: 100%;
    min-height: 31px;
    padding: 5px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    border: 2px solid rgba(91, 61, 34, 0.24);
    border-radius: 3px;
    background: rgba(190, 161, 122, 0.822);
    box-shadow: none;
    color: #5b3d22;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 12px;
    line-height: 1.1;
    text-align: left;
    text-shadow: none;
}

.large-notebook-entry .notebook-list-status {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
}

.large-notebook-entry:hover {
    filter: brightness(1.05);
    box-shadow: none;
}

.large-notebook-entry:active {
    transform: translateY(1px);
    box-shadow: none;
}

.large-notebook-entry.active {
    border-color: rgba(90, 57, 32, 0.56);
    background: rgba(215, 181, 122, 0.92);
}

.large-notebook-entry.locked {
    opacity: 0.46;
}

.large-notebook-entry-label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.large-notebook-next-page {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 46px;
    height: 40px;
    padding: 0;
    border: 0;
    background-color: transparent;
    background-image: url("./assets/ui/nextPageArrow.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 40px auto;
    box-shadow: none;
    cursor: pointer;
    image-rendering: pixelated;
}

.large-notebook-next-page:hover,
.large-notebook-next-page:focus-visible,
.large-notebook-next-page:active {
    background-image: url("./assets/ui/nextPageArrow_hovered.png");
    background-color: transparent;
    border: 0;
    box-shadow: none;
    filter: none;
    transform: none;
}

.large-notebook-next-page:focus-visible {
    outline: 1px dashed rgba(75, 56, 36, 0.72);
    outline-offset: 1px;
}

.large-notebook-detail-section,
.large-notebook-locked-note,
.large-notebook-empty,
.large-notebook-schema-missing,
.large-notebook-shopkeeper-note {
    margin-bottom: 12px;
    color: #5d4830;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

.large-notebook-locked-note {
    padding: 12px;
    background: rgba(190, 161, 122, 0.42);
    border: 2px dashed rgba(91, 61, 34, 0.28);
    border-radius: 4px;
}

.large-notebook-section-title {
    margin: 12px 0 5px;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #5b3d22;
}

.large-notebook-code {
    margin: 0 0 10px;
    padding: 9px 10px;
    overflow: hidden;
    background: rgba(58, 39, 25, 0.86);
    border: 2px solid rgba(90, 57, 32, 0.34);
    border-radius: 4px;
    color: #f3dfb6;
    font-family: Consolas, monospace;
    font-size: 12px;
    line-height: 1.35;
    white-space: pre-wrap;
}

.large-notebook-shopkeeper-note {
    padding: 10px;
    background: rgba(133, 194, 107, 0.18);
    border-left: 4px solid #85c26b;
    border-radius: 3px;
}

.large-notebook-schema-table,
.large-notebook-preview-table {
    width: 100%;
    min-width: 0;
    margin-bottom: 12px;
    table-layout: fixed;
    color: #4b3824;
    font-size: 11px;
}

.large-notebook-schema-table th,
.large-notebook-preview-table th {
    padding: 5px 6px;
    background: rgba(91, 61, 34, 0.18);
    color: #5b3d22;
    font-size: 11px;
}

.large-notebook-schema-table td,
.large-notebook-preview-table td {
    padding: 5px 6px;
    border-bottom: 1px solid rgba(91, 61, 34, 0.18);
    color: #4b3824;
    overflow-wrap: anywhere;
}

.large-notebook-schema-missing code {
    display: inline-block;
    margin-top: 5px;
    padding: 5px 7px;
    background: rgba(58, 39, 25, 0.86);
    border-radius: 3px;
    color: #f3dfb6;
    font-family: Consolas, monospace;
    font-size: 12px;
}

#large-notebook-tabs {
    position: absolute;
    top: 13px;
    right: -26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.large-notebook-tab {
    width: 70px;
    image-rendering: pixelated;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
}

.large-notebook-tab:hover {
    transform: translateX(3px);
    filter: brightness(1.08);
}

#large-notebook-close {
    position: absolute;
    top: 17px;
    right: 57px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 2px solid #6f5a38;
    border-top-color: #a89562;
    border-left-color: #a89562;
    border-bottom: 3px solid #3f321f;
    border-radius: 2px;
    background: rgba(216, 199, 139, 0.48);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.12),
        0 1px 0 rgba(0,0,0,0.24);
    z-index: 3;
    image-rendering: pixelated;
}

#large-notebook-close:hover {
    filter: brightness(1.08);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.16),
        0 1px 0 rgba(0,0,0,0.24);
}

#large-notebook-close:active {
    transform: translateY(1px);
    box-shadow: none;
}

#large-notebook-close-icon {
    width: 100%;
    display: block;
    image-rendering: pixelated;
}

#large-notebook-close:hover #large-notebook-close-icon {
    content: url("./assets/ui/close_hovered.png");
}

.notebook-left-page {
    position: absolute;
    left: 5px;
    width: 150px;
}

.notebook-right-page {
    position: absolute;
    top: 10px;
    left: 217px;
    width: 155px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.notebook-category-title {
    margin-bottom: 10px;
    font-family: 'Ithaca', sans-serif;
    font-size: 28px;
    letter-spacing: 1px;
    color: #4b3824;
}

.notebook-category-description {
    font-family: 'superhelio _regular', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #5d4830;
}

.notebook-list-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    background: rgba(190, 161, 122, 0.822);
    border-radius: 3px;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 13px;
    color: #5b3d22;
    box-sizing: border-box;
}

.notebook-table-entry-clickable {
    cursor: pointer;
}

.notebook-table-entry-clickable:hover {
    filter: brightness(1.05);
}

.notebook-list-status {
    width: 10px;
    height: 10px;
    border: 2px solid #dbc9a3;
    background: #dbc9a3;
    image-rendering: pixelated;
}

.notebook-list-status.unlocked {
    background: #85c26b;
    box-shadow: inset -1px -1px 0 rgba(0,0,0,0.18);
    animation: unlockPulse 0.4s;
}

@keyframes unlockPulse {
    0% {
        transform: scale(0.7);
        opacity: 0.5;
    }

    60% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* =======================================================
    Tutorial
======================================================= */

#tutorial-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 9999;
}

#tutorial-overlay.waiting-for-mission {
    pointer-events: none;
}

#tutorial-highlight {
    position: absolute;
    border-radius: 8px;
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.89);
    pointer-events: none;
    transition: all 0.35s ease;
}

#tutorial-text-box {
    position: absolute;
    bottom: 380px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    height: auto;
    min-height: 0;
    padding: 14px 18px;
    background: #2e241b;
    border: 4px solid #ead8b6;
    outline: 2px solid rgba(0, 0, 0, 0.72);
    border-radius: 8px;
    color: #f3dfb6;
    font-family: 'superhelio _regular', sans-serif;
    word-wrap: break-word;
    box-sizing: border-box;
    z-index: 10000;
}

#tutorial-button-box {
    position: absolute;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none;
    z-index: 10000;
    animation: tutorialNextPulse 2.4s ease-in-out infinite;
}

#tutorial-button-box:hover {
    animation-play-state: paused;
}

#tutorial-next-btn {
    width: auto;
    min-width: 62px;
    padding: 5px 7px;
    border-radius: 5px;
    border: 2px solid #ead8b6;
    border-bottom: 4px solid #bfa27a;
    outline: 2px solid rgba(0, 0, 0, 0.72);
    background:
        linear-gradient(
            180deg,
            #14c878 0%,
            #0ca864 100%
        );
    color: white;
    font-size: 12px;
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,0.05),
        0 2px 0 rgba(0,0,0,0.5);
}

#tutorial-next-btn:hover {
    filter: brightness(1.12);
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,0.08),
        0 2px 0 rgba(0,0,0,0.5),
        0 0 10px rgba(234,216,182,0.18);
}

#tutorial-next-btn:active {
    transform: translateY(4px) scale(0.96);
    filter: brightness(0.9);
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.32),
        inset 0 0 0 2px rgba(255,255,255,0.04),
        0 0 6px rgba(234,216,182,0.10);
}

@keyframes tutorialNextPulse {
    0%,
    58%,
    100% {
        transform: translateY(0);
        filter: brightness(1);
    }

    64% {
        transform: translateY(-2px);
        filter: brightness(1.14);
    }

    70% {
        transform: translateY(0);
        filter: brightness(1.04);
    }

    76% {
        transform: translateY(-2px);
        filter: brightness(1.14);
    }

    82% {
        transform: translateY(0);
        filter: brightness(1.04);
    }
}

#tutorial-text {
    width: 100%;
    text-align: left;
    line-height: 1.35;
}

#tutorial-warning-box {
    position: absolute;
    bottom: 380px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 420px;
    max-width: 520px;
    padding: 32px 22px;
    background: rgba(40, 28, 28, 0.97);
    border: 2px solid #c76b65;
    border-left: 6px solid #f0a390;
    border-radius: 10px;
    box-shadow:
        0 0 14px rgba(0,0,0,0.45),
        0 0 10px rgba(240,176,144,0.08);
    opacity: 0;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
    pointer-events: none;
    z-index: 10001;
}

#tutorial-warning-box.visible {
    opacity: 1;
}

#tutorial-warning-text {
    font-family: 'superhelio _regular', sans-serif;
    color: #fff2ea;
    font-size: 18px;
    line-height: 1.5;
    text-align: center;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.35);
}

/* =======================================================
    Soft Tutorial Mode
======================================================= */

#tutorial-overlay.soft-tutorial {
    background: transparent;
}

#tutorial-overlay.soft-tutorial #tutorial-highlight {
    box-shadow: none;
    border-radius: 0;
}

.tutorial-soft-glow-target {
    filter:
        drop-shadow(0 0 10px rgba(255, 238, 155, 0.95))
        drop-shadow(0 0 22px rgba(255, 211, 88, 0.74))
        drop-shadow(0 0 42px rgba(255, 160, 50, 0.40));
    animation: softTargetGlow 2s ease-in-out infinite;
}

@keyframes softTargetGlow {
    0%,
    100% {
        filter:
            drop-shadow(0 0 10px rgba(255, 238, 155, 0.95))
            drop-shadow(0 0 22px rgba(255, 211, 88, 0.74))
            drop-shadow(0 0 42px rgba(255, 160, 50, 0.40));
    }

    50% {
        filter:
            drop-shadow(0 0 14px rgba(255, 246, 188, 1))
            drop-shadow(0 0 32px rgba(255, 221, 98, 0.88))
            drop-shadow(0 0 58px rgba(255, 168, 54, 0.52));
    }
}

@keyframes notebookGlow {

    0% {
        box-shadow:
            0 0 12px rgba(255, 238, 155, 0.95),
            0 0 28px rgba(255, 211, 88, 0.72),
            0 0 54px rgba(255, 160, 50, 0.36);
    }
    50% {
        box-shadow:
            0 0 18px rgba(255, 245, 188, 1),
            0 0 42px rgba(255, 220, 98, 0.88),
            0 0 76px rgba(255, 168, 54, 0.48);
    }
    100% {
        box-shadow:
            0 0 12px rgba(255, 238, 155, 0.95),
            0 0 28px rgba(255, 211, 88, 0.72),
            0 0 54px rgba(255, 160, 50, 0.36);
    }
}

/* =======================================================
    Tutorial Texte
======================================================= */

.sql-keyword {
    color: #f2c572;
}

.sql-table {
    color: #5fd7d3;
}

.sql-value {
    color: #85c26b;
}

.sql-symbol {
    color: #d89bff;
}

.sql-string {
    color: #ff9e7a;
}

.help-hint-keyword {
    color: #f2c572;
}

.help-blueprint-keyword {
    color: #74cfff;
}

/* =======================================================
    Editor Settings Buttons
======================================================= */

.editor-actions {
    display: flex;
    align-items: center;
    gap: 28px;
}

.editor-tools {
    display: flex;
    align-items: center;
    gap: 28px;
}

.hidden {
    display: none;
}

.editor-tool-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 4px;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 20px;
    line-height: 1;
    color: #f0d7b5;
    background:
        linear-gradient(
            180deg,
            #6f534d 0%,
            #4d3735 100%
        );
    border: 3px solid #2a1b18;
    border-top-color: #8a6a63;
    border-left-color: #8a6a63;
    border-bottom: 6px solid #1b100e;
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,0.06),
        0 3px 0 rgba(0,0,0,0.55),
        0 0 10px rgba(216,155,60,0.12);
    image-rendering: pixelated;
}

.editor-tool-btn:hover {
    filter: brightness(1.12);
    box-shadow:
        0 4px 0 #120d0a,
        0 0 14px rgba(216,155,60,0.28);
}

.sound-control-btn {
    position: relative;
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 50%;
    border: 4px solid #2b1910;
    border-top-color: #7f5532;
    border-left-color: #7f5532;
    border-bottom-color: #120a07;
    background:
        radial-gradient(circle at 34% 28%, #fff2b9 0 12%, transparent 13%),
        radial-gradient(circle at 48% 48%, #ecd18c 0 38%, #c7964d 39% 66%, #7d4b25 67% 100%);
    box-shadow:
        inset -3px -4px 0 rgba(75, 38, 18, 0.45),
        inset 2px 2px 0 rgba(255,255,255,0.24),
        0 3px 0 rgba(0,0,0,0.55),
        0 0 8px rgba(241, 201, 118, 0.18);
    color: #3b2214;
    font-family: 'superhelio _regular', sans-serif;
    font-size: 18px;
    line-height: 1;
    text-shadow: 1px 1px 0 rgba(255, 230, 158, 0.45);
}

.sound-control-icon {
    display: block;
    transform: translateY(-3px);
    pointer-events: none;
}

.sound-control-btn:hover {
    filter: brightness(1.08);
    box-shadow:
        inset -3px -4px 0 rgba(75, 38, 18, 0.4),
        inset 2px 2px 0 rgba(255,255,255,0.3),
        0 4px 0 rgba(0,0,0,0.55),
        0 0 12px rgba(241, 201, 118, 0.32);
}

.sound-control-btn:active {
    transform: translateY(2px) rotate(10deg);
    box-shadow:
        inset -2px -3px 0 rgba(75, 38, 18, 0.48),
        inset 2px 2px 0 rgba(255,255,255,0.2),
        0 1px 0 rgba(0,0,0,0.55);
}

.danger-tool {
    color: #ffd8c8;
    background:
        linear-gradient(
            180deg,
            #8b4a3f 0%,
            #54302c 100%
        );
    border-color: #2a1512;
    border-top-color: #c47a5e;
    border-left-color: #c47a5e;
    border-bottom-color: #2a1512;
}

@media (max-width: 1100px) {
    .title-banner {
        display: none;
    }

    #start-screen {
        gap: 20px;
        justify-content: flex-start;
        padding-top: clamp(28px, 6vh, 64px);
    }

    #start-screen h1 {
        font-size: clamp(42px, 6vw, 58px);
        margin-bottom: 2px;
    }

    #title-image-frame {
        width: min(760px, 78vw, calc(44vh * 16 / 9));
        margin-bottom: 14px;
        padding: 8px;
    }

    #start-screen #support-project-btn {
        position: static;
        margin-top: 6px;
    }

    #start-screen button {
        width: 218px;
        padding: 8px 12px;
        font-size: 15px;
        border-bottom-width: 5px;
    }

    #new-game-btn {
        margin-top: 0;
    }

    #load-game-btn {
        margin-top: 0;
    }
}

@media (max-width: 700px) {
    #start-screen {
        gap: 22px;
        padding-top: clamp(36px, 7vh, 72px);
    }

    #title-image-frame {
        margin-bottom: 18px;
    }

    #start-screen #support-project-btn {
        position: static;
        margin-top: 8px;
        width: 218px;
    }
}
