:root {
    --choc-900: #2b140e;
    --choc-800: #3b1a0f;
    --choc-700: #5D4037;
    --choc-500: #8D6E63;

    --cream: #FFF8E1;
    --butter: #FFE7A6;
    --gold: #FFD54F;

    --pink: #FF4FA8;
    --peach: #FFAB91;
    --mint: #59F0D6;
    --sky: #66C7FF;
    --grape: #8B7CFF;

    --ink: #160b07;
    --panel: rgba(255, 255, 255, .92);
    --panel2: rgba(255, 255, 255, .74);

    --shadow-xl: 0 26px 60px rgba(21, 10, 6, .22);
    --shadow-lg: 0 16px 36px rgba(21, 10, 6, .18);
    --shadow-md: 0 10px 24px rgba(21, 10, 6, .14);

    --stroke: rgba(22, 11, 7, .18);
    --stroke-2: rgba(22, 11, 7, .24);

    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;

    --header-h: 74px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--ink);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;

    background:
    radial-gradient(900px 600px at 10% 20%, rgba(255, 79, 168, .30), transparent 60%),
    radial-gradient(820px 520px at 90% 20%, rgba(89, 240, 214, .28), transparent 62%),
    radial-gradient(920px 680px at 55% 95%, rgba(102, 199, 255, .26), transparent 60%),
    radial-gradient(720px 520px at 12% 92%, rgba(139, 124, 255, .24), transparent 60%),
    linear-gradient(180deg, #eef9ff 0%, #fff3fb 45%, #fff8e7 100%);
}

.bg-bloop {
    position: fixed;
    inset: -20vmax;
    pointer-events: none;
    opacity: .42;
    filter: saturate(1.15);
    background:
    radial-gradient(circle at 20% 30%, rgba(255, 79, 168, .55) 0 14%, transparent 16%),
    radial-gradient(circle at 55% 25%, rgba(89, 240, 214, .52) 0 12%, transparent 14%),
    radial-gradient(circle at 78% 35%, rgba(102, 199, 255, .55) 0 13%, transparent 15%),
    radial-gradient(circle at 35% 75%, rgba(139, 124, 255, .52) 0 13%, transparent 15%),
    radial-gradient(circle at 70% 78%, rgba(255, 213, 79, .50) 0 12%, transparent 14%);
    animation: floaty 18s ease-in-out infinite alternate;
    transform: translate3d(0, 0, 0);
}

@keyframes floaty {
    from {
    transform: translate3d(-1.5%, -1%, 0) rotate(-1deg);
    }

    to {
    transform: translate3d(1.5%, 1.2%, 0) rotate(1deg);
    }
}

header {
    position: relative;
    top: 0;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: linear-gradient(180deg, rgba(255, 255, 255, .75) 0%, rgba(255, 255, 255, .55) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(22, 11, 7, .10);
}

.header-inner {
    width: min(1080px, 94vw);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.logo-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background:
    radial-gradient(circle at 30% 30%, #fff 0 20%, rgba(255, 255, 255, .0) 55%),
    linear-gradient(135deg, var(--pink), var(--grape));
    box-shadow: var(--shadow-md);
    border: 2px solid rgba(255, 255, 255, .55);
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.logo-badge::after {
    content: "";
    position: absolute;
    inset: -40%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: rotate(20deg) translateX(-40%);
    animation: shine 2.8s ease-in-out infinite;
    opacity: .7;
}

@keyframes shine {
    0% {
    transform: rotate(20deg) translateX(-55%);
    }

    60% {
    transform: rotate(20deg) translateX(55%);
    }

    100% {
    transform: rotate(20deg) translateX(55%);
    }
}

.brand h1 {
    margin: 0;
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1;
    font-size: clamp(1.25rem, 2.4vw, 1.9rem);
    color: var(--choc-900);
    text-shadow:
    2px 2px 0 rgba(255, 213, 79, .9),
    4px 4px 0 rgba(141, 110, 99, .25);
}

.subline {
    margin-top: 2px;
    font-size: .9rem;
    color: rgba(22, 11, 7, .72);
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

main {
    width: min(1080px, 94vw);
    margin: 20px auto 0;
    display: grid;
    grid-template-columns: .7fr 1.3fr;
    gap: 14px;
    align-items: start;
    padding-bottom: 18px;
    height: calc(100vh - var(--header-h) - 14px);
    overflow:auto;
}

@media (max-width: 900px) {
    main {
    grid-template-columns: 1fr;
    height: auto;
    overflow: auto;
    padding-bottom: 20px;
    }

    body {
    overflow: auto;
    }
}

.card {
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
    radial-gradient(700px 220px at 10% 0%, rgba(255, 79, 168, .16), transparent 55%),
    radial-gradient(700px 220px at 90% 0%, rgba(89, 240, 214, .14), transparent 55%);
    opacity: .9;
}

.prompt-wrap {
    padding: 14px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.prompt-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.prompt-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    border: 1px solid var(--stroke);
    box-shadow: 0 10px 26px rgba(21, 10, 6, .10);
    flex: 1 1 auto;
    min-width: min(520px, 100%);
}

.tag {
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 213, 79, .95), rgba(255, 231, 166, .95));
    border: 1px solid rgba(22, 11, 7, .12);
    color: var(--choc-900);
    box-shadow: 0 7px 0 rgba(255, 179, 0, .22);
    white-space: nowrap;
}

.keyword {
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(1.05rem, 2.2vw, 1.55rem);
    letter-spacing: .4px;
    padding: 2px 10px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--pink), var(--grape));
    border: 2px solid rgba(255, 255, 255, .55);
    text-shadow: 2px 2px 0 rgba(22, 11, 7, .18);
    box-shadow: 0 12px 28px rgba(255, 79, 168, .22);
}

