/* Paint Rush occupies the app viewport. Only a small floating HUD sits above the floor. */
#app > .courtyard-shell {
  position: relative;
  padding: 0;
  color: #2f303d;
  background: #613529;
  isolation: isolate;
}
#app .courtyard-shell .game-main {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  width: 100%;
}
#app .courtyard-shell .paint-hud {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: env(safe-area-inset-left, 0px);
  right: env(safe-area-inset-right, 0px);
  height: 62px;
  min-height: 0;
  padding: 8px 12px;
  gap: 7px;
  z-index: 5;
  border: 0;
  pointer-events: none;
  background: none;
}
#app .courtyard-shell .paint-hud .text-button {
  pointer-events: auto;
  min-height: 44px;
  min-width: 44px;
  width: 44px;
  height: 44px;
  padding: 4px;
  border: 1px solid #f1cf7f;
  border-radius: 14px;
  color: #fff1c7;
  background: linear-gradient(#38434e, #202a37);
  box-shadow:
    inset 0 1px #fff5,
    0 2px 6px #091f4166;
  font-size: 25px;
  line-height: 1;
}
#app .courtyard-shell .paint-hud .back-button {
  margin-right: auto;
}
#app .courtyard-shell .paint-hud .restart {
  margin-left: auto;
}
#app .courtyard-shell .paint-hud .fullscreen-button {
  font-size: 0;
}
#app .courtyard-shell .paint-hud .fullscreen-button::before {
  content: "⛶";
  font-size: 24px;
}
#app .courtyard-shell .timer {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  height: 44px;
  min-width: 78px;
  border: 1px solid #edd08c;
  border-radius: 15px;
  padding: 6px 13px;
  color: #fff4d7;
  background: #503326;
  box-shadow:
    inset 0 1px #fff3,
    0 3px 10px #092a3e66;
}
#app .courtyard-shell .timer b {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
#app .courtyard-shell .timer small {
  font-size: 8px;
  color: #e6c875;
}
#app .courtyard-shell .timer.urgent {
  background: #a24038ee;
}
#app .courtyard-shell .courtyard-arena {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #985339 url("/assets/paint/london-frame-wide.webp") center / 100% 100% no-repeat;
}
#app .courtyard-shell .doodle-page {
  position: absolute;
  inset: max(calc(env(safe-area-inset-top, 0px) + 59px), 9%)
    max(26px, 7%, env(safe-area-inset-right, 0px))
    max(34px, 11.5%, env(safe-area-inset-bottom, 0px))
    max(26px, 7%, env(safe-area-inset-left, 0px));
  border-radius: 2px;
  overflow: hidden;
  background: radial-gradient(ellipse at 40% 35%, #fffdf64a 12%, #f6edd930 100%);
  box-shadow: 0 1px 2px #49271788, 0 4px 16px #3d241c59, inset 0 0 16px #9b654f16;
}
#app .courtyard-shell .doodle-page canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: default;
}
.doodle-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .14;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.63' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
.london-ink {
  position: absolute;
  inset: 2%;
  width: 96%;
  height: 96%;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 1px 0 #a184614d);
}
.london-ink.ink-portrait,
.london-ink.ink-phone,
.london-ink.ink-panorama { display: none; }
@media (min-aspect-ratio: 8/5) {
  .london-ink.ink-wide { display: none; }
  .london-ink.ink-panorama { display: block; }
}
/* Fixed thumb controls and independently steered roller pieces. */
.paint-stick,
.paint-roller {
  position: absolute;
  -webkit-user-drag: none;
}
.paint-stick {
  --stick-size: clamp(74px, 13vmin, 96px);
  --stick-inset: max(22px, 4vw);
  --stick-top: 68px;
  --stick-bottom: 22px;
  --stick-x: 0;
  --stick-y: 0;
  z-index: 4;
  width: var(--stick-size);
  height: var(--stick-size);
  padding: 0;
  border: 3px solid #302620;
  border-radius: 50%;
  background: radial-gradient(circle, #221c1d 0 37%, var(--player) 39% 67%, #f1d290 69% 100%);
  box-shadow: 0 3px 12px #2e1b18a8, inset 0 0 0 1px #fff6d1;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.paint-stick:disabled { visibility: hidden; }
.paint-stick:active { cursor: grabbing; }
.paint-stick-knob {
  position: absolute;
  inset: 24%;
  border: 2px solid #fff4d1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #74635d, #302522 55%, #161418 90%);
  box-shadow: inset 0 0 0 3px var(--player), 0 3px 5px #201517aa;
  transform: translate(calc(var(--stick-x) * var(--stick-size) * .25),
    calc(var(--stick-y) * var(--stick-size) * .25));
  pointer-events: none;
}
.paint-stick-number {
  position: absolute;
  bottom: -2px;
  right: -2px;
  min-width: 20px;
  border: 1px solid #fff0c2;
  border-radius: 50%;
  background: var(--player);
  color: #191621;
  font: 850 12px/18px system-ui, sans-serif;
  pointer-events: none;
}
.paint-stick.top-left,
.paint-stick.top-right { top: calc(env(safe-area-inset-top, 0px) + var(--stick-top)); }
.paint-stick.bottom-left,
.paint-stick.bottom-right { bottom: calc(env(safe-area-inset-bottom, 0px) + var(--stick-bottom)); }
.paint-stick.top-left,
.paint-stick.bottom-left { left: calc(env(safe-area-inset-left, 0px) + var(--stick-inset)); }
.paint-stick.top-right,
.paint-stick.bottom-right { right: calc(env(safe-area-inset-right, 0px) + var(--stick-inset)); }
@media (orientation: landscape) and (max-height: 480px) {
  .paint-stick {
    --stick-inset: max(38px, 5vw);
    --stick-bottom: 30px;
  }
}
.paint-roller {
  top: 0;
  left: 0;
  width: var(--roller-span);
  aspect-ratio: 1;
  z-index: 3;
  transform-origin: top left;
  pointer-events: none;
  background-repeat: no-repeat;
  filter: drop-shadow(1px 3px 2px #39241c8c);
}
#app .courtyard-shell .paint-sound {
  position: absolute;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 4;
  min-height: 44px;
  padding: 4px 11px;
  border: 1px solid #e2bd68;
  border-radius: 12px;
  background: #312724ee;
  color: #fff4d7;
  font-size: 11px;
  touch-action: manipulation;
}
@media (orientation: portrait) {
  #app .courtyard-shell .courtyard-arena {
    background-image: url("/assets/paint/london-frame-portrait.webp");
  }
  #app .courtyard-shell .doodle-page {
    bottom: max(36px, 8%, env(safe-area-inset-bottom, 0px));
  }
  .london-ink.ink-wide { display: none; }
  .london-ink.ink-portrait { display: block; }
}
@media (orientation: portrait) and (max-width: 560px) {
  .london-ink.ink-portrait { display: none; }
  .london-ink.ink-phone { display: block; }
  .paint-stick {
    --stick-size: clamp(74px, 20vw, 88px);
    --stick-inset: clamp(30px, 9vw, 48px);
    --stick-top: 90px;
    --stick-bottom: clamp(38px, 6svh, 52px);
  }
}
.paint-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#app .courtyard-shell .arena-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: #072b4655;
  backdrop-filter: blur(3px);
  padding: max(20px, env(safe-area-inset-top, 0px)) 18px
    max(20px, env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: safe center;
  justify-content: center;
  overflow: auto;
  touch-action: pan-y;
}
#app .courtyard-shell .arena-overlay[hidden] {
  display: none;
}
#app .courtyard-shell .overlay-card {
  width: 100%;
  max-width: 410px;
  flex-shrink: 0;
  padding: 28px 24px;
  margin: auto;
  text-align: center;
  color: #214f59;
  background: linear-gradient(145deg, #fff9e9, #eddfb9);
  border: 2px solid #e2bd68;
  border-radius: 24px;
  box-shadow:
    0 0 0 4px #fff2ba40,
    0 18px 65px #08283e88,
    inset 0 0 0 5px #fff8df88;
}
.courtyard-kicker {
  display: block;
  margin: 0 0 12px;
  color: #957139;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
}
#app .courtyard-shell .overlay-card h1,
#app .courtyard-shell .overlay-card h2 {
  width: auto;
  margin: 0;
  color: #164e5a;
  font-family: Georgia, serif;
  font-size: 37px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.1;
}
#app .courtyard-shell .overlay-card h2 {
  font-size: 32px;
}
#app .courtyard-shell .overlay-card p {
  margin: 13px 0 20px;
  color: #61736b;
  font-size: 12px;
  line-height: 1.65;
}
#app .courtyard-shell .colour-choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 0 0 12px;
}
#app .courtyard-shell .colour-choices label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  margin-bottom: 7px;
}
.player-gem {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--player);
  box-shadow:
    inset 0 1px #fff8,
    0 0 0 1px #b49d6b70;
}
#app .courtyard-shell .colour-choices select {
  min-height: 44px;
  border: 1px solid #c7a767;
  background: #fff9e9;
  color: #245962;
  border-radius: 10px;
  font-size: 12px;
  max-width: 90px;
}
#app .courtyard-shell .primary {
  min-height: 48px;
  min-width: 220px;
  margin: 18px auto 0;
  border: 1px solid #bfa05e;
  border-radius: 14px;
  background: linear-gradient(#2d818c, #155566);
  color: #fff1c9;
  box-shadow:
    0 4px 0 #103f4d,
    inset 0 1px #fff5;
}
#app .courtyard-shell .primary:disabled {
  opacity: 0.65;
  cursor: wait;
}
#app .courtyard-shell .overlay-card > small {
  display: block;
  font-size: 10px;
  color: #6c7464;
  max-width: 305px;
  line-height: 1.6;
  margin: 18px auto 0;
}
#app .courtyard-shell .text-button.result-menu {
  color: #245b64;
  min-height: 44px;
}
#app .courtyard-shell .countdown-number {
  font:
    800 100px/1.1 Georgia,
    serif;
  color: #236a77;
  text-shadow: 0 3px #d9c28b;
  margin-bottom: 20px;
}
.winner-star {
  display: inline-block;
  font-size: 48px;
  line-height: 1;
  color: #bd8d2e;
  text-shadow: 0 2px #fff7da;
  margin-bottom: 12px;
}
#app .courtyard-shell .results {
  max-width: 285px;
  margin: 20px auto;
}
#app .courtyard-shell .coverage-result {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 16px;
  border-bottom: 1px solid #b69d6255;
}
#app .courtyard-shell .coverage-result b {
  margin-left: auto;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}
