/* Hallmark · macrostructure: Playfield · theme: smash-meadow · nav: none · footer: none */
/* Hallmark · pre-emit critique: P5 H5 E5 S5 R4 V5 */
/* Going with: audience = 竹下のたまたま層 · use = たたいてくずす · tone = toy-slapstick-3D */

:root {
  --sky-top: #f3c4a0;
  --sky-mid: #8bb8dc;
  --ink: #2c221c;
  --cream: #fff1de;
  --wood: #c47a3c;
  --rubber: #e23d68;
  --pad: #efc75a;
  --mint: #5ecf8a;
  --sheet: #fff7ec;
  --font-display: "Mochiy Pop One", sans-serif;
  --font-body: "Kosugi Maru", sans-serif;
  --shadow: 0 10px 28px color-mix(in oklab, var(--ink) 18%, transparent);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: clip;
  overflow-x: clip;
  background: #3a2a22;
  color: var(--ink);
  font-family: var(--font-body);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 430px;
  margin: 0 auto;
  overflow: clip;
  background: var(--sky-mid);
}

#view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  padding: calc(10px + env(safe-area-inset-top)) 14px 0;
  pointer-events: none;
  text-align: left;
  text-shadow: 0 1px 0 color-mix(in oklab, var(--cream) 70%, transparent);
}
.hud__who {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0.72;
}
.hud__stage {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-style: normal;
  font-size: clamp(1.15rem, 5.4vw, 1.45rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
  min-width: 0;
}
.pips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  max-width: 160px;
}
.pips li {
  width: 9px;
  height: 9px;
  border-radius: 3px 3px 1px 1px;
  background: color-mix(in oklab, var(--ink) 18%, var(--cream));
}
.pips li.is-now {
  background: var(--rubber);
  transform: scale(1.15);
}
.pips li.is-ok {
  background: var(--mint);
}

.hud__smash {
  margin: 8px 0 0;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.02em;
  background: color-mix(in oklab, var(--cream) 82%, white);
  box-shadow: 0 2px 0 color-mix(in oklab, var(--ink) 12%, transparent);
}
.hud__smash[data-done="1"] {
  background: color-mix(in oklab, var(--mint) 55%, var(--cream));
  color: #1f4d32;
}

.hint {
  position: absolute;
  left: 14px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 6;
  margin: 0;
  padding: 7px 12px;
  max-width: 70%;
  border-radius: 4px 14px 14px 14px;
  background: color-mix(in oklab, var(--cream) 88%, white);
  box-shadow: var(--shadow);
  font-size: 13px;
  pointer-events: none;
}
.hint[hidden] { display: none !important; }

.sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 12;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  column-gap: 12px;
  row-gap: 2px;
  padding: 12px;
  border-radius: 6px 22px 10px 22px;
  background: var(--sheet);
  box-shadow: var(--shadow), 0 0 0 3px color-mix(in oklab, var(--wood) 35%, transparent);
  text-align: left;
}
.sheet[hidden] { display: none !important; }
.sheet.is-fail { box-shadow: var(--shadow), 0 0 0 3px color-mix(in oklab, var(--rubber) 45%, transparent); }
.sheet.is-clear { box-shadow: var(--shadow), 0 0 0 3px color-mix(in oklab, var(--mint) 50%, transparent); }

.sheet__face {
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 86px;
  height: 86px;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  border-radius: 8px 18px 8px 18px;
  background: var(--cream);
}
.sheet__kicker {
  grid-column: 2;
  margin: 0;
  font-size: 12px;
  opacity: 0.7;
}
.sheet h2 {
  grid-column: 2;
  margin: 0;
  font-family: var(--font-display);
  font-style: normal;
  font-size: clamp(1.2rem, 5.5vw, 1.5rem);
  font-weight: 400;
  line-height: 1.2;
  overflow-wrap: anywhere;
  min-width: 0;
}
.sheet__line {
  grid-column: 2;
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.85;
}
.sheet__btns {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.btn {
  appearance: none;
  flex: 1 1 8.5rem;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--cream);
  background: var(--wood);
  box-shadow: 0 4px 0 #8a4e20;
  cursor: pointer;
}
.btn:focus-visible { outline: 3px solid var(--rubber); outline-offset: 2px; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #8a4e20; }
.btn--next { background: #3d8a62; box-shadow: 0 4px 0 #2a6144; }
.btn--share {
  flex: 1 1 100%;
  color: #fff8f4;
  background: var(--rubber);
  box-shadow: 0 4px 0 #b02448;
}

@media (min-width: 431px) {
  .app {
    border-left: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
    border-right: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}
