
      :root { color-scheme: light; --violet: #7040ab; --violet-deep: #46296f; --lime: #c3e867; --cream: #fff8ef; --ink: #30263c; --shadow: 0 3px 0 #d9cde8; }
      * { box-sizing: border-box; }
      [hidden] { display: none !important; }
      html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--cream); color: var(--ink); font-family: Inter, ui-rounded, system-ui, sans-serif; }
      body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
      button, select { font: inherit; }
      button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #f0a33d; outline-offset: 3px; }
      #app, #play-layer, #game-container { position: fixed; inset: 0; }
      #game-container { z-index: 0; }
      #game-container canvas { display: block; width: 100%; height: 100%; }
      #play-layer { z-index: 1; }
      #play-layer[hidden], .screen[hidden], .modal[hidden], #finale-overlay[hidden] { display: none !important; }
      #game-ui { position: absolute; inset: 0; pointer-events: none; }
      #topbar { position: absolute; top: max(env(safe-area-inset-top), 8px); left: max(env(safe-area-inset-left), 8px); right: max(env(safe-area-inset-right), 8px); display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; }
      .menu-button, .key, .primary, .secondary { border: 0; cursor: pointer; font-weight: 800; -webkit-tap-highlight-color: transparent; }
      .menu-button { pointer-events: auto; min-width: 88px; min-height: 44px; padding: 0 17px; border-radius: 15px; color: var(--violet-deep); background: #fffefa; box-shadow: var(--shadow); font-size: 16px; }
      #daily-move-retry { border: 2px solid var(--violet); }
      #topbar.recovering #attempts-indicator { display: none; }
      #attempts-indicator { display: flex; align-items: center; gap: 4px; min-height: 40px; padding: 8px 10px; border-radius: 14px; background: #fffefa; box-shadow: var(--shadow); }
      .attempt-dot { width: 8px; height: 10px; border-radius: 4px; background: #8c9a8a; }
      .attempt-dot.used { background: #d08a76; opacity: .52; }
      .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
      #game-prompt, #clue-note { position: absolute; top: 62px; left: 50%; transform: translateX(-50%); max-width: min(86vw, 540px); padding: 5px 11px; border-radius: 99px; color: #43394c; background: #fffaf0e8; text-align: center; font-size: 13px; font-weight: 800; line-height: 1.3; pointer-events: none; }
      #clue-note { top: 61px; border-radius: 12px; font-size: 12px; }
      #interaction-caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
      #bottom-ui { position: absolute; right: max(env(safe-area-inset-right), 8px); bottom: max(env(safe-area-inset-bottom), 9px); left: max(env(safe-area-inset-left), 8px); display: flex; flex-direction: column; gap: 7px; pointer-events: auto; }
      #keyboard { width: min(100%, 540px); align-self: center; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: clamp(3px, 1vw, 6px); }
      .key { min-width: 0; min-height: clamp(39px, 5.6vh, 48px); padding: 0; border-radius: 11px; color: #3a2d4c; background: #fffefa; box-shadow: 0 3px 0 #cfc2e0; font-size: clamp(14px, 4.4vw, 19px); transition: transform .12s, background .12s, box-shadow .12s; touch-action: manipulation; }
      .key:active, .key.press { transform: translateY(2px); box-shadow: 0 1px 0 #cfc2e0; }
      .key.hit { background: var(--lime); color: #314900; }
      .key.miss { background: #e5b3a5; color: #5a302a; }
      .key.used { text-decoration: line-through; text-decoration-thickness: 2px; }
      .key:disabled { cursor: default; opacity: .76; }
      .screen { position: fixed; z-index: 5; inset: 0; display: grid; place-items: center; padding: max(env(safe-area-inset-top), 16px) max(env(safe-area-inset-right), 14px) max(env(safe-area-inset-bottom), 16px) max(env(safe-area-inset-left), 14px); background: radial-gradient(ellipse at 50% 16%, #fffefaee 0%, #fff8eff2 48%, #eadfffe8 100%); overflow-y: auto; }
      .entry-card { width: min(100%, 410px); border: 1px solid #fff; border-radius: 28px; padding: clamp(20px, 6vw, 32px); background: #ffffffeb; box-shadow: 0 18px 65px #6840cc25; text-align: center; }
      .entry-logo { display: block; width: min(100%, 330px); height: auto; margin: 0 auto 12px; }
      .entry-card h1 { margin: 0; color: var(--violet-deep); letter-spacing: .02em; font-size: clamp(27px, 8vw, 38px); }
      .preview-tag { display: inline-flex; align-items: center; justify-content: center; margin: 0 auto 9px; padding: 7px 11px; border: 1px solid #e3d3b7; border-radius: 99px; color: #67502f; background: #fff3d7; font-size: 11px; font-weight: 900; letter-spacing: .045em; }
      .entry-card p { margin: 8px 0 16px; color: #63576c; font-weight: 650; line-height: 1.42; }
      .entry-actions { display: grid; gap: 9px; }
      .difficulty-row { display: grid; gap: 6px; margin: 15px 0 13px; text-align: left; }
      .difficulty-row label { color: #51465e; font-size: 13px; font-weight: 850; }
      .difficulty-row select { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid #d8cce7; border-radius: 13px; color: var(--violet-deep); background: #fffefa; font-weight: 800; }
      .difficulty-row small { color: #786d80; font-size: 11px; line-height: 1.35; }
      .primary, .secondary { min-height: 48px; padding: 0 15px; border-radius: 15px; }
      .primary { color: #314900; background: var(--lime); box-shadow: 0 4px 0 #9dbd49; font-size: 17px; }
      .secondary { color: var(--violet-deep); background: #f1eaff; box-shadow: 0 3px 0 #d8cae8; }
      #entry-notice, #toast { color: #675c70; font-size: 12px; font-weight: 650; min-height: 18px; }
      #entry-notice { margin: 12px 0 0; }
      #toast { position: fixed; z-index: 12; bottom: max(env(safe-area-inset-bottom), 14px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 92vw; padding: 9px 14px; border-radius: 99px; background: #fffefa; box-shadow: 0 4px 18px #382c4930; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
      #toast.visible { opacity: 1; }
      .modal, #finale-overlay { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: max(env(safe-area-inset-top), 14px) max(env(safe-area-inset-right), 12px) max(env(safe-area-inset-bottom), 14px) max(env(safe-area-inset-left), 12px); background: #30204e72; }
      .dialog-card, .finale-card { width: min(100%, 460px); max-height: min(90dvh, 760px); overflow: auto; border: 1px solid #fff; border-radius: 23px; padding: clamp(17px, 4.5vw, 26px); background: var(--cream); box-shadow: 0 15px 55px #21133755; }
      .dialog-card h2, .finale-card h2 { margin: 0 0 11px; color: var(--violet-deep); font-size: 22px; }
      .dialog-card p { line-height: 1.48; }
      #menu-provenance { margin: 0 0 13px; color: #675c70; font-size: 12px; font-weight: 700; }
      .menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
      .menu-grid button { min-width: 0; min-height: 46px; padding: 7px 9px; border: 0; border-radius: 13px; color: var(--violet-deep); background: #f1eaff; box-shadow: 0 2px 0 #d8cae8; font-weight: 800; }
      #menu-back { grid-column: 1 / -1; color: #51465e; background: #eee8df; box-shadow: none; }
      #menu-close { width: 100%; margin-top: 11px; }
      .dialog-actions, .finale-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
      .dialog-actions .secondary, .finale-actions .secondary { min-height: 45px; padding: 6px 9px; font-size: 13px; }
      .setting-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid #ede5f4; line-height: 1.35; }
      .setting-row input { flex: 0 0 auto; width: 21px; height: 21px; accent-color: var(--violet); margin: 0; }
      .setting-row small { display: block; color: #786d80; font-size: 12px; margin-top: 3px; }
      .setting-row input:disabled { opacity: .65; }
      #poll-modal .dialog-card { text-align: center; background: #fffaf2; }
      #poll-question { color: #564969; font-weight: 750; line-height: 1.4; }
      #poll-result { min-height: 26px; color: #5b496a; font-weight: 800; }
      #finale-overlay { z-index: 15; align-items: end; background: transparent; pointer-events: none; padding-bottom: max(env(safe-area-inset-bottom), 8px); }
      #finale-overlay .finale-card { pointer-events: auto; width: min(100%, 560px); padding: 10px 14px; border-radius: 18px; text-align: center; background: #fffaf2f2; box-shadow: 0 4px 16px #30204e22; }
      #finale-title { margin: 0 0 3px; font-size: 16px; letter-spacing: .03em; }
      #finale-copy { min-height: 0; margin: 3px 0; color: #685b72; font-size: 12px; font-weight: 750; }
      #revealed-answer:empty { display: none; }
      #revealed-answer { min-height: 0; margin: 4px 0; color: var(--violet-deep); font-size: clamp(20px, 6vw, 30px); font-weight: 950; letter-spacing: .06em; overflow-wrap: anywhere; }
      #finale-timer { margin: 3px 0 7px; color: #756a7d; font-size: 11px; font-weight: 800; }
      .finale-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
      .finale-actions button { min-height: 40px; padding: 7px 11px; font-size: 12px; }
      body.showing-finale #bottom-ui { visibility: hidden; }
      body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
      @media (max-height: 650px) {
        .key { min-height: 34px; }
        #bottom-ui { gap: 4px; }
        .entry-card { padding: 18px; }
      }
      @media (max-width: 360px) {
        #keyboard { gap: 3px; }
        .key { border-radius: 9px; }
        #attempts-indicator { gap: 3px; padding: 7px 8px; }
        .attempt-dot { width: 7px; }
        .menu-grid { gap: 7px; }
        .menu-grid button { min-height: 44px; font-size: 13px; }
      }
      @media (max-width: 420px) { #finale-overlay .finale-card { padding: 8px; } #finale-copy { display: none; } .finale-actions button { padding: 7px 9px; } }
      @media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto; } }
    

    #rosebud-exported-splash {
        position: fixed;
        inset: 0;
        z-index: 2147483647;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000;
        opacity: 1;
        transition: opacity 500ms ease-in-out;
    }

    #rosebud-exported-splash.is-hiding {
        opacity: 0;
    }

    #rosebud-exported-splash .rosebud-exported-splash__content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        text-align: center;
        color: #fff;
        font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    }

    #rosebud-exported-splash .rosebud-exported-splash__logo {
        width: 100px;
        height: 100px;
        animation: rosebud-exported-splash-breathe 2.4s ease-in-out infinite;
    }

    #rosebud-exported-splash .rosebud-exported-splash__text {
        display: flex;
        flex-direction: column;
        gap: 4px;
        font-size: 16px;
        line-height: 1.25;
        letter-spacing: 0.06em;
    }

    #rosebud-exported-splash .rosebud-exported-splash__text strong {
        font-weight: 700;
    }

    #rosebud-exported-splash .rosebud-exported-splash__text span:last-child {
        opacity: 0.88;
    }

    @keyframes rosebud-exported-splash-breathe {
        0%,
        100% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.05);
        }
    }

#preview-penalty{pointer-events:auto;min-height:44px;border:0;border-radius:14px;background:#c3e867;color:#302048;font-weight:800;padding:0 15px;box-shadow:0 3px 0 #9dbd49;cursor:pointer;}
#topbar{align-items:center;}
#entry-screen .entry-card{max-width:340px;}
#entry-help-button,#entry-settings-button{min-height:44px;}
#finale-title,#finale-copy,#finale-timer,#revealed-answer,#reveal-button,#finale-back,#finale-repeat{display:none;}
#finale-overlay .finale-card{width:auto;background:none;box-shadow:none;border:0;}
#poll-result:empty{display:none;}