#app .courtyard-shell .coverage-result::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 0;
  width: var(--coverage);
  height: 4px;
  border-radius: 4px;
  background: var(--player);
}
#app .courtyard-shell button:focus-visible,
#app .courtyard-shell select:focus-visible {
  outline: 3px solid #fff1a5;
  outline-offset: 3px;
}
@media (max-width: 460px) {
  #app .courtyard-shell .overlay-card {
    padding: 23px 16px;
  }
  #app .courtyard-shell .overlay-card h1 {
    font-size: 34px;
  }
  #app .courtyard-shell .overlay-card h2 {
    font-size: 29px;
  }
  #app .courtyard-shell .colour-choices {
    display: grid;
    grid-template-columns: repeat(2, 90px);
    gap: 12px 16px;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  #app .courtyard-shell .paint-hud {
    height: 54px;
    padding-top: 5px;
  }
  #app .courtyard-shell .timer {
    top: 5px;
  }
  #app .courtyard-shell .doodle-page {
    top: calc(env(safe-area-inset-top, 0px) + 54px);
  }
  #app .courtyard-shell .overlay-card {
    max-width: 490px;
    padding: 18px 22px;
  }
  #app .courtyard-shell .overlay-card h1 {
    font-size: 29px;
  }
  #app .courtyard-shell .overlay-card h2 {
    font-size: 26px;
  }
  #app .courtyard-shell .overlay-card p {
    margin: 8px 0 12px;
  }
  #app .courtyard-shell .courtyard-kicker {
    margin-bottom: 8px;
  }
  #app .courtyard-shell .primary {
    margin-top: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #app .courtyard-shell * {
    animation: none;
    transition: none;
  }
}
/* Dialogs take visual priority over the floating gameplay timer and buttons. */
#app .courtyard-shell:has(.arena-overlay:not([hidden])) .paint-hud {
  visibility: hidden;
}
#app .courtyard-shell .text-button.setup-menu {
  display: block;
  margin: 7px auto 0;
  color: #245b64;
  min-height: 38px;
  font-size: 11px;
}

