/* The world: walkable places (the Arcade Complex), the awards and scores panels, the
   achievement toast, the playroom's award plaque, screen-theme cosmetics, preference classes. */

/* ---------------------------------------------------------------- a walkable place */
.w-root { position: absolute; inset: 0; z-index: 48; background: #05040a; overflow: hidden; touch-action: none; user-select: none; }
.w-canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; cursor: grab; }
.w-hud { position: absolute; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.w-hud button { pointer-events: auto; }
.w-back { font: 10px var(--pixel); padding: 10px 11px 9px; background: rgba(18, 13, 28, .78); color: var(--cream); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(246, 231, 200, .25); }
.w-where { flex: 1; text-align: center; font: clamp(15px, 2vw, 20px) var(--term); color: var(--cream); opacity: .75; text-shadow: 0 2px 0 #000; }
.w-set { width: 40px; height: 40px; font-size: 18px; background: rgba(18, 13, 28, .78); color: var(--cream); border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(246, 231, 200, .25); }
.w-prompt { position: absolute; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); z-index: 5; max-width: 92vw; padding: 8px 14px 7px; font: clamp(18px, 2.3vw, 24px)/1.1 var(--term); color: #fff; background: rgba(10, 8, 16, .72); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255, 215, 106, .45); pointer-events: none; text-align: center; }
.w-say { position: absolute; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); z-index: 6; max-width: min(92vw, 640px); text-align: center; font: clamp(20px, 2.6vw, 26px)/1.15 var(--term); color: #fff; text-shadow: 0 2px 0 #000, 0 0 12px #000; opacity: 0; transition: opacity .3s; pointer-events: none; }
.w-say.on { opacity: 1; }
.w-hint { position: absolute; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); z-index: 5; padding: 7px 12px 6px; font: clamp(16px, 2vw, 20px) var(--term); color: var(--cream); background: rgba(10, 8, 16, .7); border-radius: 3px; pointer-events: none; max-width: 92vw; text-align: center; }
.w-card { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: 0; transition: opacity .5s; pointer-events: none; text-align: center; }
.w-card.on { opacity: 1; }
.w-card small { font: 10px var(--pixel); color: #ff5ad8; letter-spacing: .25em; text-shadow: 0 0 10px #ff5ad8; }
.w-card b { font: clamp(16px, 3.4vw, 30px)/1.3 var(--pixel); color: #fff; text-shadow: 3px 3px 0 #b3202a; }
/* revisits: a small name tag at the top instead of the big card (3.0) */
.w-card.small { top: calc(58px + var(--safe-t)); transform: translateX(-50%); flex-direction: row; gap: 8px; padding: 5px 12px 4px; background: rgba(10, 8, 16, .62); border-radius: 3px; }
.w-card.small small { font-size: 8px; letter-spacing: .18em; }
.w-card.small b { font-size: clamp(10px, 1.5vw, 13px); text-shadow: 2px 2px 0 #b3202a; }
.w-fade { position: absolute; inset: 0; z-index: 20; background: #000; opacity: 0; pointer-events: none; transition: opacity .38s; }
.w-fade.on { opacity: 1; }
.w-joy { position: absolute; left: 30px; bottom: calc(40px + var(--safe-b)); z-index: 4; width: 120px; height: 120px; border-radius: 50%; background: rgba(246, 231, 200, .07); box-shadow: inset 0 0 0 2px rgba(246, 231, 200, .18); pointer-events: none; opacity: .6; }
.w-joy.on { opacity: 1; }
.w-joy i { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(246, 231, 200, .25); }

/* a machine, up close: the screen in a cabinet-shaped frame */
.w-machine { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(5, 4, 10, .86); animation: fadein .25s; }
.w-machine-frame { position: relative; width: min(94vw, calc((92vh - 20px) * .75)); aspect-ratio: 3 / 4; padding: 14px; background: linear-gradient(#2a1a3a, #120c1c); border-radius: 10px; box-shadow: 0 0 0 3px #ff5ad8, 0 0 40px rgba(255, 90, 216, .35), inset 0 0 30px #000; }
.w-machine-screen { position: relative; width: 100%; height: 100%; background: #000; overflow: hidden; border-radius: 4px; }
.w-machine-screen .ag, .w-machine-screen .cart { position: absolute; inset: 0; }
.w-machine-screen > canvas { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.w-machine-x { position: absolute; top: calc(10px + var(--safe-t)); right: 12px; width: 44px; height: 44px; background: var(--coral); color: var(--cream); font: 14px var(--pixel); border-radius: 4px; box-shadow: 3px 3px 0 var(--ink); }
.w-inside { position: absolute; inset: 0; z-index: 12; display: grid; place-items: center; background: #000; transition: opacity .5s; }
.w-inside canvas { width: min(92vw, 120vh); aspect-ratio: 4 / 3; image-rendering: pixelated; box-shadow: 0 0 0 4px #1a1420, 0 0 60px rgba(255, 59, 59, .15); }
.w-inside.out { opacity: 0; }

/* ---------------------------------------------------------------- toast: achievement unlocked */
.w-toast { position: absolute; top: calc(64px + var(--safe-t)); right: 14px; z-index: 95; display: flex; gap: 10px; align-items: center; max-width: min(90vw, 360px); padding: 10px 14px 9px 10px; background: #1e1a2b; color: var(--cream); border-radius: 4px; box-shadow: 0 0 0 2px var(--mustard), 4px 4px 0 var(--coral); transform: translateX(120%); transition: transform .4s cubic-bezier(.2, 1.2, .4, 1); pointer-events: none; }
.w-toast.on { transform: translateX(0); }
.w-toast-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font: 22px system-ui, "Segoe UI Symbol", sans-serif; color: var(--ink); background: var(--mustard); border-radius: 3px; }
.w-toast-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.w-toast-txt small { font: 8px var(--pixel); color: var(--mustard); letter-spacing: .1em; }
.w-toast-txt b { font: clamp(10px, 1.6vw, 12px)/1.4 var(--pixel); color: #fff; overflow-wrap: anywhere; }
.w-toast-txt span { font: 16px var(--term); opacity: .75; }

/* ---------------------------------------------------------------- panels: awards, scores */
.w-panel { position: absolute; inset: 0; z-index: 85; display: grid; place-items: center; background: rgba(8, 6, 14, .8); padding: 16px; }
.w-panel-box { width: min(100%, 720px); max-height: 92vh; display: flex; flex-direction: column; background: #1e1a2b; color: var(--cream); box-shadow: 0 0 0 2px var(--mustard), 6px 6px 0 var(--coral); }
.w-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; }
.w-panel-head h2 { margin: 0; font: 15px var(--pixel); color: var(--mustard); }
.w-panel-x { width: 40px; height: 40px; flex: none; background: var(--coral); color: var(--cream); font: 13px var(--pixel); border-radius: 3px; }
.w-panel-body { overflow-y: auto; padding: 0 16px 16px; }
.w-panel-body h3 { margin: 14px 0 8px; font: 22px var(--term); opacity: .85; }
.w-ach-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.w-ach-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; background: rgba(255, 255, 255, .04); border-radius: 3px; opacity: .55; }
.w-ach-list li.on { opacity: 1; box-shadow: inset 0 0 0 1px rgba(233, 180, 76, .5); }
.w-ach-list .ic { width: 32px; height: 32px; flex: none; display: grid; place-items: center; font: 18px system-ui, "Segoe UI Symbol", sans-serif; background: #2a2236; border-radius: 3px; }
.w-ach-list li.on .ic { background: var(--mustard); color: var(--ink); }
.w-ach-list div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.w-ach-list b { font: 10px/1.5 var(--pixel); color: #fff; overflow-wrap: anywhere; }
.w-ach-list small { font: 17px/1.15 var(--term); opacity: .8; }
.w-ach-list .rw { font: 15px var(--term); color: var(--mustard); }
.w-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.w-item { display: flex; flex-direction: column; gap: 4px; padding: 10px; background: rgba(255, 255, 255, .04); border-radius: 3px; opacity: .5; }
.w-item.on { opacity: 1; box-shadow: inset 0 0 0 1px rgba(93, 255, 155, .4); }
.w-item.focus { box-shadow: inset 0 0 0 2px var(--mustard); }
.w-item b { font: 10px/1.5 var(--pixel); color: #fff; overflow-wrap: anywhere; }
.w-item small { font: 16px/1.1 var(--term); opacity: .75; }
.w-item button { margin-top: 4px; font: 9px var(--pixel); padding: 9px 10px 8px; background: rgba(30, 26, 43, .95); color: var(--cream); box-shadow: inset 0 0 0 1px rgba(246, 231, 200, .3); }
.w-item button.primary { background: var(--mustard); color: var(--ink); }
.w-score-table { width: 100%; border-collapse: collapse; font: 19px var(--term); }
.w-score-table th { text-align: start; font: 9px/1.5 var(--pixel); padding: 7px 6px; color: #fff; }
.w-score-table td { padding: 6px; }
.w-score-table tr:nth-child(odd) { background: rgba(255, 255, 255, .04); }
.w-score-table .top { opacity: .7; font-size: 16px; }
.w-recent { margin: 0; padding-inline-start: 20px; font: 18px/1.3 var(--term); opacity: .85; }

/* ---------------------------------------------------------------- the playroom: award plaque on the window sill */
.trophy { position: absolute; left: 0; top: 0; z-index: 8; width: 28px; height: 30px; padding: 0; background: none; pointer-events: auto; cursor: pointer; display: grid; justify-items: center; }
.trophy i { width: 16px; height: 14px; background: linear-gradient(#ffd76a, #c98f2a); border-radius: 0 0 8px 8px; box-shadow: 0 0 12px rgba(255, 215, 106, .7), inset 0 -3px 0 rgba(0, 0, 0, .2); position: relative; }
.trophy i::after { content: ""; position: absolute; left: 5px; top: 14px; width: 6px; height: 7px; background: #c98f2a; box-shadow: -4px 7px 0 -1px #5a3a1a, 4px 7px 0 -1px #5a3a1a; }
.trophy span { position: absolute; top: -10px; right: -8px; min-width: 14px; padding: 1px 3px; font: 8px var(--pixel); color: var(--ink); background: var(--cream); border-radius: 6px; }
.trophy.new span { background: #ff3b3b; color: #fff; animation: nudge 1.6s ease-in-out infinite; }
.cart-item.feature.world { --c: #3fb7c9; background: linear-gradient(90deg, rgba(63, 183, 201, .22), rgba(255, 90, 216, .1)); }

/* ---------------------------------------------------------------- cosmetics: screen themes for the arcade games */
:root[data-screen-theme="amber"] .ag:not(.ag-enc) .ag-canvas { filter: sepia(1) saturate(2.6) hue-rotate(-12deg) brightness(1.05) contrast(1.1); }
:root[data-screen-theme="green"] .ag:not(.ag-enc) .ag-canvas { filter: grayscale(1) sepia(1) saturate(4) hue-rotate(70deg) brightness(.95) contrast(1.2); }

/* ---------------------------------------------------------------- preferences */
:root.no-hints .df-goal, :root.no-hints .ep-hint, :root.no-hints .w-hint, :root.no-hints .cart-hint { display: none !important; }
:root.calm *, :root.calm *::before, :root.calm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
.settings-box h4 { margin: 6px 0 0; font: 10px var(--pixel); color: var(--mustard); letter-spacing: .08em; }
.settings-slider { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr 44px; align-items: center; gap: 10px; font: 20px var(--term); }
.settings-slider input { width: 100%; accent-color: var(--mustard); min-height: 28px; }
.settings-slider output { text-align: end; opacity: .75; }
.settings-row select { flex: 1 1 200px; min-height: 44px; font: 20px var(--term); background: rgba(30, 26, 43, .95); color: var(--cream); border: 0; box-shadow: inset 0 0 0 1px rgba(246, 231, 200, .25); padding: 0 8px; }
.settings-msg { margin: 0; font: 18px/1.25 var(--term); color: var(--mustard); }
.settings-msg.bad { color: #ff6a5a; }
@media (max-width: 520px) { .settings-slider { grid-template-columns: 1fr 1.6fr 40px; } }

/* ---------------------------------------------------------------- the town (World Expansion 2.0) */
.w-time { width: 40px; height: 40px; font: 18px system-ui, "Segoe UI Symbol", sans-serif; background: rgba(18, 13, 28, .78); color: var(--mustard); border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(246, 231, 200, .25); }
/* a place's own overlays: a flyer up close, a tape in your hands, the ledger, the phone */
.w-ov { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(5, 4, 10, .84); animation: fadein .2s; }
.w-ov-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: min(96vw, 760px); max-height: 92vh; overflow-y: auto; color: var(--cream); }
.w-ov-x { position: absolute; top: calc(10px + var(--safe-t)); right: 12px; width: 44px; height: 44px; background: var(--coral); color: var(--cream); font: 14px var(--pixel); border-radius: 4px; box-shadow: 3px 3px 0 var(--ink); }
.w-ov-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.w-ov-row button { min-height: 44px; padding: 10px 14px 9px; font: 10px var(--pixel); background: #2a2238; color: var(--cream); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(246, 231, 200, .3); }
.w-ov-row button.primary { background: var(--mustard); color: var(--ink); box-shadow: 3px 3px 0 var(--coral); }
.w-inspect canvas { width: min(92vw, 128vh); max-height: 86vh; object-fit: contain; image-rendering: pixelated; box-shadow: 0 0 0 4px #2a1a10, 8px 8px 0 rgba(0, 0, 0, .5); }
.w-inspect .w-ov-box { max-width: 96vw; }
/* the tape: cover / spine / back, flipped with one button (a 2D box, no 3D transform: cheap and readable) */
.tape-case { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 0; width: min(88vw, 340px); background: #0b0b0e; box-shadow: 0 0 0 3px #1b1b1f, 8px 8px 0 rgba(0, 0, 0, .55); }
.tape-front, .tape-back { grid-column: 1; grid-row: 1; aspect-ratio: 9 / 13; }
.tape-front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tape-back { display: none; padding: 14px 14px 12px; background: linear-gradient(#141018, #1f1a28); overflow-y: auto; }
.tape-case.flipped .tape-front { display: none; }
.tape-case.flipped .tape-back { display: block; }
.tape-back h3 { margin: 0 0 8px; font: 12px/1.5 var(--pixel); color: var(--mustard); overflow-wrap: anywhere; }
.tape-back p { margin: 0 0 10px; font: 19px/1.2 var(--term); }
.tape-back .tape-stat { color: #5dff9b; font-size: 18px; margin: 0 0 4px; }
.tape-spine { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0; background: #e9e2cf; color: #1a1414; border-top: 6px solid #b3202a; }
.tape-spine b { font: 10px var(--pixel); }
.tape-spine span { writing-mode: vertical-rl; font: 15px/1 var(--term); overflow: hidden; max-height: 100%; }
.tape-note { margin: 0; max-width: 340px; text-align: center; font: 18px/1.2 var(--term); color: var(--mustard); }
.w-ledger .w-ov-box { width: min(92vw, 480px); padding: 16px 18px; background: #f2ead8; color: #1a1414; box-shadow: 0 0 0 3px #6a4a2a, 8px 8px 0 rgba(0, 0, 0, .5); align-items: stretch; }
.w-ledger h3 { margin: 0; font: 11px/1.5 var(--pixel); color: #b3202a; }
.ledger-list { list-style: none; margin: 0; padding: 0; font: 19px/1.35 var(--term); }
.ledger-list li { border-bottom: 1px dashed rgba(26, 20, 20, .25); opacity: .55; }
.ledger-list li.on { opacity: 1; }
/* the phone booth: the numbers on its card, the playroom's red dial, what the line says */
.w-phone .w-ov-box { gap: 14px; }
.phone-card { padding: 8px 14px 6px; background: #f2ead8; color: #1a1414; box-shadow: 0 0 0 2px #b3202a; font: 19px/1.3 var(--term); }
.phone-card p { margin: 0; display: flex; justify-content: space-between; gap: 18px; }
.w-phone .dial { --s: min(76vw, 52vh, 360px); }
.phone-said { min-height: 2.6em; margin: 0; max-width: min(92vw, 520px); text-align: center; font: 21px/1.2 var(--term); color: #fff; text-shadow: 0 2px 0 #000; }
.w-blank { background: #000; }
/* free throws: shots and baskets, the swinging power bar with its sweet spot */
.w-hoops { position: absolute; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.hp-score { font: 11px var(--pixel); color: #fff; text-shadow: 2px 2px 0 #000; }
.hp-bar { position: relative; width: min(70vw, 320px); height: 14px; background: rgba(10, 8, 16, .8); box-shadow: inset 0 0 0 2px rgba(246, 231, 200, .4); }
.hp-bar i { position: absolute; left: 0; top: 2px; bottom: 2px; background: var(--mustard); }
.hp-bar b { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: #5dff9b; box-shadow: 0 0 8px #5dff9b; }
.hp-hint { font: 17px var(--term); color: var(--cream); opacity: .8; }
:root[dir="rtl"] .hp-bar { direction: ltr; }

/* ---------------------------------------------------------------- Town Life (World Expansion 2.5) */
.w-weather { position: relative; }
.w-weather sup { position: absolute; right: 3px; top: 2px; font: 8px var(--pixel); color: var(--cream); opacity: .8; }
.w-quest { position: absolute; left: 50%; top: calc(104px + var(--safe-t)); transform: translateX(-50%); z-index: 5; max-width: min(92vw, 560px); padding: 5px 12px 4px; font: clamp(16px, 2vw, 19px)/1.15 var(--term); color: var(--mustard); background: rgba(10, 8, 16, .66); border-radius: 3px; pointer-events: none; text-align: center; }
/* a conversation: docked at the bottom, the scene stays visible */
.w-ov-dock { place-items: end center; background: linear-gradient(transparent 45%, rgba(5, 4, 10, .7)); padding-bottom: calc(18px + var(--safe-b)); }
.w-talk .w-ov-box { width: min(94vw, 620px); align-items: stretch; gap: 8px; padding: 12px 16px 14px; background: #1e1a2b; box-shadow: 0 0 0 2px var(--mustard), 5px 5px 0 var(--coral); }
.talk-name { font: 10px var(--pixel); color: var(--mustard); letter-spacing: .06em; }
.talk-line { margin: 0; font: clamp(19px, 2.4vw, 23px)/1.2 var(--term); color: var(--cream); }
.talk-row { justify-content: flex-start; }
/* the notice board: the flyers, then the town's small jobs as pinned cards */
.w-board .w-ov-box { width: min(94vw, 640px); align-items: stretch; padding: 14px 16px; background: #5a3e24; box-shadow: 0 0 0 3px #3a2814, 8px 8px 0 rgba(0, 0, 0, .5); }
.w-board h3 { margin: 0; font: 12px var(--pixel); color: #f2ead8; }
.board-flyers { width: 100%; max-width: 384px; align-self: center; image-rendering: pixelated; }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 10px; }
.board-card { position: relative; padding: 10px 12px 10px; background: #f2ead8; color: #1a1414; box-shadow: 2px 3px 0 rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 4px; }
.board-card::before { content: ''; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #c03030; }
.board-card b { font: 10px/1.5 var(--pixel); color: #b3202a; overflow-wrap: anywhere; }
.board-card p { margin: 0; font: 18px/1.15 var(--term); }
.board-card small { font: 15px var(--term); opacity: .7; }
.board-card em { font: italic 16px var(--term); opacity: .75; }
.board-card button { align-self: flex-start; min-height: 40px; padding: 9px 12px 8px; font: 9px var(--pixel); background: #2a2238; color: var(--cream); border-radius: 3px; }
.board-card button.primary { background: var(--mustard); color: var(--ink); box-shadow: 2px 2px 0 var(--coral); }
.board-card.active { box-shadow: 0 0 0 3px var(--mustard), 2px 3px 0 rgba(0, 0, 0, .35); }
.board-card.done { opacity: .6; }
.board-card.busy button, .board-card.busy em { display: none; }
.w-shelf .w-ov-box { gap: 8px; }
.w-shelf canvas { width: min(88vw, 480px); }
.shop-line { margin: 0; max-width: 480px; text-align: center; font: 20px/1.2 var(--term); color: var(--cream); }

/* ---------------------------------------------------------------- discoveries (World Expansion 3.0) */
.w-disc-btn { color: #7fe0c8; }
.w-disc .w-panel-box { width: min(100%, 640px); }
.w-disc-line { margin: 0 0 4px; font: 20px/1.2 var(--term); }
.w-disc-line.here { color: var(--mustard); font-size: 22px; }
.w-disc-line.task { color: #ffd76a; }
.w-disc-line.dim { opacity: .55; }
.w-disc-notes, .w-disc-people { margin: 0; padding: 0 0 0 18px; font: 19px/1.25 var(--term); }
.w-disc-notes li::marker { content: '✎ '; color: #7fe0c8; }
.w-disc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 14px; }
.w-disc-group b { display: block; margin-bottom: 4px; font: 10px var(--pixel); color: #ff5ad8; letter-spacing: .12em; }
.w-disc-group ul { list-style: none; margin: 0; padding: 0; font: 18px/1.3 var(--term); }
.w-disc-group li { opacity: .45; }
.w-disc-group li.on { opacity: 1; }
.w-disc-group li.here { color: var(--mustard); }

/* ---------------------------------------------------------------- the apartment (World Expansion 3.0) */
/* Deniz's cartridge shelf: one button per KUTU-95 game, your best vs Deniz's */
.w-carts .w-ov-box { width: min(94vw, 560px); align-items: stretch; padding: 14px 16px; background: #1b2238; box-shadow: 0 0 0 2px #2a64b0, 6px 6px 0 #0c1020; }
.w-carts h3, .w-notebook h3 { margin: 0; font: 12px var(--pixel); color: #7fd0ff; text-align: center; }
.w-carts .cart-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; overflow: visible; }
.cart-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 52px; padding: 9px 10px 8px 14px; background: #262a40; color: var(--cream); text-align: start; border-radius: 3px; box-shadow: inset 4px 0 0 var(--c, #ff5ad8), inset 0 0 0 1px rgba(246, 231, 200, .2); }
.cart-btn b { font: 9px/1.4 var(--pixel); color: #fff; }
.cart-btn small { font: 16px var(--term); opacity: .8; }
.cart-btn:hover, .cart-btn:focus-visible { background: #33385a; }
/* Deniz's notebook: the scores to beat */
.w-notebook .w-ov-box { width: min(94vw, 520px); align-items: stretch; padding: 14px 16px; background: #f2ead8; color: #1a1414; box-shadow: 0 0 0 3px #2a64b0, 8px 8px 0 rgba(0, 0, 0, .5); }
.w-notebook h3 { color: #2a64b0; }
.nb-table th { color: #2a64b0; }
.nb-table tr.beat td { text-decoration: line-through; text-decoration-color: rgba(42, 100, 176, .6); }
.nb-table tr.beat td:first-child { text-decoration: none; color: #2f7a4c; }
.w-notebook .shop-line { color: #1a1414; }
/* KÂĞIT UÇAK: the wind arrow and the throw button over the hoops HUD */
.w-plane .pl-wind { display: flex; align-items: center; gap: 8px; padding: 3px 10px 2px; font: 17px var(--term); color: var(--cream); background: rgba(10, 8, 16, .6); border-radius: 3px; }
.w-plane .pl-wind b { display: inline-block; font: 18px system-ui, sans-serif; color: #7fe0c8; transition: transform .2s; }
.pl-throw { pointer-events: auto; min-width: 140px; min-height: 48px; padding: 10px 16px 9px; font: 11px var(--pixel); background: var(--mustard); color: var(--ink); border-radius: 4px; box-shadow: 3px 3px 0 var(--coral); touch-action: none; }
.pl-throw:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--coral); }
:root[dir="rtl"] .w-plane .pl-bar { direction: ltr; }

/* ---------------------------------------------------------------- the entertainment district (World Expansion 4.0) */
/* the map / discoveries panel: two tabs */
.w-disc-tabs { display: flex; gap: 6px; margin: 2px 0 10px; }
.w-disc-tabs button { flex: 1; min-height: 40px; font: 10px var(--pixel); background: #2a2238; color: var(--cream); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(246, 231, 200, .25); }
.w-disc-tabs button.on { background: var(--mustard); color: var(--ink); box-shadow: 3px 3px 0 var(--coral); }
.w-map { display: block; width: 100%; height: auto; aspect-ratio: 540 / 294; border-radius: 3px; box-shadow: 0 0 0 2px #6a5040, 4px 4px 0 rgba(0, 0, 0, .35); margin-bottom: 8px; background: #efe4c8; }
/* the square's notice column */
.w-column .w-ov-box { width: min(94vw, 560px); }
.nb-col { display: flex; flex-direction: column; gap: 8px; }
.nb-card { padding: 8px 10px; background: #f4ecd8; color: #1a1414; border-radius: 2px; box-shadow: 3px 3px 0 rgba(0, 0, 0, .35); }
.nb-card b { display: block; font: 10px var(--pixel); margin-bottom: 4px; color: #8a2a20; }
.nb-card p { margin: 0; font: 19px/1.2 var(--term); }
/* TEBEŞİR: the chalk stones */
.w-chalk .w-ov-box { width: min(96vw, 600px); background: #2a2420; padding: 12px 14px; box-shadow: 0 0 0 2px #8a7a66, 6px 6px 0 rgba(0, 0, 0, .5); }
.w-chalk h3 { margin: 0; font: 12px var(--pixel); color: #f4ecd8; }
.chalk-cv { width: min(88vw, 512px); height: auto; aspect-ratio: 4 / 3; touch-action: none; cursor: crosshair; border-radius: 2px; }
.chalk-pal { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chalk-sw { width: 40px; height: 40px; border-radius: 50%; background: var(--c); color: #2a2420; font: 14px system-ui, sans-serif; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .3); }
.chalk-sw.on { box-shadow: 0 0 0 3px var(--mustard), inset 0 0 0 2px rgba(0, 0, 0, .3); transform: scale(1.08); }
/* YILDIZ's programme */
.w-programme .w-ov-box { width: min(96vw, 640px); }
.cin-prog { display: flex; flex-direction: column; gap: 8px; }
.cin-slot { display: flex; gap: 10px; align-items: flex-start; padding: 6px; background: rgba(0, 0, 0, .25); border-radius: 3px; }
.cin-slot.now { box-shadow: inset 0 0 0 2px var(--mustard); }
.cin-slot canvas { width: 64px; height: 96px; flex: none; image-rendering: pixelated; }
.cin-slot small { display: block; font: 9px var(--pixel); color: var(--mustard); }
.cin-slot b { display: block; margin: 4px 0; font: 21px var(--term); color: #fff; }
.cin-slot p { margin: 0; font: 17px/1.15 var(--term); opacity: .8; }
.w-seat .w-ov-box { width: min(94vw, 560px); }
/* the alley: the film snaps */
.w-static { position: absolute; inset: 0; z-index: 9; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .14) 0 1px, rgba(0, 0, 0, .55) 1px 3px), #3a3a40; animation: w-static .09s steps(2) infinite; }
.w-static.calm { animation: none; background: #1a1a20; opacity: .9; }
@keyframes w-static { 50% { background-position: 0 2px; filter: brightness(1.3); } }
:root[dir="rtl"] .w-disc-tabs { flex-direction: row-reverse; }
/* ---------------------------------------------------------------- World Expansion 4.5: town events & social life */
/* speech bubbles over people's heads (decorative; the talk panel is the accessible way) */
.w-bubble { position: absolute; left: 0; top: 0; z-index: 4; max-width: min(46vw, 300px); padding: 5px 9px; background: #f4ecd8; color: #1a1414; font: 17px/1.15 var(--term); border-radius: 6px; box-shadow: 2px 2px 0 rgba(0, 0, 0, .45); pointer-events: none; transition: opacity .35s; white-space: normal; text-align: center; }
.w-bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #f4ecd8; }
.w-bubble.fade { opacity: 0; }
/* the events board (square, First Street, discovery tab) */
.w-events .w-ov-box { width: min(96vw, 640px); max-height: 86vh; overflow: auto; }
.ev-list { display: flex; flex-direction: column; gap: 8px; }
.ev-card { position: relative; padding: 8px 10px; background: #f4ecd8; color: #1a1414; border-radius: 2px; box-shadow: 3px 3px 0 rgba(0, 0, 0, .35); }
.ev-card.ph-on { box-shadow: 0 0 0 2px #e4572e, 3px 3px 0 rgba(0, 0, 0, .35); }
.ev-card.ph-preparing, .ev-card.ph-waiting { box-shadow: 0 0 0 2px var(--mustard), 3px 3px 0 rgba(0, 0, 0, .35); }
.ev-head { display: flex; gap: 8px; align-items: center; }
.ev-head b { font: 10px var(--pixel); color: #8a2a20; }
.ev-icon { font: 16px system-ui, "Segoe UI Emoji", sans-serif; }
.ev-where { display: block; margin: 2px 0 4px; font: 15px var(--term); color: #6a5040; }
.ev-what, .ev-state, .ev-cast, .ev-held, .ev-note { margin: 2px 0; font: 18px/1.15 var(--term); }
.ev-state { color: #2a4a6a; }
.ev-cast.away { color: #8a4a20; }
.ev-held { color: #3a6a3a; }
.ev-note { font-size: 16px; opacity: .8; }
.ev-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ev-row button { min-height: 40px; }
/* the fair: the stage panel, the dance strip */
.w-fairpanel .w-ov-box { width: min(96vw, 600px); }
.fair-rows { display: flex; flex-direction: column; gap: 6px; }
.fair-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fair-row b { width: 100%; font: 9px var(--pixel); color: var(--mustard); }
.fair-row button { min-height: 40px; flex: 1 1 28%; }
.fair-row button.on { background: var(--mustard); color: var(--ink); box-shadow: 3px 3px 0 var(--coral); }
.w-fair { position: absolute; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); z-index: 6; width: min(96vw, 600px); display: grid; gap: 6px; justify-items: center; }
.fair-cv { width: 100%; height: auto; aspect-ratio: 4 / 1; border-radius: 4px; box-shadow: 0 0 0 2px #8a6a3a, 4px 4px 0 rgba(0, 0, 0, .5); }
.fair-pads { display: flex; gap: 10px; width: 100%; }
.fair-pad { flex: 1; min-height: 56px; font: 22px var(--pixel); background: #2a2238; color: var(--cream); border-radius: 6px; box-shadow: inset 0 0 0 2px rgba(246, 231, 200, .3); touch-action: none; }
.fair-pad:active { background: var(--mustard); color: var(--ink); }
.pad-L { color: #3fb7c9; } .pad-R { color: #efb73e; } .pad-J { color: #ff8a3a; }
.fair-quit { justify-self: end; min-height: 36px; font: 9px var(--pixel); }
/* the arcade cup */
.w-cup .w-ov-box { width: min(96vw, 620px); max-height: 88vh; overflow: auto; }
.cup-line, .cup-note { margin: 4px 0; font: 19px/1.2 var(--term); }
.cup-note.warn { color: #ffb08a; }
.cup-list { display: flex; flex-direction: column; gap: 8px; }
.cup-card { position: relative; display: grid; gap: 2px; padding: 8px 10px; background: #2a2238; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(246, 231, 200, .25); }
.cup-card.locked { opacity: .55; }
.cup-card b { font: 10px var(--pixel); color: var(--mustard); }
.cup-card small { font: 15px var(--term); color: #9fe7ef; }
.cup-card p { margin: 0; font: 17px var(--term); }
.cup-card button { justify-self: start; min-height: 40px; margin-top: 4px; }
.cup-star { position: absolute; right: 10px; top: 6px; font: 18px system-ui, sans-serif; color: #ffd76a; }
.cup-table { width: 100%; border-collapse: collapse; font: 18px var(--term); }
.cup-table th { font: 9px var(--pixel); color: var(--mustard); text-align: start; padding: 4px; }
.cup-table td { padding: 4px; border-top: 1px solid rgba(246, 231, 200, .15); }
.cup-table tr.sum td { border-top: 2px solid var(--mustard); font-weight: bold; }
.cup-verdict { font: 12px/1.5 var(--pixel); margin: 4px 0 8px; }
.cup-verdict.v-win { color: #5dff9b; } .cup-verdict.v-tie { color: #ffd76a; } .cup-verdict.v-lose { color: #ff9a8a; }   /* (not .win: KUTU-95's window class) */
/* PAPATYA's evening: table talk */
.w-tabletalk .w-ov-box { width: min(96vw, 660px); }
.tt-faces { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-face { flex: 1 1 22%; display: grid; gap: 2px; padding: 5px 7px; background: rgba(0, 0, 0, .3); border-radius: 3px; }
.tt-face b { font: 9px var(--pixel); }
.tt-mood { font: 13px system-ui, sans-serif; letter-spacing: 2px; color: #ffd76a; }
.tt-r { font: 15px var(--term); }
.tt-r.love { color: #5dff9b; } .tt-r.like { color: #b8f0a0; } .tt-r.meh { color: #c8c0b0; } .tt-r.sore { color: #ff9a8a; }
.tt-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.tt-cards button { flex: 1 1 30%; min-height: 56px; display: grid; gap: 3px; align-content: center; padding: 6px 8px; text-align: start; background: #2e2640; color: var(--cream); border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(246, 231, 200, .3), 3px 3px 0 rgba(0, 0, 0, .35); }
.tt-cards button:hover, .tt-cards button:focus-visible { background: #3e3456; box-shadow: inset 0 0 0 2px var(--mustard), 3px 3px 0 var(--coral); }
.tt-card b { font: 9px var(--pixel); }
.tt-card small { font: 15px var(--term); opacity: .85; }
.tt-warn { color: #ffb08a; }
.tt-turn { align-self: center; font: 9px var(--pixel); opacity: .8; }
:root[dir="rtl"] .cup-star { right: auto; left: 10px; }
@media (max-width: 560px) { .tt-cards button { flex-basis: 100%; } .fair-row button { flex-basis: 45%; } }
/* ---------------------------------------------------------------- World Expansion 5.0: the Hidden Town */
.w-httape .w-ov-box, .w-htlisten .w-ov-box { width: min(96vw, 560px); align-items: center; }
.ht-tape { width: min(88vw, 480px); height: auto; aspect-ratio: 4 / 3; border-radius: 4px; box-shadow: 0 0 0 3px #1a1414, 4px 4px 0 rgba(0, 0, 0, .5); background: #000; }
.ht-jog { width: min(88vw, 480px); accent-color: var(--mustard); }
.ht-row { flex-wrap: wrap; justify-content: center; }
.ht-row button { min-height: 40px; min-width: 52px; }
.ht-line { min-height: 2.4em; text-align: center; }
.ht-scope { width: min(88vw, 480px); height: auto; aspect-ratio: 32 / 15; border-radius: 3px; box-shadow: 0 0 0 2px #2a4a2a; }
.ht-speeds { justify-content: center; }
.ht-speeds button { flex: 0 0 64px; min-height: 40px; }
.ht-speeds button.on { background: var(--mustard); color: var(--ink); }
.ht-desc { margin: 0; font: 15px/1.2 var(--term); color: #b8f0c8; text-align: center; }
.w-htpuddle .w-ov-box { max-width: min(94vw, 520px); }
.ht-puddle { width: min(88vw, 480px); height: auto; aspect-ratio: 8 / 5; border-radius: 50% / 40%; box-shadow: 0 0 0 4px #2a2a30; }
.w-htfinal .w-ov-box { width: min(96vw, 600px); }
.ht-final { width: 100%; height: auto; aspect-ratio: 48 / 11; border-radius: 3px; }
.ht-lever { min-width: 160px; min-height: 56px; font: 11px var(--pixel); background: #3a2a1a; color: var(--cream); border-radius: 6px; box-shadow: inset 0 0 0 2px #8a6a3a; touch-action: none; }
.ht-lever.on { background: #5dff9b; color: #0a1a0e; }
.w-htfilm .w-ov-box { align-items: center; }
.ht-film { width: min(90vw, 560px); height: auto; aspect-ratio: 4 / 3; background: #000; }
.ht-cap { min-height: 2.6em; margin: 6px 0 0; font: 20px/1.25 var(--term); color: var(--cream); text-align: center; max-width: min(90vw, 560px); }
.ht-skip { min-height: 36px; font: 9px var(--pixel); }
.ht-cards { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.ht-card { padding: 7px 9px; background: #efe4c8; color: #1a1414; border-radius: 2px; box-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.ht-card b { display: block; font: 9px var(--pixel); color: #6a2418; margin-bottom: 3px; }
.ht-card p { margin: 2px 0; font: 17px/1.2 var(--term); }
.ht-card.dim { background: #d8d0bc; }
.ht-q { background: #1e1a2b; color: var(--cream); box-shadow: 0 0 0 2px var(--mustard); }
.ht-q b { color: var(--mustard); }
.ht-q button { display: block; width: 100%; margin-top: 6px; min-height: 40px; text-align: start; }
.ht-warn { color: #ffb08a !important; }
.ht-open { background: #2a2238; color: var(--cream); }
.ht-open b { color: #c8b8ff; }
.ht-hint { color: #9fe7ef; }
.ht-kutu { display: grid; gap: 6px; padding: 6px; }
.ht-kutu canvas { width: 100%; height: auto; image-rendering: pixelated; background: #000; }
.ht-knob { width: 100%; }
.ht-log { max-height: 120px; overflow: auto; font-size: 15px; }

/* 5.5 — The Hidden Town, chapter two: viewfinder (rephotography), sign-off / viewfinder buttons, tapes, tripod, journal pages */
.h2-hud { position: absolute; top: calc(136px + var(--safe-t)); inset-inline-end: 16px; z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: calc(100% - 32px); }   /* clear of the prompt and the spoken line, below the achievement toasts; opposite the viewfinder card */
.h2-hudbtn { font: clamp(16px, 2vw, 20px)/1.1 var(--term); padding: 8px 14px; color: #ffd76a; background: rgba(14, 12, 22, .86); border: 2px solid #ffd76a; border-radius: 4px; cursor: pointer; }
.h2-hudbtn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.h2-rephoto { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.h2-ghost { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.h2-card { position: absolute; top: calc(56px + var(--safe-t)); inset-inline-start: 16px; width: min(260px, calc(100% - 32px)); padding: 8px 10px; color: #f4ecd8; background: rgba(12, 10, 18, .9); border: 2px solid #ffd76a; border-radius: 4px; pointer-events: auto; font: 16px/1.2 var(--term); }
.h2-card b { display: block; margin-inline-end: 30px; }
.h2-thumb { display: block; width: 100%; height: auto; margin: 6px 0; image-rendering: pixelated; }
.h2-meter { position: relative; height: 12px; background: #2a2430; border: 1px solid #5a5060; }
.h2-meter i { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: #5dff9b; }
.h2-meter span { position: absolute; inset-inline-end: 4px; top: -2px; font-size: 12px; color: #fff; }
.h2-line { margin: 6px 0 0; }
.h2-x { position: absolute; top: 4px; inset-inline-end: 4px; min-width: 32px; min-height: 32px; color: #fff; background: #3a3040; border: 0; border-radius: 3px; cursor: pointer; }
.h2-tape { display: block; width: 100%; max-width: 480px; height: auto; margin: 0 auto 8px; image-rendering: pixelated; background: #000; }
.h2-tabs { margin-bottom: 8px; }
.h2-sub { display: block; margin: 10px 0 4px; }
.h2-board .h2-row { padding: 6px 0; border-top: 1px dashed rgba(255, 255, 255, .18); }
.h2-board select { max-width: 100%; margin: 2px 6px 2px 0; padding: 4px; font: inherit; }
.h2-hyp { margin: 0 0 4px; font-weight: bold; }
.h2-ok { margin: 4px 0 0; color: #5dff9b; }

/* 6.0 — the Old Station: MAKASÇI (docked: the yard stays in view) and ATÖLYE (the pegboard) */
.w-stmk .w-ov-box { max-width: min(420px, calc(100vw - 32px)); }
.st-yard { display: block; width: 100%; max-width: 240px; height: auto; margin: 4px auto; image-rendering: pixelated; border: 2px solid #3a3a30; }
.st-levels, .st-switches, .st-tray { flex-wrap: wrap; justify-content: center; gap: 6px; }
.st-levels button { min-width: 44px; }
.st-sw { min-width: 88px; }
.st-sw[aria-pressed="true"] { background: #6a4a1a; color: #ffd76a; }
.st-line { min-height: 2.4em; }
.st-board { display: block; width: 100%; max-width: 440px; height: auto; margin: 4px auto; image-rendering: pixelated; touch-action: none; cursor: pointer; }
.st-tool { min-width: 64px; }
/* MAKASÇI docks to the side (the yard and the cart stay in view); on narrow screens it goes to the bottom */
.w-ov-dock.w-stmk { place-items: center start; background: linear-gradient(90deg, rgba(5, 4, 10, .55), transparent 45%); padding: 64px 16px calc(18px + var(--safe-b)); }
.w-stmk .w-ov-box { max-height: calc(100vh - 90px); overflow: auto; }
@media (max-width: 720px) { .w-ov-dock.w-stmk { place-items: end center; background: linear-gradient(transparent 40%, rgba(5, 4, 10, .7)); } .w-stmk .st-yard { max-width: 160px; } }
/* 6.5 SEVKİYAT (docked like MAKASÇI), the stage lights' panel, the town projects on the boards */
.w-sv .w-ov-box { max-width: min(460px, calc(100vw - 32px)); }
.w-sv .sv-canvas { max-width: 300px; }
.sv-intro { margin: 2px 0 4px; font-size: .78em; line-height: 1.45; opacity: .9; }
.sv-here, .sv-go { flex-wrap: wrap; justify-content: center; gap: 5px; }
.sv-crate, .sv-stop { border-inline-start: 6px solid #ccc; font-size: .72em; padding-inline: 8px; }
.sv-none { font-size: .74em; opacity: .7; }
.sv-meter { margin: 2px 0; font-size: .74em; text-align: center; opacity: .85; }
.w-sl .sl-map { display: block; width: 100%; max-width: 280px; height: auto; margin: 4px auto; image-rendering: pixelated; border: 2px solid #3a3a30; }
.pr-head { margin: 14px 0 4px; font-weight: bold; letter-spacing: .08em; color: #1e8a8a; }
.pr-card.pr-active { border-color: #1e8a8a; }
.pr-card.pr-done { opacity: .85; }
.pr-steps { margin: 4px 0 0; padding: 0; list-style: none; font-size: .78em; line-height: 1.6; }
.pr-steps li.done { opacity: .6; }
.pr-steps li.now { color: #1e8a8a; font-weight: bold; }
@media (max-width: 720px) { .w-sv .sv-canvas { max-width: 220px; } .w-sl .sl-map { max-width: 220px; } }

/* Web Launch 0.1: a place on its way over a slow network, or one that did not arrive */
.w-loading { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); z-index: 21; font: 11px/1.6 var(--pixel); color: var(--cream, #f3e9d2); letter-spacing: .08em; pointer-events: none; animation: w-pulse 1.2s ease-in-out infinite alternate; }
@keyframes w-pulse { from { opacity: .35; } to { opacity: 1; } }
.w-loadfail { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 22; width: min(92vw, 460px); padding: 22px 20px; text-align: center; background: #120d1c; border: 2px solid #6b5a8a; box-shadow: 0 0 0 4px #000; color: #fff; }
.w-loadfail p { margin: 0 0 16px; font: clamp(19px, 2.4vw, 22px)/1.25 var(--term); }
.w-loadfail button { margin: 4px 6px; padding: 10px 14px; font: 10px var(--pixel); color: #fff; background: #2a2140; border: 2px solid #8d7bb0; cursor: pointer; }
.w-loadfail button.primary { background: #b3202a; border-color: #ff6b6b; }
.w-loadfail button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
