/* Hidden Cards, playtest build 1. Wireframe styling, taken from the UX canvas.
   Sizes and colors match the frames; do not restyle without a UX decision. */

:root {
  --bg: #F4F4F2;
  --ink: #1A1A1A;
  --white: #FFFFFF;
  --mid: #777;        /* quiet borders, unavailable items */
  --rule: #BDBDB8;    /* lines above and below pinned bars */
  --soft: #EAEAE6;    /* avatar circles, number box */
  --off: #DADAD6;     /* switched-off and disabled fills */
  --text-2: #444;
  --text-3: #333;
  --page: 20px;       /* side padding of every screen */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html.has-sheet { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, "Helvetica Neue", sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  touch-action: manipulation; /* no double-tap zoom; pinch zoom still works */
}

h1, h2, p, ul { margin: 0; padding: 0; font: inherit; }
ul { list-style: none; }

/* Text balance rule (summary, UX rules): similar line lengths, no lone last word. */
h1, h2, p, span, div, label, button { text-wrap: balance; }

button {
  margin: 0; padding: 0;
  background: none; border: 0; border-radius: 0;
  font: inherit; color: inherit; text-align: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
button:disabled, button[aria-disabled="true"] { cursor: default; }
button:active:not(:disabled):not([aria-disabled="true"]) { opacity: .7; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sheet:focus { outline: none; }

.icon { display: inline-flex; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; }

/* ---- Page frame ---- */

.app { max-width: 480px; margin: 0 auto; }

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.header { display: flex; align-items: center; gap: 8px; min-height: 56px; }
.header-pinned {
  position: sticky; top: 0; z-index: 2;
  padding: calc(28px + var(--safe-top)) var(--page) 12px;
  background: var(--bg);
  border-bottom: 2px solid var(--rule);
}
.back {
  width: 48px; height: 48px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink); border-radius: 12px;
}
.title { flex: 1; min-width: 0; font-size: 26px; font-weight: 800; }

.label { display: block; margin-top: 24px; font-size: 18px; font-weight: 700; line-height: 22px; }
.label-opt { font-weight: 500; color: var(--text-2); }

/* ---- Buttons ---- */

.btn {
  width: 100%; height: 64px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 2px solid var(--ink); border-radius: 16px;
  font-size: 26px; font-weight: 800; text-align: center;
}
.btn-main { background: var(--ink); color: var(--white); }      /* the only filled button on a screen */
.btn-outline { background: var(--white); color: var(--ink); }
/* Disabled looks, as drawn: gray fill on 3.1, dashed outline on 9.1. */
.btn.is-off-filled { background: var(--off); border-color: var(--mid); color: var(--text-2); }
.btn.is-off-dashed { background: transparent; border: 2px dashed var(--mid); color: var(--mid); }

/* Quiet link: fallback and escape actions, never a call to action. */
.quiet {
  align-self: center;
  min-height: 48px; padding: 8px 16px;
  color: var(--text-3); font-size: 18px; font-weight: 500;
  text-decoration: underline;
}

/* Main action pinned to the bottom while the page scrolls. */
.bar {
  position: sticky; bottom: 0; z-index: 2;
  padding: 12px var(--page) max(24px, calc(var(--safe-bottom) + 12px));
  background: var(--bg);
  border-top: 2px solid var(--rule);
}
.bar-missing { margin-bottom: 8px; text-align: center; font-size: 18px; line-height: 24px; color: var(--text-2); }

.panel { padding: 16px; background: var(--white); border: 2px solid var(--ink); border-radius: 14px; }
.row-title { font-size: 20px; font-weight: 700; }
.row-sub { font-size: 16px; line-height: 20px; color: var(--text-2); }

/* ---- 1.1 Home ---- */

.home {
  padding: calc(28px + var(--safe-top)) var(--page) max(24px, var(--safe-bottom));
  gap: 16px;
}
.home-brand { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; }
.logo-ph {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed #555; border-radius: 8px;
  font-size: 12px; color: #555;
}
.home-title { font-size: 26px; font-weight: 700; }

.resume {
  width: 100%; min-height: 72px; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px;
  background: #E4E4E0; border: 2px dashed #555; border-radius: 12px;
  text-align: left;
}
.resume-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.resume-title { font-size: 20px; font-weight: 700; }
.resume-sub { font-size: 16px; color: var(--text-2); }

.role {
  flex: 1 1 0; min-height: 170px; width: 100%; padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 20px;
  text-align: center;
}
.role-name { font-size: 40px; font-weight: 800; line-height: 1; }
.role-sub { font-size: 18px; color: var(--text-2); }

/* Short phones: smaller icons so the two big buttons keep their labels clear. */
@media (max-height: 640px) {
  .role { min-height: 150px; padding: 12px; gap: 6px; }
  .role .icon { width: 60px !important; height: 60px !important; }
  .role-name { font-size: 34px; }
}

.home-foot { display: flex; flex-direction: column; align-items: center; }
.share { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 400; }
.home-note { min-height: 0; text-align: center; font-size: 16px; color: var(--text-2); }
.home-note:empty { display: none; }

/* ---- 3.1 Before you start ---- */

.adult, .hiding {
  padding: calc(28px + var(--safe-top)) var(--page) max(24px, var(--safe-bottom));
}
.adult-lead { margin-top: 28px; font-size: 22px; line-height: 30px; }
.check-row {
  margin-top: 28px; width: 100%; min-height: 88px; padding: 16px;
  display: flex; align-items: center; gap: 16px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 14px;
  text-align: left;
}
.check-row.is-on { border-width: 4px; padding: 14px; }
.check-box {
  width: 44px; height: 44px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); border: 3px solid var(--ink); border-radius: 8px;
}
.check-row.is-on .check-box { background: var(--ink); color: var(--white); }
.check-text { flex: 1; font-size: 20px; line-height: 26px; font-weight: 600; }
.adult-note { margin-top: 24px; font-size: 17px; line-height: 24px; color: var(--text-2); }
.adult-link { margin: 8px 0 24px; align-self: flex-start; padding: 8px 0; font-size: 17px; font-weight: 400; }
.adult-go { margin-top: auto; flex: none; }

/* ---- 3.2 Game settings ---- */

.settings-body {
  flex: 1;
  padding: calc(28px + var(--safe-top)) var(--page) 26px;
  display: flex; flex-direction: column;
}
.card-choices { margin-top: 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.card-choice {
  position: relative; height: 72px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 14px;
  font-size: 34px; font-weight: 800; text-align: center;
}
.card-choice.is-on { background: var(--ink); border-width: 4px; color: var(--white); }
.card-choice-badge {
  position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); color: var(--ink);
}

.mode-rows { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.mode-row {
  width: 100%; min-height: 84px; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 14px;
  text-align: left;
}
.mode-row.is-on { border-width: 4px; padding: 10px 14px; }
.mode-dot {
  width: 28px; height: 28px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--ink); border-radius: 14px;
}
.mode-dot-in { width: 14px; height: 14px; border-radius: 7px; background: var(--ink); }
.mode-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
/* Unavailable in this test version: dashed and gray, no reaction to taps. */
.mode-row.is-off { background: transparent; border: 2px dashed var(--mid); color: var(--mid); }
.mode-row.is-off .mode-dot { border: 2px dashed var(--mid); }
.mode-row.is-off .row-sub { color: var(--mid); }

.hints { margin-top: 24px; }
.hints-top { display: flex; align-items: flex-start; gap: 12px; }
.hints-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.hints-box {
  flex: none; min-width: 72px; padding: 6px 10px;
  display: flex; flex-direction: column; align-items: center;
  background: var(--soft); border: 2px solid var(--ink); border-radius: 12px;
}
.hints-num { font-size: 44px; font-weight: 800; line-height: 48px; }
.hints-word { font-size: 14px; line-height: 16px; color: var(--text-3); }

/* Slider: 8px track, 36px white thumb. --v is the value from 0 to 1. */
.slider {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 48px; margin: 12px 0 0; padding: 0;
  background: transparent; cursor: pointer;
  touch-action: pan-y;
}
.slider::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / calc(18px + (100% - 36px) * var(--v)) 100% no-repeat,
    #C4C4C0;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 36px; height: 36px; margin-top: -14px;
  background: var(--white); border: 4px solid var(--ink); border-radius: 18px;
}
.slider::-moz-range-track { height: 8px; border-radius: 4px; background: #C4C4C0; }
.slider::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--ink); }
.slider::-moz-range-thumb {
  width: 36px; height: 36px; box-sizing: border-box;
  background: var(--white); border: 4px solid var(--ink); border-radius: 18px;
}
.slider-ends { display: flex; justify-content: space-between; font-size: 15px; color: var(--text-2); }

