/* Trust Issues. Flat, loud, cheeky. Design rules live in CLAUDE.md. */

html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--mustard);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
#game { position: fixed; display: block; z-index: 0; }
.lvl:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.screen { position: fixed; inset: 0; z-index: 2; }

/* Title: over the live demo, so it never covers the floor where the bot keeps falling */
.title {
  display: flex; flex-direction: column; align-items: flex-start; gap: 24px;
  padding: max(9vh, env(safe-area-inset-top)) max(6vw, 16px) 16px;
  pointer-events: none;
}
.title button, .title a { pointer-events: auto; }
.title h1 { font-size: 64px; line-height: 0.95; }
.title h1 span { display: block; }
.tagline { font-size: 20px; font-weight: 700; margin: 12px 0 0; }
.title-bottom { display: flex; flex-direction: column; gap: 16px; }
.keys { font-size: 16px; margin: 0; }
body.touch .keys, body.touch .kbd, body.tap .keys, body.tap .kbd { display: none; }   /* .tap: phones in the spin-offs (spinoff.js) */
@media (orientation: portrait) {
  .title { justify-content: space-between; padding-bottom: max(8vh, env(safe-area-inset-bottom)); }
}
@media (max-height: 480px) and (orientation: landscape) {
  .title { padding-top: 16px; gap: 12px; }
  .title h1 { font-size: 32px; }
}

/* Panels: level select and the ending */
.panel { background: var(--cream); overflow-y: auto; padding: max(24px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom)); }
.panel-in { max-width: 880px; margin: 0 auto; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.world { border-left: 8px solid var(--wc, var(--ink)); padding: 2px 0 2px 16px; margin-top: 28px; }
.world h3 { font-size: 20px; margin-bottom: 10px; }
.lvls { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
@media (max-width: 640px) { .lvls { grid-template-columns: repeat(3, 1fr); } }
.lvl {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 68px; padding: 10px;
  background: var(--ink); color: var(--cream); border: 2px solid var(--ink); border-radius: 4px;
  font: 16px/1.2 var(--body); text-align: left; cursor: pointer;
}
.lvl b { font: 20px/1 var(--display); font-weight: 400; }
.lvl:hover:not(:disabled) { transform: translateY(-2px); }
.lvl:disabled { background: transparent; color: rgba(26, 22, 18, 0.5); border: 2px dashed rgba(26, 22, 18, 0.35); cursor: default; }

.sub { font-size: 20px; margin: 8px 0 24px; }
.stats { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 0 0 24px; }
.stats dt { font-size: 16px; font-weight: 700; }
.stats dd { margin: 0; font: 32px/1.1 var(--display); }
.stats dd.small { font: 700 20px/1.3 var(--body); max-width: 22em; }
#pic, #ddPic { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 4px; margin-bottom: 24px; }

/* Daily Devil: the day's screen, on the devil red the menu gives it */
.panel.daily { background: #e2574c; }
.daily .panel-in { max-width: 640px; }
#ddPic { max-width: 480px; }
.dd-date { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.dd-line { font-size: 20px; font-weight: 700; margin: 0 0 16px; padding: 12px 16px; background: var(--cream); border: 3px solid var(--ink); border-radius: 4px; -webkit-user-select: text; user-select: text; }
.dd-next { font-size: 16px; font-weight: 700; margin: 24px 0 16px; }

/* Pause: a cream band across a dimmed game */
.scrim { background: rgba(26, 22, 18, 0.6); display: flex; align-items: center; }
.band { background: var(--cream); width: 100%; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.band .actions { justify-content: center; }

/* In play */
.showme { background: var(--cream); color: var(--ink); position: fixed; z-index: 3; left: 50%; transform: translateX(-50%); bottom: max(24px, env(safe-area-inset-bottom)); }
.showme:hover { transform: translate(-50%, -2px); }
body.touch .showme, body.tap .showme { bottom: calc(max(var(--gap), env(safe-area-inset-bottom)) + var(--jump) + var(--gap) + 16px); }

/* The pads' own strip under the level: main.js measures it and the renderer keeps the level above it */
:root { --pad: 80px; --jump: 96px; --gap: 12px; }
@media (max-height: 480px) { :root { --pad: 60px; --jump: 68px; --gap: 8px; } }
#touch {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; justify-content: space-between; align-items: flex-end;
  padding: var(--gap) max(16px, env(safe-area-inset-right)) max(var(--gap), env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  pointer-events: none; touch-action: none;
}
body.paused #touch { visibility: hidden; }   /* kept in layout, so the level doesn't jump under the pause band */
.touch .grp { display: flex; gap: 12px; }
.pad, .pausebtn { pointer-events: auto; touch-action: none; border: 3px solid rgba(255, 244, 220, 0.75); border-radius: 4px; background: rgba(26, 22, 18, 0.7); padding: 0; }
.pad { width: var(--pad); height: var(--pad); }
.pad.jump { width: var(--jump); height: var(--jump); }
.pad.on { background: var(--ink); border-color: var(--cream); }
.pausebtn { width: 48px; height: 48px; }
.pad svg, .pausebtn svg { width: 50%; height: 50%; fill: var(--cream); }

@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn:active, .lvl:hover:not(:disabled) { transform: none; }
  .showme:hover { transform: translateX(-50%); }
}