.paint-pickup, .paint-pickup-burst, .paint-boost-badge {
  position: absolute;
  pointer-events: none;
  z-index: 4;
  transform: translate(-50%, -50%);
}
.paint-pickup {
  width: clamp(54px, 8vw, 82px);
  aspect-ratio: 1;
  background: radial-gradient(circle, #fff9d9dd, #fff4b344 65%, transparent 70%) center / contain no-repeat;
  filter: drop-shadow(2px 5px 3px #42263788);
  font-size: 42px;
  text-align: center;
  animation: paint-token-float 1.2s ease-in-out infinite alternate;
}
.paint-boost-badge, .paint-pickup-burst {
  padding: 4px 8px;
  border-radius: 12px;
  background: #fff7e9;
  color: #282938;
  font: 700 12px system-ui;
  white-space: nowrap;
  box-shadow: 0 2px 6px #33223344;
}
.paint-boost-badge { transform: translate(-50%, 30px); }
.paint-pickup-burst { border: 3px solid var(--pickup-colour); transform: translate(-50%, -60px); }
@keyframes paint-token-float { to { transform: translate(-50%, -60%) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .paint-pickup { animation: none; } }
.paint-pickup-burst[data-kind="splash"]::before {
  content: "";
  position: absolute;
  left: 50%; top: 60px;
  width: var(--splash-size); aspect-ratio: 1;
  border: 6px dotted var(--pickup-colour);
  border-radius: 50%;
  animation: paint-splash-ring .55s ease-out both;
}
@keyframes paint-splash-ring {
  from { transform: translate(-50%, -50%) scale(.2); opacity: 1; }
  to { transform: translate(-50%, -50%) scale(1.12); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .paint-pickup-burst::before { animation: none; display: none; } }