.hint-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    padding: 0 4px 2px;
    opacity: .95;
    font-size: .92rem;
    color: rgba(22, 11, 7, .72);
    font-weight: 800;
}

.kbd {
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(22, 11, 7, .18);
    padding: 2px 8px;
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    color: rgba(22, 11, 7, .85);
    box-shadow: 0 6px 0 rgba(22, 11, 7, .08);
}

.btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: .2px;
    border-radius: 16px;
    padding: 12px 14px;
    color: var(--choc-900);
    background: linear-gradient(180deg, #fff 0%, #fff3 100%);
    border: 2px solid rgba(22, 11, 7, .14);
    box-shadow: 0 10px 0 rgba(22, 11, 7, .10), 0 18px 40px rgba(21, 10, 6, .14);
    transform: translateY(0);
    transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
    white-space: nowrap;
}

.btn:hover {
    filter: brightness(1.03) saturate(1.05);
}

.btn:active {
    transform: translateY(8px);
    box-shadow: 0 2px 0 rgba(22, 11, 7, .12), 0 10px 26px rgba(21, 10, 6, .12);
}

.btn.small {
    padding: 12px 12px;
    width: 48px;
    height: 48px;
    border-radius: 16px;
}

.btn.primary {
    background: linear-gradient(135deg, rgba(255, 213, 79, 1), rgba(255, 231, 166, 1));
    border: 2px solid rgba(255, 255, 255, .55);
    box-shadow: 0 10px 0 rgba(255, 179, 0, .35), 0 18px 40px rgba(255, 179, 0, .18);
}

.btn.ghost {
    background: rgba(255, 255, 255, .55);
    border: 2px solid rgba(22, 11, 7, .12);
    box-shadow: 0 10px 0 rgba(22, 11, 7, .08), 0 18px 40px rgba(21, 10, 6, .10);
}

.btn.danger {
    color: #fff;
    background: linear-gradient(135deg, #ff3b5b, #ff7a59);
    border: 2px solid rgba(255, 255, 255, .55);
    box-shadow: 0 10px 0 rgba(170, 20, 40, .35), 0 18px 40px rgba(255, 60, 90, .18);
}

.btn[aria-pressed="true"] {
    outline: 3px solid rgba(89, 240, 214, .55);
    outline-offset: 2px;
    background: linear-gradient(135deg, rgba(89, 240, 214, .95), rgba(102, 199, 255, .90));
    border-color: rgba(255, 255, 255, .7);
}

.stage {
    padding: 12px;
}

.game-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 58vh;
    border-radius: calc(var(--radius-xl) - 6px);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-xl);
    outline: 8px solid rgba(255, 255, 255, .55);
    box-shadow:
    var(--shadow-xl),
    0 0 0 6px rgba(255, 79, 168, .18),
    0 0 0 12px rgba(89, 240, 214, .14);
}

canvas {
    position: absolute;
    inset: 0;
    display: block;
}

#drawCanvas {
    touch-action: none;
    cursor: crosshair;
}

.sticker {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 900;
    letter-spacing: .5px;
    color: #fff;
    text-shadow: 2px 2px 0 rgba(22, 11, 7, .18);
    padding: 8px 10px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, .55);
    box-shadow: 0 12px 28px rgba(21, 10, 6, .18);
    transform: rotate(-3deg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: .92;
}