.switch-row {
  margin-top: 24px; width: 100%; min-height: 72px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 14px;
  text-align: left;
}
.switch-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.switch {
  position: relative; flex: none; width: 76px; height: 40px; padding-right: 12px;
  display: flex; align-items: center; justify-content: flex-end;
  background: var(--off); border: 2px solid var(--mid); border-radius: 20px;
  font-size: 16px; font-weight: 800;
}
.switch-knob {
  position: absolute; left: 3px; top: 3px; width: 30px; height: 30px; border-radius: 15px;
  background: var(--white); border: 2px solid var(--mid);
}
.switch-row.is-on .switch {
  padding: 0 0 0 12px; justify-content: flex-start;
  background: var(--ink); border-color: var(--ink); color: var(--white);
}
.switch-row.is-on .switch-knob { left: auto; right: 3px; border: 0; }

.field {
  margin-top: 8px; width: 100%; height: 56px; padding: 0 16px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 12px;
  font: inherit; font-size: 20px; color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.field::placeholder { color: #666; opacity: 1; }
.field-help { margin-top: 6px; font-size: 15px; line-height: 18px; color: var(--text-2); }

/* ---- 9.1 Who is playing? ---- */

.who-body { flex: 1; padding: 16px var(--page) 20px; display: flex; flex-direction: column; gap: 10px; }
.who-intro { margin-bottom: 6px; font-size: 20px; line-height: 26px; color: var(--text-3); }
.who .bar { padding-top: 10px; }

.seekers { display: flex; flex-direction: column; gap: 10px; }
.seeker {
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--white); border: 2px solid var(--mid); border-radius: 14px;
}
.seeker-top { display: flex; align-items: center; gap: 10px; }
.avatar-btn {
  width: 56px; height: 56px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--soft); border: 2px solid var(--mid); border-radius: 28px;
  font-size: 32px; line-height: 1;
}
/* The name field grows instead of cutting a long name (names are never shortened). */
.name-field {
  flex: 1; min-width: 0; min-height: 56px; margin: 0; padding: 13px 12px;
  display: block; resize: none; overflow: hidden;
  background: var(--bg); border: 2px dashed var(--mid); border-radius: 12px;
  font: inherit; font-size: 22px; line-height: 26px; font-weight: 700; color: var(--ink);
  overflow-wrap: anywhere;
  -webkit-appearance: none; appearance: none;
}
.name-field::placeholder { color: var(--mid); font-weight: 500; opacity: 1; }
.name-field.is-named, .name-field:focus { border-style: solid; border-color: var(--ink); }
.name-field.is-error { border: 4px solid var(--ink); padding: 11px 10px; }
.remove-btn {
  width: 48px; height: 48px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--mid); border-radius: 12px;
}
.name-msg { font-size: 18px; line-height: 24px; font-weight: 700; }
.chip {
  min-height: 44px; padding: 4px 14px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 22px;
  font-size: 18px; font-weight: 700;
}
.empty {
  min-height: 120px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 2px dashed var(--mid); border-radius: 14px;
  font-size: 22px; line-height: 28px; font-weight: 600; color: var(--text-2);
}
.add { font-size: 22px; flex: none; }

