:root { color-scheme: light; color: #222; background: #fff; font-family: 'Comic Sans MS', 'Chalkboard SE', cursive; }
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overscroll-behavior: none; overflow: hidden; -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
button { color: inherit; font: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 2px dashed #777; outline-offset: 6px; }
.game { display: flex; flex-direction: column; align-items: center; width: 100%; height: 100%; height: 100dvh; padding: max(18px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom)); }
.logo { flex: 0 0 auto; width: clamp(205px, 25vw, 285px); max-width: 70vw; margin: 0; padding: 0; border: 0; background: transparent; color: #161616; }
.logo svg { display: block; width: 100%; height: auto; overflow: visible; }
.stage { --bubble-space: 70px; flex: 1 1 auto; min-height: 0; position: relative; width: min(100%, 760px); max-height: 690px; }
#oliver { display: block; width: 100%; height: 100%; background: transparent; border: 0; outline: none; touch-action: none; }
.milk { position: absolute; z-index: 2; right: 12%; bottom: 16px; width: clamp(72px, 14vw, 100px); padding: 0; border: 0; background: transparent; transform-origin: 50% 15%; }
.milk svg { display: block; width: 100%; height: auto; overflow: visible; }
.milk:not(:disabled):hover { transform: rotate(-7deg); }
.milk:disabled { cursor: default; }
.milk-label { position: absolute; top: 45%; left: 20%; width: 60%; max-height: 34%; overflow: hidden; padding: 2px; background: #fffdf5; border: 1px solid #d2c7ad; border-radius: 3px; color: #3d6880; font-size: clamp(10px, 2vw, 14px); font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; transform: rotate(-3deg); }
.milk-liquid { transform-box: view-box; transform-origin: 50px 127px; transform: scaleY(var(--milk-fill, 1)); }
.speech { position: absolute; z-index: 1; top: 16px; left: 50%; width: 224px; padding: 15px 20px; pointer-events: none; }
.speech-outline { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.speech-outline path { fill: #fff; stroke: #282622; stroke-width: 2; stroke-linejoin: round; }
.speech p { position: relative; margin: 0; text-align: center; font-size: 18px; font-weight: 600; line-height: 1.3; }
.game-footer { flex: 0 0 auto; display: flex; justify-content: center; width: 100%; margin-top: 8px; font-family: ui-sans-serif, system-ui, sans-serif; }
#restart { padding: 8px 16px; font-size: 12px; border: 0; background: transparent; color: #888; }
#restart:hover { color: #111; }
.loading, .load-error { position: absolute; left: 0; right: 0; top: 50%; text-align: center; font-family: system-ui, sans-serif; font-size: 13px; color: #777; line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (max-width: 740px) {
  .milk { right: 1%; }
  .game { padding-top: max(13px, env(safe-area-inset-top)); }
  .logo { width: 218px; }
  .stage { --bubble-space: 105px; }
  .speech { width: min(252px, 92%); padding: 13px 20px; }
  .speech p { font-size: 17px; }
}
@media (max-height: 500px) and (min-width: 601px) {
  .game { padding-top: 4px; padding-bottom: 4px; }
  .logo { width: 165px; }
  .stage { --bubble-space: 70px; }
  .speech { width: 185px; padding: 12px 18px; }
  .speech p { font-size: 15px; }
  .game-footer { margin-top: 0; }
}


.admin-open { position: fixed; z-index: 4; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); display: grid; place-items: center; width: 36px; height: 36px; padding: 7px; color: #999; border: 0; border-radius: 50%; background: #fff; }
.admin-open:hover { color: #222; background: #f3f3f3; }
.admin-open svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.admin-dialog { position: fixed; width: min(360px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); margin: auto; padding: 28px; border: 1.5px solid #333; border-radius: 18px; background: #fff; color: #222; font-family: ui-sans-serif, system-ui, sans-serif; overflow: auto; user-select: text; -webkit-user-select: text; }
.admin-dialog::backdrop { background: #0005; }
.admin-dialog h1 { margin: 0 22px 22px 0; font-size: 21px; line-height: 1.25; }
.admin-close { position: absolute; top: 7px; right: 9px; width: 36px; height: 36px; padding: 0; border: 0; background: none; font-size: 26px; color: #777; }
.admin-dialog label { display: block; margin: 16px 0 7px; font-size: 14px; font-weight: 600; }
.admin-dialog input { width: 100%; min-height: 44px; border: 1px solid #bbb; border-radius: 8px; padding: 10px 12px; background: #fff; color: #222; font: 16px ui-sans-serif, system-ui, sans-serif; }
.admin-dialog input:focus { outline: 2px solid #416f88; outline-offset: 2px; }
.admin-primary { display: block; width: 100%; margin-top: 20px; min-height: 44px; padding: 11px; border: 0; border-radius: 8px; background: #292721; color: white; font-size: 15px; }
.admin-primary:disabled { opacity: .6; cursor: wait; }
.admin-hint, .admin-message { font-size: 13px; line-height: 1.5; color: #666; }
.admin-message { min-height: 20px; margin: 16px 0 0; }
.admin-logout { display: block; margin: 12px auto 0; border: 0; padding: 8px 12px; background: none; color: #666; font-size: 13px; }

.scores { position: absolute; top: 130px; left: max(20px, calc(50% - 600px)); width: 210px; font-size: 15px; line-height: 1.4; }
.scores p { margin: 0 0 10px; }
.all-time { font-size: 13px; font-weight: 700; }
#all-time-hits { display: block; margin-top: 2px; font-size: 26px; font-variant-numeric: tabular-nums; min-height: 36px; }
#player-form { display: flex; align-items: center; margin: 14px 0 24px; border-bottom: 1px solid #aaa; }
#player-name { min-width: 0; width: 100%; padding: 6px 0; border: 0; border-radius: 0; background: transparent; outline: none; font: inherit; font-size: 16px; user-select: text; -webkit-user-select: text; }
#player-name::placeholder { color: #aaa; opacity: 1; }
#player-form:focus-within { border-bottom-color: #222; }
#player-form:has([aria-invalid="true"]) { border-bottom-color: #b44; }
#player-lock { flex: 0 0 36px; height: 36px; display: grid; place-items: center; padding: 7px; border: 0; background: transparent; }
#player-lock svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#player-lock:disabled { color: #aaa; cursor: default; }
#player-form.locked { border-bottom-color: #ddd; }
#leaderboard { margin: 0; padding-left: 22px; font-variant-numeric: tabular-nums; }
#leaderboard li { min-height: 25px; padding-left: 3px; }
.rank-name { display: inline-block; max-width: calc(100% - 55px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.rank-hits { float: right; color: #777; font-size: 13px; }
@media (max-width: 1050px) {
  .scores { position: static; flex: 0 0 auto; width: min(100%, 440px); display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 4px; font-size: 13px; }
  .all-time { font-size: 10px; }
  #all-time-hits { font-size: 23px; min-height: 30px; }
  #player-form { margin: 8px 0 0; }
  .scores p { margin-bottom: 4px; }
  #leaderboard li { min-height: 20px; }
  .rank-hits { font-size: 12px; }
}
@media (max-height: 500px) and (min-width: 601px) {
  .scores { position: absolute; top: 74px; left: 16px; width: 170px; display: block; }
  #player-form { margin-bottom: 12px; }
}