.sticker.left {
    left: 12px;
    top: 12px;
    background: linear-gradient(135deg, rgba(255, 79, 168, .92), rgba(139, 124, 255, .88));
}

.sticker.right {
    right: 12px;
    top: 12px;
    transform: rotate(3deg);
    background: linear-gradient(135deg, rgba(89, 240, 214, .9), rgba(102, 199, 255, .88));
}

.side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}

.panel {
    padding: 14px;
}

.panel h2 {
    margin: 0 0 10px 0;
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: .3px;
    color: var(--choc-900);
}

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

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

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

.pill {
    background: rgba(255, 255, 255, .70);
    border: 1px solid var(--stroke);
    border-radius: 18px;
    padding: 10px 12px;
    box-shadow: 0 12px 26px rgba(21, 10, 6, .10);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

select {
    width: 100%;
    border: 2px solid rgba(22, 11, 7, .14);
    border-radius: 16px;
    padding: 12px 14px;
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 800;
    color: var(--choc-900);
    background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .78));
    box-shadow: 0 10px 0 rgba(22, 11, 7, .08), 0 18px 40px rgba(21, 10, 6, .10);
    appearance: none;
    cursor: pointer;
    outline: none;
    background-image:
    linear-gradient(45deg, transparent 50%, rgba(22, 11, 7, .75) 50%),
    linear-gradient(135deg, rgba(22, 11, 7, .75) 50%, transparent 50%);
    background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 40px;
}

select:focus {
    outline: 3px solid rgba(255, 79, 168, .25);
    outline-offset: 2px;
}

.slider-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.size-pill {
    min-width: 64px;
    text-align: center;
    padding: 8px 10px;
    border-radius: 999px;
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 900;
    color: #fff;
    background: #f359ad;
    border: 2px solid rgba(255, 255, 255, .55);
    box-shadow: 0 10px 0 rgba(22, 11, 7, .10);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgb(126 220 225), rgb(22 156 177 / 90%));
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, .18);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background:
    radial-gradient(circle at 30% 30%, #fff 0 22%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(135deg, #fff, #fff0);
    border: 3px solid rgba(22, 11, 7, .18);
    box-shadow: 0 10px 0 rgba(22, 11, 7, .10), 0 18px 30px rgba(21, 10, 6, .15);
    cursor: pointer;
}

