/* Paw Match page. System fonts only, SevinHub palette. No outside requests. */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #08080f;
  color: #f0f0f8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
#game {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  touch-action: none;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
}
#game canvas { display: block; }

#loading {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #08080f;
  z-index: 30;
  transition: opacity .3s;
}
#loading.done { opacity: 0; pointer-events: none; }
.load-title { font-size: 28px; font-weight: 800; letter-spacing: .5px; }
.load-bar { width: 200px; height: 10px; border-radius: 5px; background: #1e1e33; overflow: hidden; }
.load-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7c3aed, #06b6d4); }

/* toolbar: bottom centre in portrait, bottom left in landscape */
#toolbar {
  position: fixed;
  z-index: 25;
  display: flex;
  gap: 10px;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
}
#toolbar[hidden] { display: none; }
body.landscape #toolbar { left: max(10px, env(safe-area-inset-left)); transform: none; }
.tool {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid #7c3aed;
  background: rgba(17, 17, 32, .88);
  color: #f0f0f8;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.tool:hover { border-color: #9f6bff; }
.tool:focus-visible, .levels button:focus-visible, .big:focus-visible, .cause:focus-visible, .credit a:focus-visible {
  outline: 3px solid #67e8f9;
  outline-offset: 2px;
}
.tool svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tool .ico-speaker { fill: currentColor; }
#btn-sound .ico-off { display: none; }
#btn-sound[aria-pressed="false"] .ico-waves { display: none; }
#btn-sound[aria-pressed="false"] .ico-off { display: inline; stroke: #f472b6; }
#btn-motion .ico-slash { display: none; }
#btn-motion[aria-pressed="true"] { border-color: #06b6d4; }
#btn-motion[aria-pressed="true"] .ico-slash { display: inline; stroke: #67e8f9; }

/* overlays */
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(8, 8, 15, .55);
  overflow-y: auto;
}
.overlay[hidden] { display: none; }
.card {
  width: min(440px, 100%);
  margin: auto;
  padding: 22px 20px 18px;
  border-radius: 24px;
  background: rgba(17, 17, 32, .96);
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 0 3px #7c3aed, 0 18px 50px rgba(0, 0, 0, .5);
  text-align: center;
}
h1, h2 { margin: 0 0 6px; font-weight: 800; letter-spacing: .3px; }
h1 { font-size: 34px; background: linear-gradient(90deg, #fcd34d, #f472b6, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 30px; }
.sub { margin: 0 0 12px; color: #c4c4e0; font-size: 15px; }
.how { list-style: none; margin: 0 0 14px; padding: 0; text-align: left; font-size: 14px; color: #d8d8ee; }
.how li { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.how .trio { display: flex; flex: 0 0 auto; width: 78px; }
.how .trio img { width: 26px; height: 26px; }
.how .sp { position: relative; flex: 0 0 auto; width: 78px; height: 34px; display: flex; justify-content: center; }
.how .sp img { width: 34px; height: 34px; }
.how .sp img + img { position: absolute; left: 22px; top: 0; }
.how .plus { flex: 0 0 auto; width: 78px; display: flex; justify-content: center; }
.how .plus b { min-width: 34px; padding: 5px 8px; border-radius: 999px; background: #0e7490; color: #ecfeff; font-size: 14px; line-height: 1.2; text-align: center; box-shadow: 0 0 0 2px #67e8f9; }
.sub-extra { display: none; }
.levels { display: flex; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.levels button {
  flex: 1;
  min-height: 44px;
  border-radius: 14px;
  border: 2px solid #3b3b5c;
  background: #1a1a2e;
  color: #f0f0f8;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.levels button[aria-checked="true"] { border-color: #06b6d4; background: #0e3b47; box-shadow: 0 0 0 2px rgba(6, 182, 212, .35); }
.big {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(90deg, #7c3aed, #9f6bff);
  color: #fff;
  font-family: inherit;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 0 #4c1d95;
}
.big:active { transform: translateY(3px); box-shadow: 0 3px 0 #4c1d95; }
.small { font-size: 13px; color: #9999bb; margin: 12px 0 4px; }
.credit { font-size: 12px; color: #7d7da0; margin: 6px 0 0; }
.credit a { color: #b9a4ff; }

.end-pup { width: 92px; height: 92px; margin: -4px auto 4px; display: block; }
.scores { display: flex; gap: 12px; margin: 10px 0; }
.score { flex: 1; border-radius: 16px; padding: 10px 6px; background: #0d0d1a; border: 2px solid #2a2a44; }
.score .lbl { display: block; font-size: 13px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.score.you .lbl { color: #67e8f9; }
.score.pup .lbl { color: #fcd34d; }
.score .num { display: block; font-size: 34px; font-weight: 800; }
.best { min-height: 20px; margin: 4px 0 12px; color: #c4c4e0; font-size: 14px; }
.best .new { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: #f59e0b; color: #1b1030; font-weight: 800; }
.cause {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 4px;
  color: #f0f0f8;
  font-size: 16px;
  text-decoration: none;
}
.cause span { color: #67e8f9; text-decoration: underline; text-underline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { position: fixed; top: 40%; left: 0; right: 0; text-align: center; }

@media (max-height: 520px) {
  .card { padding: 14px 16px 12px; }
  h1 { font-size: 26px; }
  .how { display: none; }
  .sub-extra { display: inline; }
  .end-pup { width: 60px; height: 60px; }
  .scores { margin: 6px 0; }
  .score .num { font-size: 26px; }
  .big { min-height: 48px; font-size: 19px; }
  .cause { margin-top: 8px; }
}
@media (max-height: 420px) {
  .overlay { padding: 6px; }
  .card { padding: 10px 14px 8px; border-radius: 18px; }
  h2 { font-size: 24px; margin-bottom: 2px; }
  #end .end-pup { display: none; }
  .scores { margin: 4px 0; }
  .score { padding: 4px 6px; }
  .score .num { font-size: 22px; }
  .best { margin: 2px 0 6px; font-size: 13px; }
  .levels { margin: 2px 0 8px; }
  .levels button { min-height: 40px; }
  .big { min-height: 44px; font-size: 18px; box-shadow: 0 4px 0 #4c1d95; }
  .sub { margin-bottom: 8px; }
  .small { margin: 6px 0 2px; }
  .cause { margin-top: 4px; padding: 6px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  #loading { transition: none; }
}