/* ---- Bottom sheets ---- */

.sheet-layer { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-dim { position: absolute; inset: 0; background: rgba(26, 26, 26, .55); animation: dim-in .25s ease-out; }
.sheet {
  position: relative; width: 100%; max-width: 480px; max-height: 92dvh; margin: 0 auto;
  padding: 0 var(--page) max(24px, calc(var(--safe-bottom) + 12px));
  display: flex; flex-direction: column; overflow-y: auto;
  background: var(--bg); border-top: 3px solid var(--ink); border-radius: 24px 24px 0 0;
  animation: sheet-up .25s ease-out;
}
.sheet-handle { align-self: stretch; padding: 12px 0 16px; display: flex; justify-content: center; touch-action: none; cursor: grab; }
.sheet-grip { width: 56px; height: 6px; border-radius: 3px; background: #999; }
.sheet-who { display: flex; align-items: center; gap: 10px; }
.sheet-avatar {
  width: 48px; height: 48px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft); border: 2px solid var(--mid); border-radius: 24px;
  font-size: 28px; line-height: 1;
}
.sheet-title { min-width: 0; overflow-wrap: anywhere; font-size: 28px; line-height: 34px; font-weight: 800; }
.sheet-text { margin-top: 8px; font-size: 18px; line-height: 24px; color: var(--text-3); }
.sheet-note { margin-top: 12px; text-align: center; font-size: 18px; line-height: 24px; color: var(--text-2); }
.sheet-main { margin-top: 16px; flex: none; }
.sheet-quiet { margin-top: 4px; flex: none; }

.stepper { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 24px; }
.step {
  width: 72px; height: 72px; flex: none;
  background: var(--white); border: 2px solid var(--ink); border-radius: 16px;
  font-size: 40px; font-weight: 800; text-align: center;
}
.step.is-off-dashed { background: transparent; border: 2px dashed var(--mid); color: var(--mid); }
.step-num { min-width: 90px; text-align: center; font-size: 56px; line-height: 60px; font-weight: 800; }

/* Animal grid, as on screen 2.2. */
.animal-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.animal {
  position: relative; height: 72px;
  background: var(--white); border: 2px solid var(--mid); border-radius: 12px;
  font-size: 40px; line-height: 1; text-align: center;
}
.animal.is-on { border: 4px solid var(--ink); }
.animal-badge {
  position: absolute; right: -8px; top: -8px; width: 24px; height: 24px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--white);
}

/* ---- End-of-build placeholder ---- */

.saved { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.saved-row { display: flex; justify-content: space-between; gap: 16px; font-size: 18px; line-height: 24px; }
.saved-label { min-width: 0; color: var(--text-2); overflow-wrap: anywhere; }
.saved-value { flex: none; max-width: 60%; font-weight: 700; text-align: right; overflow-wrap: anywhere; }

@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes dim-in { from { opacity: 0; } to { opacity: 1; } }

/* Animations stop with reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