.dock {
    display: none;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 12px;
    width: min(980px, 94vw);
    z-index: 30;
    padding: 10px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(22, 11, 7, .10);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dock .row {
    justify-content: space-between;
}

@media (max-width: 900px) {
    .dock {
    /*display: block;*/
    }

    .header-actions {
    display: none;
    }
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%);
    background: rgba(43, 20, 14, .92);
    color: var(--cream);
    border: 2px solid rgba(255, 213, 79, .55);
    padding: 10px 14px;
    border-radius: 999px;
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: .2px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 999;
    max-width: 92vw;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.wiggle {
    animation: wiggle 1.4s ease-in-out infinite;
    transform-origin: 50% 50%;
}

@keyframes wiggle {

    0%,
    100% {
    transform: rotate(-1deg) translateY(0);
    }

    50% {
    transform: rotate(1.3deg) translateY(-1px);
    }
}

/* Multiplayer pill */
.mp-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.mp-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.mp-title {
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 900;
    letter-spacing: .3px;
    color: var(--choc-900);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.mp-sub {
    font-weight: 800;
    color: rgba(22, 11, 7, .72);
    font-size: .92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.mp-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 79, 168, .65);
    box-shadow: 0 0 0 4px rgba(255, 79, 168, .16);
}

.mp-dot.ok {
    background: rgba(89, 240, 214, .95);
    box-shadow: 0 0 0 4px rgba(89, 240, 214, .18);
}

.mp-dot.warn {
    background: rgba(255, 213, 79, .95);
    box-shadow: 0 0 0 4px rgba(255, 213, 79, .18);
}

.mp-input {
    width: 100%;
    border: 2px solid rgba(22, 11, 7, .14);
    border-radius: 16px;
    padding: 12px 14px;
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 800;
    color: var(--choc-900);
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 10px 0 rgba(22, 11, 7, .08), 0 18px 40px rgba(21, 10, 6, .10);
    outline: none;
}

.mp-input:focus {
    outline: 3px solid rgba(102, 199, 255, .28);
    outline-offset: 2px;
}

.muted-note {
    font-weight: 800;
    color: rgba(22, 11, 7, .62);
    font-size: .9rem;
    line-height: 1.35;
}

    .hint-row.fn-controlbar {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      margin-top: 10px;
      padding: 7px 10px 20px;
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.65);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }

    .fn-controlbar .rowA {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }

    .fn-controlbar .group {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .fn-controlbar .miniLabel {
      font-family: Fredoka, system-ui, sans-serif;
      font-weight: 900;
      font-size: 12px;
      letter-spacing: 0.02em;
      opacity: 0.75;
      white-space: nowrap;
    }

    .fn-controlbar .miniPill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.85);
      border: 1px solid rgba(0, 0, 0, 0.06);
    }

    .fn-controlbar input[type="range"] {
      width: min(230px, 48vw);
    }

    .fn-controlbar select {
      max-width: 220px;
    }

    .fn-controlbar .btn.small {
      padding: 8px 10px;
      width: auto;
    }

    .fn-controlbar .kbd {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 26px;
      height: 22px;
      padding: 0 8px;
      border-radius: 8px;
      background: rgba(0, 0, 0, 0.07);
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      font-size: 12px;
      font-weight: 800;
    }

    /* no longer used to hide word for guessers. we show a masked version instead */
    .fn-hidden-word {
      visibility: hidden;
      pointer-events: none;
    }

    .header-inner {
      text-align: center;
      width: auto;
    }

    /* ---------------------------------------------
       Turn-based Players list becomes the scoreboard
    ---------------------------------------------- */
    .fn-players {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    /* ---------------------------------------------
       Tiny animated +2 pop
    ---------------------------------------------- */
    .fn-score-pop {
      position: absolute;
      right: -6px;
      top: -10px;
      transform: translate(0, 0) scale(0.9);
      padding: 6px 8px;
      border-radius: 999px;
      font-family: Fredoka, system-ui, sans-serif;
      font-weight: 900;
      font-size: 12px;
      background: rgba(255, 255, 255, .92);
      border: 1px solid rgba(0, 0, 0, .08);
      box-shadow: 0 12px 22px rgba(0, 0, 0, .10);
      pointer-events: none;
      opacity: 0;
      animation: fnPopFloat 900ms ease forwards;
      will-change: transform, opacity;
    }

    .fn-score-pop.pos {
      color: rgba(20, 120, 60, .95);
    }

    .fn-score-pop.neg {
      color: rgba(180, 40, 40, .95);
    }

    @keyframes fnPopFloat {
      0% {
        opacity: 0;
        transform: translate(0, 8px) scale(0.85);
        filter: blur(0.4px);
      }

      20% {
        opacity: 1;
        transform: translate(0, 0) scale(1.03);
        filter: blur(0px);
      }

      65% {
        opacity: 1;
        transform: translate(0, -16px) scale(1.0);
      }

      100% {
        opacity: 0;
        transform: translate(0, -26px) scale(0.98);
      }
    }

    header {
      background: none;
      border-bottom: 0;
      backdrop-filter: none;
    }

    body {
      background: url(background.png);
      background-position: center;
      background-size: cover;
    }

    /* ---------------------------------------------
       Top answer banner
    ---------------------------------------------- */
    #tbAnswerTop {
      display: none;
      margin-top: 10px;
      padding: 10px 12px;
      border-radius: 14px;
      background: rgba(109, 255, 123, .18);
      border: 1px solid rgba(109, 255, 123, .25);
      box-shadow: 0 10px 24px rgba(0, 0, 0, .06);
      font-family: Fredoka, system-ui, sans-serif;
      font-weight: 900;
    }

    #tbAnswerTop .sub {
      margin-top: 4px;
      font-family: Nunito, system-ui, sans-serif;
      font-weight: 800;
      opacity: .75;
      font-size: 12px;
    }

    #tbAnswerTop .word {
      display: inline-block;
      margin-left: 6px;
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(255, 255, 255, .7);
      border: 1px solid rgba(0, 0, 0, .06);
    }

    /* Chrome / Edge / Safari */
    *::-webkit-scrollbar { width: 14px; height: 14px; }

    *::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, .10);
      border-radius: 999px;
    }

    *::-webkit-scrollbar-thumb {
      border-radius: 999px;
      border: 3px solid rgba(255, 255, 255, .10);
      background:
        linear-gradient(135deg, rgba(255, 79, 168, .9), rgba(139, 124, 255, .86));
      box-shadow:
        0 8px 20px rgba(0, 0, 0, .25),
        0 0 0 2px rgba(0, 0, 0, .06) inset;
    }

    *::-webkit-scrollbar-thumb:hover {
      filter: saturate(1.15) brightness(1.08);
    }

    /* Firefox (approx) */
    * {
      scrollbar-width: thin;
      scrollbar-color: rgba(139, 124, 255, .86) rgba(255, 79, 168, .9);
    }

    /* ---------------------------------------------
       TIME'S UP BEAUTIFUL ALERT (modal)
    ---------------------------------------------- */
    .fn-modal {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 18px;
      z-index: 999999;
    }

    .fn-modal.show {
      display: flex;
    }

    .fn-modal .backdrop {
      position: absolute;
      inset: 0;
      background:
        radial-gradient(1200px 700px at 50% 30%, rgba(255, 255, 255, .22), rgba(0, 0, 0, .52)),
        rgba(0, 0, 0, .35);
      backdrop-filter: blur(8px);
    }

    .fn-modal .card {
      position: relative;
      width: min(520px, 92vw);
      border-radius: 22px;
      background: rgba(255, 255, 255, .92);
      border: 1px solid rgba(0, 0, 0, .08);
      box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
      overflow: hidden;
      transform: translateY(8px) scale(.985);
      opacity: 0;
      animation: fnModalIn 260ms ease forwards;
      font-family: Nunito, system-ui, sans-serif;
    }

    @keyframes fnModalIn {
      to {
        transform: translateY(0) scale(1);
        opacity: 1;
      }
    }

    .fn-modal .top {
      padding: 14px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      background:
        linear-gradient(135deg, rgba(255, 79, 168, .14), rgba(139, 124, 255, .14)),
        rgba(255, 255, 255, .94);
      border-bottom: 1px solid rgba(0, 0, 0, .06);
    }

    .fn-modal .title {
      display: flex;
      align-items: center;
      gap: 10px;
      font-family: Fredoka, system-ui, sans-serif;
      font-weight: 900;
      letter-spacing: .01em;
      font-size: 18px;
      color: rgba(20, 10, 8, .92);
    }

    .fn-modal .burst {
      width: 34px;
      height: 34px;
      border-radius: 14px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 213, 79, .22);
      border: 1px solid rgba(255, 213, 79, .28);
      box-shadow: 0 10px 22px rgba(0, 0, 0, .10);
    }

    .fn-modal .body {
      padding: 16px;
      color: rgba(20, 10, 8, .84);
    }

    .fn-modal .wordPill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      border-radius: 999px;
      font-family: Fredoka, system-ui, sans-serif;
      font-weight: 900;
      background: rgba(109, 255, 123, .18);
      border: 1px solid rgba(109, 255, 123, .24);
      box-shadow: 0 12px 26px rgba(0, 0, 0, .10);
      margin-top: 10px;
    }

    .fn-modal .sub {
      margin-top: 10px;
      opacity: .82;
      font-weight: 800;
      line-height: 1.35;
    }

    .fn-modal .footer {
      padding: 14px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border-top: 1px solid rgba(0, 0, 0, .06);
      background: rgba(255, 255, 255, .88);
    }

    .fn-modal .tiny {
      font-size: 12px;
      opacity: .75;
      font-weight: 800;
    }

    .fn-modal .closeBtn {
      border: 0;
      border-radius: 999px;
      padding: 10px 12px;
      cursor: pointer;
      font-family: Fredoka, system-ui, sans-serif;
      font-weight: 900;
      background: rgba(0, 0, 0, .06);
    }

  .fudgeman-img{
    width: min(340px, 70vw);
    height: auto;
    display: block;
    animation: fnFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 22px 30px rgba(0,0,0,0.14));
    transform-origin: 50% 70%;
    position: fixed;
    right: 0;
    top: 70%;
  }
  
  .fudgemanback-img{
    width: min(440px, 70vw);
    height: auto;
    display: block;
    animation: fnFloatBack 2s ease-in-out infinite;
    filter: drop-shadow(0 22px 30px rgba(0,0,0,0.14));
    transform-origin: 50% 70%;
    position: fixed;
    left: 0;
    top: 70%;
  }

  @keyframes fnFloat{
    0%,100%{ transform: translateY(0) rotate(0deg); }
    50%{ transform: translateY(-12px) rotate(2deg); }
  }

  @keyframes fnFloatBack{
    0%,100%{ transform: translateY(0) rotate(0deg); }
    50%{ transform: translateY(-4px) rotate(2deg); }
  }

  /* Reduce motion for people who prefer it */
  @media (prefers-reduced-motion: reduce){
    .fudgeman-img, .shadow{ animation: none; }
    .character-container{ transition: none; }
  }
