/* Scope every rule so the shared asset helper cannot affect other pages. */
.oma-game-page { color-scheme: light; }
.oma-game-page, .oma-game-page * { box-sizing: border-box; }
.oma-game-page { margin: 0; background: #fdf6e3; color: #4a3b32; font-family: "Trebuchet MS", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.oma-game { max-width: 1320px; margin: auto; padding: 0 28px; }
.oma-game button, .oma-game input { font: inherit; }
.oma-game button, .oma-game a, .oma-game summary, .game-duration label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.oma-game button { cursor: pointer; }
.oma-game button:disabled { cursor: default; opacity: .55; }
.oma-game :focus-visible { outline: 3px solid #ad1e1c; outline-offset: 4px; }
.oma-game [hidden] { display: none !important; }

/* Page around the game */
.game-header { height: 96px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #4a3b321c; gap: 20px; }
.game-brand img { display: block; width: 150px; height: auto; }
.game-secret { color: #8a7662; font-size: 12px; letter-spacing: .06em; }
.game-secret > span { display: inline-block; width: 6px; height: 6px; background: #b6382e; border-radius: 50%; margin: 0 8px 2px 0; }
.game-back { color: #6e5947; text-decoration: none; font-size: 13px; font-weight: bold; }
.game-back:hover { color: #d00000; }
.game-intro { display: flex; align-items: center; justify-content: space-between; padding: 28px 0 24px; gap: 24px; }
.game-eyebrow { font-size: 11px; letter-spacing: .15em; font-weight: bold; margin: 0 0 10px; color: #917862; }
.game-intro h1 { font-family: Georgia, serif; font-size: clamp(34px, 3.4vw, 49px); font-weight: normal; letter-spacing: -.05em; margin: 0; line-height: 1.1; }
.game-intro h1 em { color: #c82b23; font-weight: normal; }
.game-intro > p { margin: 15px 0 0; font-size: 15px; line-height: 1.7; color: #7d644c; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.game-sidebar { display: grid; gap: 16px; }
.game-menu-card { background: #fffcf4; padding: 25px 23px 0; border: 1px solid #e3d5bd; border-radius: 14px; position: relative; }
.game-menu-card::before { content: ""; position: absolute; top: -6px; left: calc(50% - 22px); width: 44px; height: 12px; background: #dbc9a7a8; transform: rotate(-3deg); }
.game-menu-card h2 { font: normal 24px Georgia, serif; margin: 0; letter-spacing: -.04em; }
.game-menu-note { font: italic 14px Georgia, serif; color: #a68c71; margin: 7px 0 18px; }
.game-menu-list { padding: 0; list-style: none; margin: 0; }
.game-menu-list li { display: flex; gap: 10px; align-items: center; padding: 15px 0; border-top: 1px dashed #e2d2b8; opacity: .5; transition: opacity .2s; }
.game-menu-list li.is-current, .game-menu-list li.is-complete { opacity: 1; }
.game-course-number { align-self: flex-start; color: #bba789; font: italic 17px Georgia, serif; padding-top: 1px; }
.game-menu-list small { display: block; font-size: 10px; letter-spacing: .11em; margin-bottom: 5px; color: #a48667; }
.game-menu-list strong { display: block; font-size: 14px; }
.game-menu-list div > span { display: block; font-size: 12px; color: #a48e76; margin-top: 5px; }
.game-menu-list b { margin-left: auto; font-size: 19px; color: #c22e27; font-weight: normal; }
.game-menu-list .is-complete b { color: #66804b; }
.game-menu-bottom { border-top: 1px dashed #e2d2b8; padding: 13px 0; margin: 0; text-align: center; font: italic 12px Georgia, serif; color: #9e8265; }
.game-golden-tip { display: flex; gap: 13px; align-items: center; padding: 1px 9px; color: #a58958; }
.game-golden-tip > span { font-size: 29px; }
.game-golden-tip p { font-size: 13px; line-height: 1.7; margin: 0; }
.game-golden-tip strong { display: block; font-size: 14px; color: #806241; }
.game-golden-tip b { font-weight: normal; color: #876023; }
.game-help { font-size: 13px; color: #8d7458; line-height: 1.7; padding: 0 5px; }
.game-help summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.game-help p { margin: 10px 0; }
.game-footer { display: flex; justify-content: space-between; gap: 20px; font-size: 11px; color: #b09b80; padding: 24px 0; }
.game-footer strong { color: #968063; font-weight: normal; }
.game-noscript { padding: 20px; background: #ffebe0; border: 1px solid #b12c22; }

/* The stage: a 3D scene with overlays. During a round it fills the whole window. */
.game-stage { position: relative; height: clamp(460px, 70dvh, 720px); border: 1px solid #e3d4bb; border-radius: 18px; overflow: hidden; background: #eee3ce; box-shadow: 0 12px 35px #73552b0d; }
.game-scene { position: absolute; inset: 0; }
.game-scene canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.oma-game.is-running .game-stage { position: fixed; inset: 0; z-index: 50; height: auto; border: 0; border-radius: 0; box-shadow: none; }
html:has(.oma-game.is-running), .oma-game-page:has(.oma-game.is-running) { overflow: hidden; overscroll-behavior: none; }
.oma-game.is-running { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Top overlay: clock, score, tray and shout ticker */
.game-top { position: absolute; top: 0; left: 0; right: 0; z-index: 4; pointer-events: none; }
.game-hud { display: flex; align-items: center; gap: 26px; padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); background: linear-gradient(#fffbf2f5, #fffbf2e0); }
.game-hud-label { display: block; font-size: 10px; font-weight: bold; letter-spacing: .08em; color: #806748; margin-bottom: 3px; }
.game-hud strong { font-size: 28px; font-variant-numeric: tabular-nums; letter-spacing: -.04em; font-weight: normal; }
.game-time strong { color: #c62c24; }
.game-tools { display: flex; gap: 8px; margin-left: auto; align-items: center; pointer-events: auto; }
.game-icon-button { border: 1px solid #e6d8bf; border-radius: 50%; width: 44px; height: 44px; background: #fffdf5; color: #795f48; font-size: 19px !important; }
.game-sound-button { background: #f7ead1; color: #854a31; border: 1px solid #d9c19b; border-radius: 8px; padding: 10px 12px; min-height: 44px; white-space: nowrap; font-size: 14px !important; }
.game-sound-button[aria-pressed="false"] { background: #eee7d7; color: #816f59; }
.game-volume { display: flex; flex-direction: column; gap: 4px; color: #7e6449; font-size: 11px; margin: 0 6px; }
.game-volume input { width: 86px; height: 18px; accent-color: #bd3426; cursor: pointer; }
.game-clock-track { height: 5px; background: #f0e5d1; }
.game-clock-track > div { height: 100%; background: #c43128; width: 100%; transition: width .3s linear; }
.game-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
.game-tray { display: flex; gap: 6px; }
.game-slot { min-width: 84px; padding: 7px 10px; border: 2px dashed #d8c8ab; border-radius: 10px; background: #fffbf1d9; color: #9b866b; font-size: 13px; text-align: center; white-space: nowrap; }
.game-slot.is-filled { border: 2px solid #d6bd8b; background: #fff3d9; color: #6a4a2a; font-weight: bold; }
.game-slot.is-next { border-color: #c44130; }
.game-combo { padding: 7px 12px; border-radius: 20px; background: #fffbf1d9; border: 1px solid #e0cba9; color: #7d5f3d; font-size: 13px; white-space: nowrap; }
.game-combo.is-hot { background: #ffe8b8; border-color: #e1ab35; color: #8a4f0c; font-weight: bold; }
.game-combo:empty { display: none; }

/* Speech bubbles projected over the 3D guests */
.game-markers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.game-leaders { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.game-leaders line { stroke: #967553; stroke-width: 1.3; stroke-dasharray: 3 3; opacity: .75; }
.game-leaders line.is-angry { stroke: #bc392b; stroke-width: 2; }
.game-marker { position: absolute; transform: translate(-50%, -100%); min-width: 130px; border: 1px solid #a02921; background: #bb3026; color: white; border-radius: 10px; padding: 8px 14px; font-weight: bold; font-size: 14px; white-space: nowrap; box-shadow: 0 4px 10px #65442622; }
.game-marker::after { content: ""; position: absolute; left: calc(50% - 5px); bottom: -6px; width: 10px; height: 10px; background: inherit; transform: rotate(45deg); }
.game-marker span { display: block; font-weight: normal; font-size: 12px; color: #ffdeca; margin-top: 3px; }
.game-guest-marker { position: absolute; transform: translate(-50%, -100%); width: 184px; height: 88px; padding: 8px 10px 14px; border: 2px solid #dac6a4; border-radius: 10px; background: #fffcf3; color: #624731; box-shadow: 0 4px 12px #63442922; }
.game-guest-marker::after { content: ""; position: absolute; bottom: -7px; left: calc(50% - 5px); width: 10px; height: 10px; transform: rotate(45deg); background: inherit; border-bottom: 2px solid #dac6a4; border-right: 2px solid #dac6a4; }
.game-order-icon { float: left; font-size: 28px; margin-right: 8px; line-height: 1.1; }
.game-guest-marker strong { display: block; font-size: 13px; line-height: 19px; }
.game-guest-marker small { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.3; padding-top: 3px; }
.game-guest-marker i { position: absolute; left: 10px; right: 10px; bottom: 5px; height: 4px; background: #eadfc7; border-radius: 3px; overflow: hidden; }
.game-guest-marker i b { display: block; height: 100%; background: #84975b; }
.game-guest-marker.is-urgent i b { background: #c43e2d; }
.game-guest-marker.is-target { border-color: #e1ab35; box-shadow: 0 0 0 3px #e1ab3555, 0 4px 12px #63442922; }
.game-guest-marker.is-grumble { border-color: #d29b3b; background: #fff8e6; }
.game-guest-marker.is-loud { border-color: #bd382c; background: #fff0e5; color: #9b2f25; animation: game-wobble .5s ease-in-out infinite; }
.game-guest-marker.is-angry { border-color: #bd382c; background: #fff0e5; color: #a02c23; }
.game-guest-marker.is-angry i { display: none; }
.game-guest-marker.is-grumble strong, .game-guest-marker.is-loud strong, .game-guest-marker.is-angry strong { display: none; }
.game-guest-marker.is-grumble small, .game-guest-marker.is-loud small, .game-guest-marker.is-angry small { font-size: 13px; line-height: 1.25; padding-top: 0; }
.game-guest-marker.is-loud small, .game-guest-marker.is-angry small { font-weight: bold; }
.game-guest-marker.is-loud::after, .game-guest-marker.is-angry::after { border-color: #bd382c; }
.game-guest-marker.is-grumble::after { border-color: #d29b3b; }
.game-edge { display: none; position: absolute; top: -11px; right: -11px; width: 24px; height: 24px; border-radius: 50%; background: #c62e23; color: #fff; font-style: normal; font-size: 12px; line-height: 24px; text-align: center; }
.is-edge { transform: translate(-50%, -50%) !important; animation: none !important; }
.is-edge::after { display: none; }
.is-edge .game-edge { display: block; }
@keyframes game-wobble { 0%, 100% { transform: translate(-50%, -100%) rotate(0); } 25% { transform: translate(-50%, -100%) rotate(-2.5deg); } 75% { transform: translate(-50%, -100%) rotate(2.5deg); } }
@keyframes game-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

/* Compact scenes (phones): icon bubbles plus a ticker for the full shout */
.game-stage.is-compact .game-guest-marker { width: 108px; height: 46px; padding: 5px 7px 11px; }
.game-stage.is-compact .game-order-icon { font-size: 24px; margin-right: 6px; }
.game-stage.is-compact .game-guest-marker strong { font-size: 12px; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-stage.is-compact .game-guest-marker small { display: none; }
.game-stage.is-compact .game-guest-marker.is-grumble strong, .game-stage.is-compact .game-guest-marker.is-loud strong, .game-stage.is-compact .game-guest-marker.is-angry strong { display: block; }
.game-stage.is-compact .game-guest-marker i { left: 7px; right: 7px; bottom: 4px; }
.game-stage.is-compact .game-marker { min-width: 100px; padding: 6px 10px; font-size: 13px; }
.game-shout { display: none; margin: 8px max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); align-items: center; gap: 9px; padding: 9px 13px; border-radius: 14px; background: #fff3e6; border: 2px solid #bd382c; color: #8f261c; font-size: 15px; line-height: 1.3; box-shadow: 0 6px 20px #6b2a1f30; opacity: 0; transform: translateY(-6px); transition: opacity .18s, transform .18s; }
.game-shout.is-visible { opacity: 1; transform: none; }
.game-shout[data-tier="1"] { border-color: #d29b3b; background: #fff8e6; color: #74501a; }
.game-shout[data-tier="3"].is-visible { animation: game-shake .4s; }
.game-shout-face { font-size: 27px; line-height: 1; }
.game-shout b { white-space: nowrap; }
.game-stage.is-compact .game-shout { display: flex; }

/* Touch controls: floating stick on the left, jump on the right half */
.game-pad { position: absolute; inset: 0; z-index: 3; touch-action: none; pointer-events: none; }
.oma-game.is-running .game-pad { pointer-events: auto; }
.game-stick { position: absolute; width: 116px; height: 116px; margin: -58px 0 0 -58px; border-radius: 50%; border: 3px solid #fffbf2cc; background: #4a3b3230; opacity: 0; transition: opacity .12s; pointer-events: none; }
.game-stick.is-active { opacity: 1; }
.game-stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: #fffbf2; box-shadow: 0 3px 10px #4a3b3244; }
.game-jump-hint { display: none; position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: calc(26px + env(safe-area-inset-bottom)); width: 92px; height: 92px; border-radius: 50%; background: #fffbf2b8; border: 3px solid #fffbf2; color: #8f261c; font-weight: bold; font-size: 17px; line-height: 86px; text-align: center; box-shadow: 0 4px 14px #4a3b3233; transition: transform .08s, background .08s; }
.game-jump-hint.is-pressed { transform: scale(.9); background: #ffe1a8; }
.oma-game.is-running .game-jump-hint { display: block; }
@media (hover: hover) and (pointer: fine) { .oma-game.is-running .game-jump-hint { display: none; } }
/* Keep messages clear of the thumbs on touch screens */
@media (hover: none) and (pointer: coarse) { .game-toast { bottom: calc(132px + env(safe-area-inset-bottom)); } }

.game-toast { position: absolute; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); z-index: 4; width: max-content; max-width: min(640px, calc(100% - 24px)); padding: 12px 20px; border-radius: 30px; background: #fff9ed; border: 1px solid #dcc39e; box-shadow: 0 6px 30px #73562a30; color: #ba3327; font-size: 16px; font-weight: bold; line-height: 1.4; text-align: center; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.game-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.game-loading { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 35px; background: #eee3ce; z-index: 6; font: 20px Georgia, serif; }

/* Ready, pause and result card */
.game-overlay { position: absolute; inset: 0; background: #4a392b66; backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; padding: 16px; z-index: 7; overflow-y: auto; }
.game-result-card { background: #fffaec; border: 1px solid #fff9e9; border-radius: 16px; width: min(100%, 440px); max-height: 100%; overflow-y: auto; overflow-x: hidden; padding: 26px 26px 20px; text-align: center; box-shadow: 0 15px 70px #3e291c44; margin: auto; }
.game-result-icon { color: #c52e26; font: 38px Georgia, serif; display: block; margin-bottom: 8px; }
.game-result-card h2 { font: 30px Georgia, serif; letter-spacing: -.04em; margin: 0; }
.game-result-text { color: #907659; font-size: 15px; line-height: 1.7; margin: 14px 0 6px; white-space: pre-line; }
.game-result-text:empty { display: none; }
.game-howto { list-style: none; margin: 14px 0 4px; padding: 0; text-align: left; font-size: 14px; line-height: 1.5; color: #7a6048; }
.game-howto li { padding: 6px 0; border-top: 1px dashed #e2d2b8; }
.game-howto b { color: #5f452f; }
.game-touch-only { display: none; }
@media (hover: none) and (pointer: coarse) { .game-touch-only { display: inline; } .game-keys-only { display: none; } }
.game-duration { display: flex; gap: 7px; margin: 16px 0 14px; padding: 0; border: 0; min-width: 0; }
.game-duration legend { font-size: 12px; margin: 0 auto 8px; padding: 0; color: #8c7155; }
.game-duration label { flex: 1 1 0; min-width: 0; cursor: pointer; position: relative; }
.game-duration input { position: absolute; top: 0; left: 0; opacity: 0; width: 100%; height: 100%; margin: 0; }
.game-duration label > span { display: block; text-align: center; border: 1px solid #dfccb0; border-radius: 8px; padding: 10px 3px; font-size: 15px; color: #80664e; }
.game-duration small { display: block; font-size: 10px; margin-top: 3px; color: #a58b6e; }
.game-duration input:checked + span { background: #fffbf2; border-color: #c63a2c; color: #ba3026; }
.game-duration input:focus-visible + span { outline: 2px solid #b32a21; outline-offset: 2px; }
.game-duration:disabled { opacity: .6; }
.game-primary { width: 100%; min-height: 52px; color: #fff9ed; background: #c62e23; border: 1px solid #b6241b; border-bottom-width: 3px; border-radius: 8px; padding: 13px 16px; font-weight: bold !important; font-size: 17px !important; transition: background .2s, transform .2s; }
.game-primary:hover:not(:disabled) { background: #ae251c; transform: translateY(-1px); }
.game-secondary { width: 100%; min-height: 46px; margin-top: 10px; background: transparent; color: #b6241b; border: 1px solid #d9b9a0; border-radius: 8px; padding: 10px 16px; font-weight: bold !important; font-size: 15px !important; }
.game-secondary:hover { background: #fff1e0; }
.game-tertiary { margin-top: 8px; background: none; border: 0; color: #8c7155; font-size: 14px !important; padding: 10px; text-decoration: underline; }
.game-record { display: flex; gap: 5px; justify-content: center; margin: 12px 0 0; color: #a48c6d; font-size: 13px; }
.game-record strong { color: #7b6147; }

/* Tablets and phones: one column, the stage first */
@media (max-width: 900px) {
  .oma-game { padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); }
  .game-layout { grid-template-columns: 1fr; gap: 18px; }
  .game-header { height: 64px; }
  .game-brand img { width: 118px; }
  .game-secret { display: none; }
  .game-intro { padding: 16px 4px 14px; }
  .game-intro h1 { font-size: 34px; }
  .game-intro > p { display: none; }
  .game-stage { height: min(78dvh, 640px); }
  .game-volume { display: none; }
  .game-hud { gap: 14px; }
  .game-hud strong { font-size: 24px; }
  .game-hud-label { font-size: 9px; letter-spacing: .05em; }
  .game-result-card { padding: 20px 18px 16px; }
  .game-result-card h2 { font-size: 26px; }
  .game-footer > span:last-child { display: none; }
}
@media (max-width: 420px) {
  .game-hud { gap: 11px; }
  .game-slot { min-width: 0; padding: 6px 8px; font-size: 12px; }
  .game-sound-button { padding: 8px 9px; }
}
/* Landscape phones: a short stage needs tighter chrome */
@media (orientation: landscape) and (max-height: 520px) {
  .game-hud { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 4px; }
  .game-hud strong { font-size: 21px; }
  .game-hud-label { margin-bottom: 1px; }
  .game-icon-button { width: 40px; height: 40px; min-height: 40px; }
  .game-sound-button { min-height: 40px; padding: 6px 9px; }
  .game-sub { padding-top: 5px; }
  .game-slot { padding: 4px 8px; }
  .game-combo { padding: 4px 10px; }
  .game-jump-hint { width: 76px; height: 76px; line-height: 70px; bottom: 16px; }
  .game-toast { bottom: 12px; padding: 8px 14px; font-size: 14px; }
  .game-result-card { padding: 14px 18px 12px; }
  .game-result-icon { display: none; }
  .game-result-card h2 { font-size: 22px; }
  .game-howto { display: none; }
  .game-duration { margin: 8px 0; }
  .game-duration label > span { padding: 6px 3px; }
  .game-primary { min-height: 44px; padding: 8px 16px; }
}
@media (prefers-reduced-motion: reduce) { .oma-game *, .oma-game *::before, .oma-game *::after { transition: none !important; animation: none !important; } }
