:root {
  color-scheme: light;
  --paper: #fbf4e6;
  --ink: #14110d;
  --muted: #6b5c4b;
  --cream: #fffdf7;
  --red: #e84d3d;
  --yellow: #f4c64e;
  --green: #2fb36d;
  --blue: #3978d7;
  --pink: #ef8fb1;
  --teal: #6ad1c8;
  --shadow: rgba(20, 17, 13, 0.18);
  --border: 4px solid var(--ink);
  font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(20, 17, 13, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(20, 17, 13, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 26px 26px;
  color: var(--ink);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

a {
  color: inherit;
  font-weight: 950;
  text-decoration-thickness: 2px;
}

.app {
  min-height: 100svh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: max(16px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom));
}

.screen {
  width: min(100%, 430px, calc((100svh - 20px) * 0.59));
  height: min(calc(100svh - 28px), 780px);
  min-height: min(640px, calc(100svh - 28px));
  display: flex;
  flex-direction: column;
  position: relative;
}

.is-hidden {
  display: none !important;
}

.top-row,
.brand-lockup,
.game-header,
.game-tools,
.footer-line,
.meeting-topline,
.suspicion-wrap,
.preview-bar,
.preview-meter {
  display: flex;
  align-items: center;
}

.top-row,
.game-header,
.footer-line,
.meeting-topline,
.suspicion-wrap,
.preview-bar,
.preview-meter {
  justify-content: space-between;
}

.brand-lockup {
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 950;
  text-transform: uppercase;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: var(--border);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 3px 3px 0 var(--ink);
}

.sound-button {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border: var(--border);
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  font-size: 1.12rem;
  line-height: 1;
}

.sound-button[aria-pressed="true"] {
  background: #ffd8d2;
}

.button {
  min-height: 56px;
  width: 100%;
  border: var(--border);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.02rem;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.button:active,
.sound-button:active,
.action-button:active,
.item-button:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.button:focus-visible,
.sound-button:focus-visible,
.action-button:focus-visible,
.item-button:focus-visible {
  outline: 4px solid #ffffff;
  outline-offset: 3px;
}

.primary-button {
  background: var(--green);
}

.secondary-button {
  background: var(--cream);
}

.meeting-preview {
  flex: 0 0 clamp(198px, 31svh, 250px);
  margin: 18px 0 14px;
  padding: 12px;
  border: var(--border);
  border-radius: 10px;
  background: #222831;
  color: var(--cream);
  box-shadow: 7px 7px 0 var(--ink);
}

.preview-bar,
.meeting-topline {
  min-height: 30px;
  gap: 8px;
}

.live-badge,
.status-badge,
.warning-chip {
  display: inline-grid;
  min-height: 26px;
  align-items: center;
  padding: 4px 8px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--red);
  color: var(--cream);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.live-badge {
  animation: liveBlink 980ms steps(2, start) infinite;
}

.preview-timer {
  font-size: 0.82rem;
  font-weight: 950;
}

.tile-grid,
.meeting-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meeting-tiles {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.call-tile {
  min-height: 96px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 8px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
  text-align: center;
  box-shadow: 3px 3px 0 var(--ink);
}

.boss-tile {
  background: #f5b980;
}

.boss-tile.is-watching {
  animation: bossJitter 1.4s ease-in-out infinite;
}

.you-tile {
  background: #9ed8ff;
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  font-size: 0.78rem;
  font-weight: 950;
}

.call-tile strong {
  font-size: 0.92rem;
  line-height: 1;
}

.call-tile small {
  max-width: 100%;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.preview-meter {
  gap: 8px;
  margin-top: 12px;
  color: var(--cream);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.preview-meter div,
.suspicion-track {
  height: 14px;
  flex: 1;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  overflow: hidden;
}

.preview-meter i,
.suspicion-track i {
  width: 28%;
  height: 100%;
  display: block;
  border-right: 3px solid var(--ink);
  background: var(--yellow);
  animation: meterPulse 1.2s ease-in-out infinite alternate;
}

.title-stack {
  margin: 0 0 12px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 8ch;
  margin-bottom: 12px;
  font-size: clamp(4.05rem, 18vw, 6.5rem);
  line-height: 0.85;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 6.6vw, 2.25rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hook {
  max-width: 20rem;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: clamp(1.08rem, 4vw, 1.28rem);
  font-weight: 950;
  line-height: 1.15;
}

.subcopy,
.safety-note,
.footer-line,
.feedback-line,
.share-status {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.25;
}

.challenge-card {
  display: grid;
  gap: 3px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: var(--border);
  border-radius: 8px;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
}

.challenge-card strong {
  font-size: 0.96rem;
  font-weight: 950;
}

.challenge-card span {
  font-size: 0.86rem;
  font-weight: 850;
}

.safety-note {
  margin: 12px 0 0;
  text-align: center;
}

.footer-line {
  min-height: 34px;
  margin-top: auto;
  gap: 12px;
}

.game-screen {
  gap: 9px;
}

.game-tools {
  gap: 10px;
}

.timer-box {
  width: 86px;
  flex: 0 0 86px;
  padding: 8px 6px;
  border: var(--border);
  border-radius: 8px;
  background: var(--cream);
  text-align: center;
  box-shadow: 4px 4px 0 var(--ink);
}

.timer-box.is-warning {
  background: var(--yellow);
}

.timer-box.is-urgent {
  background: var(--red);
  color: var(--cream);
  animation: urgentPulse 380ms ease-in-out infinite alternate;
}

.timer-box span {
  display: block;
  font-size: 1.85rem;
  font-weight: 950;
  line-height: 0.9;
}

.timer-box small {
  color: currentColor;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.meeting-room {
  flex: 0 0 auto;
  padding: 10px;
  border: var(--border);
  border-radius: 10px;
  background: #222831;
  color: var(--cream);
  box-shadow: 6px 6px 0 var(--ink);
}

.meeting-room.is-danger {
  animation: roomShake 260ms ease-in-out 2;
}

.meeting-tiles {
  margin-top: 8px;
}

.meeting-tiles .call-tile {
  min-height: 88px;
  padding: 7px 5px;
}

.meeting-tiles .avatar {
  width: 36px;
  height: 36px;
}

.suspicion-wrap {
  gap: 8px;
  margin-top: 10px;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.suspicion-track i {
  width: 10%;
  transition: width 180ms ease, background 180ms ease;
}

.suspicion-track i.is-hot {
  background: var(--red);
}

.panic-prompt {
  min-height: 43px;
  margin: 0;
  padding: 9px 11px;
  border: var(--border);
  border-radius: 8px;
  background: var(--cream);
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.18;
  box-shadow: 4px 4px 0 var(--ink);
}

.action-area {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: stretch;
  gap: 8px;
}

.item-grid,
.choice-grid,
.combo-grid {
  display: grid;
  gap: 8px;
}

.item-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
}

.choice-grid {
  align-content: center;
}

.combo-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item-button,
.action-button {
  min-height: 66px;
  position: relative;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 9px 8px;
  border: var(--border);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, opacity 120ms ease;
}

.action-button {
  min-height: 58px;
}

.item-button strong,
.action-button strong {
  font-size: clamp(0.96rem, 4.2vw, 1.1rem);
  font-weight: 950;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.item-button span,
.action-button span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

.item-button.is-done,
.action-button.is-done {
  background: #d8f5df;
  opacity: 0.76;
  box-shadow: none;
}

.item-button.is-wrong,
.action-button.is-wrong {
  background: #ffd8d2;
  animation: roomShake 260ms ease-in-out 2;
}

.feedback-line {
  min-height: 38px;
  margin: 0;
  text-align: center;
}

.check-screen,
.result-screen {
  justify-content: center;
}

.check-card,
.result-card {
  width: 100%;
  text-align: center;
}

.boss-head {
  width: 170px;
  height: 170px;
  position: relative;
  margin: 0 auto 22px;
  border: var(--border);
  border-radius: 50% 50% 42% 42%;
  background: #f5b980;
  box-shadow: 7px 7px 0 var(--ink);
}

.boss-head::before,
.boss-head::after {
  content: "";
  width: 18px;
  height: 18px;
  position: absolute;
  top: 64px;
  border-radius: 50%;
  background: var(--ink);
}

.boss-head::before {
  left: 46px;
}

.boss-head::after {
  right: 46px;
}

.boss-head span {
  width: 70px;
  height: 28px;
  position: absolute;
  left: calc(50% - 35px);
  bottom: 42px;
  border: 4px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 999px 999px;
}

#checkCopy {
  min-height: 54px;
  margin: 16px auto 0;
  max-width: 23rem;
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.3;
}

.result-card {
  padding: 12px;
  border: var(--border);
  border-radius: 10px;
  background: var(--cream);
  box-shadow: 6px 6px 0 var(--ink);
}

.result-card h2 {
  font-size: clamp(2.3rem, 10vw, 3.45rem);
}

.result-summary {
  min-height: 52px;
  margin: 11px auto 14px;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.25;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}

.result-stats div {
  min-height: 78px;
  display: grid;
  align-content: center;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
}

dt {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  font-size: 1.78rem;
  font-weight: 950;
  line-height: 1;
}

.challenge-code {
  display: inline-grid;
  min-height: 32px;
  align-items: center;
  padding: 4px 12px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font-size: 0.82rem;
  font-weight: 950;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.result-actions .primary-button {
  grid-column: 1 / -1;
}

.share-status {
  min-height: 30px;
  margin: 9px 0 0;
  text-align: center;
}

@keyframes liveBlink {
  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.25);
  }
}

@keyframes bossJitter {
  0%,
  100% {
    transform: rotate(0deg);
  }

  45% {
    transform: rotate(-1.2deg) translateX(-1px);
  }

  55% {
    transform: rotate(1.2deg) translateX(1px);
  }
}

@keyframes meterPulse {
  from {
    filter: saturate(1);
  }

  to {
    filter: saturate(1.35) brightness(1.06);
  }
}

@keyframes urgentPulse {
  from {
    transform: rotate(-1deg) scale(1);
  }

  to {
    transform: rotate(1deg) scale(1.06);
  }
}

@keyframes roomShake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

@media (min-width: 720px) {
  .screen {
    width: min(430px, calc((100svh - 40px) * 0.59));
    height: min(780px, calc(100svh - 40px));
    min-height: min(650px, calc(100svh - 40px));
  }
}

@media (max-height: 740px) {
  .screen {
    height: calc(100svh - 24px);
    min-height: 0;
  }

  .meeting-preview {
    flex-basis: clamp(168px, 29svh, 218px);
    margin: 12px 0 10px;
  }

  h1 {
    font-size: clamp(3.15rem, 15vw, 4.9rem);
  }

  .hook {
    font-size: 1rem;
  }

  .subcopy,
  .safety-note,
  .footer-line {
    font-size: 0.8rem;
  }

  .game-screen {
    gap: 7px;
  }

  .meeting-tiles .call-tile {
    min-height: 74px;
  }

  .meeting-tiles .avatar {
    width: 30px;
    height: 30px;
  }

  .panic-prompt {
    min-height: 38px;
    font-size: 0.88rem;
  }

  .item-button,
  .action-button {
    min-height: 54px;
    padding: 7px;
  }

  .item-button strong,
  .action-button strong {
    font-size: 0.9rem;
  }

  .item-button span,
  .action-button span {
    font-size: 0.62rem;
  }

  .result-card {
    padding: 10px;
  }

  .result-stats div {
    min-height: 66px;
  }

  dd {
    font-size: 1.45rem;
  }

  .result-actions {
    gap: 8px;
  }

  .button {
    min-height: 50px;
    font-size: 0.9rem;
  }
}

@media (display-mode: standalone) {
  .app {
    padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
  }
}
