/* ==========================================================================
   Lingua Atlas: "Explorer's Atlas" theme
   Parchment, ink, ocean teal and map red. Passports, stamps and field notes.
   ========================================================================== */

:root {
  --parchment: #f3e9d2;
  --parchment-2: #ecdfc0;
  --parchment-3: #dfcca2;
  --card: #fbf6e8;
  --ink: #1f2a44;
  --ink-2: #3b4562;
  /* Dark enough for small text on parchment (about 5:1). */
  --ink-3: #585d76;
  --line: rgba(31, 42, 68, 0.14);
  --teal: #1f7a7a;
  --teal-2: #14595a;
  --teal-soft: #d4e8e2;
  --red: #b4432f;
  --red-2: #8c3020;
  --red-soft: #f4dbcf;
  --gold: #c9962b;
  --gold-2: #a67a1c;
  --gold-soft: #f3e3b6;
  --green: #2f7d4a;
  --ocean: #bfdad3;
  --ocean-2: #a9cdc5;
  --land: #ead9b2;
  --land-edge: #b9a57c;

  --font-display: "Fraunces Variable", "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-hand: "Caveat Variable", "Caveat", "Segoe Print", cursive;
  --font-ui: "Space Grotesk Variable", "Space Grotesk", "Segoe UI", system-ui, sans-serif;

  --radius: 14px;
  --shadow: 0 1px 0 rgba(31, 42, 68, 0.05), 0 14px 32px -18px rgba(31, 42, 68, 0.45);
  --shadow-lift: 0 2px 0 rgba(31, 42, 68, 0.05), 0 22px 40px -18px rgba(31, 42, 68, 0.55);
  --print: 3px 3px 0 var(--ink);

  --cat-geo: #1f7a7a;
  --cat-climate: #3c78a8;
  --cat-people: #7a4b80;
  --cat-food: #c46a2b;
  --cat-culture: #b4432f;
  --cat-history: #876a3a;
  --cat-language: #2c3a63;

  /* Speckled "rubber stamp" texture used as a mask */
  --stamp-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.5 1.6'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");

  color-scheme: light;
}

.seat-0 {
  --pc: var(--teal);
  --pc-2: var(--teal-2);
  --pc-soft: var(--teal-soft);
}
.seat-1 {
  --pc: var(--red);
  --pc-2: var(--red-2);
  --pc-soft: var(--red-soft);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background-color: var(--parchment);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 250, 235, 0.7), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(150, 110, 50, 0.18), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(31, 122, 122, 0.07) 79px 80px),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(31, 122, 122, 0.07) 79px 80px);
  background-attachment: fixed;
  overflow-x: hidden;
}

.defs {
  position: absolute;
}
.paper {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.9;
}
.paper svg {
  display: block;
}
.compass-watermark {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  width: 560px;
  height: 560px;
  left: -170px;
  bottom: -190px;
  opacity: 0.07;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%231f2a44' stroke-width='1.2'%3E%3Ccircle cx='100' cy='100' r='96'/%3E%3Ccircle cx='100' cy='100' r='80'/%3E%3Ccircle cx='100' cy='100' r='30'/%3E%3Cpath d='M100 4 L112 100 L100 196 L88 100Z M4 100 L100 88 L196 100 L100 112Z' fill='%231f2a44' fill-opacity='.35'/%3E%3Cpath d='M32 32 L106 94 L168 168 L94 106Z M168 32 L106 106 L32 168 L94 94Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

main,
.topbar {
  position: relative;
  z-index: 1;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
p {
  margin: 0;
}
em {
  font-style: italic;
}
a {
  color: var(--teal-2);
}
button {
  font: inherit;
  color: inherit;
}
input {
  font: inherit;
  color: inherit;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}

:focus-visible {
  /* Dark teal, not gold: gold was too faint on parchment to see where you are with a keyboard. */
  outline: 3px solid var(--teal-2);
  outline-offset: 3px;
  border-radius: 6px;
}

.eyebrow {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 3vw, 32px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 4px;
  min-height: 44px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 420px) {
  .brand {
    font-size: 17px;
    gap: 7px;
  }
  .brand-mark {
    width: 22px;
    height: 22px;
  }
}
.brand em {
  color: var(--red);
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background:
    radial-gradient(circle at 30% 35%, var(--land) 0 22%, transparent 23%),
    radial-gradient(circle at 68% 62%, var(--land) 0 18%, transparent 19%), var(--ocean);
  box-shadow: inset -4px -3px 0 rgba(31, 42, 68, 0.15);
}
body[data-screen="title"] .brand {
  visibility: hidden;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.room-chip {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 6px 10px;
  border: 1.5px dashed var(--ink-3);
  border-radius: 8px;
  color: var(--ink-2);
  white-space: nowrap;
}
@media (max-width: 420px) {
  .room-chip {
    letter-spacing: 0.08em;
    padding: 5px 8px;
    font-size: 11px;
  }
}
.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: rgba(251, 246, 232, 0.7);
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}
.icon-btn:hover {
  background: var(--card);
  transform: translateY(-1px);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#sound-btn .mute {
  display: none;
}
#sound-btn[aria-pressed="false"] .wave {
  display: none;
}
#sound-btn[aria-pressed="false"] .mute {
  display: inline;
}

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--print);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.2s;
}
.btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-primary {
  background: var(--ink);
  color: var(--parchment);
}
.btn-primary:hover:not(:disabled) {
  background: #26335a;
}
.btn-secondary {
  background: var(--card);
}
.btn-ghost {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.btn-ghost:hover:not(:disabled) {
  box-shadow: none;
  transform: none;
  color: var(--red);
}
.btn-ghost.btn-small,
.btn-ghost.btn-small:hover:not(:disabled) {
  box-shadow: none;
}
.btn-small {
  padding: 8px 14px;
  font-size: 14px;
  box-shadow: 2px 2px 0 var(--ink);
}
.btn-large {
  padding: 16px 28px;
  font-size: 18px;
}
.btn small {
  display: block;
  font-weight: 500;
  font-size: 13px;
  opacity: 0.75;
}
.btn-primary span + small {
  margin-top: 2px;
}
#create-btn,
.btn-daily {
  flex-direction: column;
  gap: 0;
  padding: 14px 20px;
}
/* The title screen's mode picker: the daily's big button first, then one card per other mode. */
.modes {
  display: grid;
  gap: 12px;
  animation: screen-in 0.35s ease;
}
.modes[hidden] {
  display: none;
}
.mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 16px;
  text-align: left;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  background: rgba(251, 246, 232, 0.92);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.mode-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}
.mode-card:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}
.mode-card:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}
.mode-card[hidden] {
  display: none;
}
/* "Install the app": quieter than the modes above it (dashed, no print shadow), so it reads as a tip. */
.install-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border: 1.5px dashed var(--ink-3);
  border-radius: var(--radius);
  background: rgba(251, 246, 232, 0.7);
}
.install-icon {
  flex: none;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--teal-2);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.install-text {
  display: grid;
  flex: 1;
  gap: 1px;
  min-width: 0;
  margin: 0;
}
.install-text strong {
  font-size: 15px;
}
.install-text small {
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink-2);
}
.install-btn {
  flex: none;
  padding: 7px 14px;
  font-size: 14px;
  box-shadow: 2px 2px 0 var(--ink);
}
/* A small inked emblem, like a stamp in the margin of a passport page. */
.mode-icon {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 7px;
  border: 1.5px dashed var(--teal);
  border-radius: 50%;
  fill: none;
  stroke: var(--teal-2);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  background: var(--teal-soft);
}
.mode-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.mode-text strong {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
}
.mode-text small {
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink-2);
}
.panel-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}
.btn-daily {
  padding: 18px 20px;
  font-size: 19px;
  background: var(--red);
  border-color: var(--red-2);
  box-shadow: 3px 3px 0 var(--red-2);
}
.btn-daily:hover:not(:disabled) {
  background: var(--red-2);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn-daily small {
  font-size: 14px;
  opacity: 0.9;
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-row > * {
  flex: 1 1 0;
}
.btn-row.center {
  justify-content: center;
}
.btn-row.center > * {
  flex: 0 0 auto;
}
.btn-stack {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}
.field > span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 17px;
  background: var(--card);
  border: 2px solid var(--ink-2);
  border-radius: 10px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(31, 122, 122, 0.18);
}
.field.seat-0 input {
  border-color: var(--teal);
}
.field.seat-1 input {
  border-color: var(--red);
}
.code-input {
  font-family: var(--font-display);
  font-size: 28px !important;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-weight: 700;
}

/* ---------- Screens ---------- */
.screen {
  display: none;
}
.screen[data-active] {
  display: block;
  animation: screen-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Title ---------- */
#screen-title {
  position: relative;
  /* The globe deliberately bleeds off the right edge; clip it there so the page never scrolls sideways. */
  overflow-x: clip;
  min-height: calc(100dvh - 70px);
  padding: clamp(8px, 3vh, 40px) clamp(16px, 5vw, 72px) 40px;
}
.title-globe {
  position: absolute;
  right: -6vw;
  top: 50%;
  transform: translateY(-52%);
  width: min(62vw, 820px);
  height: min(62vw, 820px);
  pointer-events: none;
}
.title-card {
  position: relative;
  max-width: 470px;
  display: grid;
  gap: 22px;
  padding-top: clamp(0px, 4vh, 48px);
}
.title {
  font-size: clamp(64px, 11vw, 132px);
  line-height: 0.86;
  font-weight: 800;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.035em;
}
.title em {
  display: block;
  color: var(--red);
  font-weight: 600;
  margin-left: 0.5em;
}
.tagline {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.4;
  color: var(--ink-2);
  font-weight: 400;
}
.panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: rgba(251, 246, 232, 0.88);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(2px);
  animation: screen-in 0.35s ease;
}
.panel-note {
  color: var(--ink-2);
  font-size: 15px;
}
/* "Continue as Ana" when this browser already has a seat in the room. */
.rejoin {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px dashed var(--ink-3);
}
.rejoin .btn {
  width: 100%;
}
/* Short phones (an iPhone SE or a 14 with the browser bars showing are ~665px tall): the same look, tightened,
   so all four ways to play fit on the first screen. The install tip sits below them and may scroll. */
@media (max-width: 500px) and (max-height: 760px) {
  #screen-title {
    padding-top: 6px;
  }
  .title-card {
    gap: 14px;
    padding-top: 0;
  }
  .title {
    font-size: 54px;
  }
  .tagline {
    font-size: 17px;
    line-height: 1.35;
  }
  .modes {
    gap: 10px;
  }
  .btn-daily {
    padding: 13px 18px;
  }
  .mode-card {
    padding: 10px 14px;
  }
}
.title-foot {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
/* Privacy, terms and credits (#141), under the title and in the daily's footer. */
.site-links a {
  color: inherit;
}

/* ---------- Lobby ---------- */
.lobby {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(8px, 3vh, 32px) 16px 48px;
  display: grid;
  gap: 36px;
  justify-items: center;
}
.boarding-pass {
  display: grid;
  grid-template-columns: 1fr auto;
  width: min(640px, 100%);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--print);
  overflow: hidden;
  transform: rotate(-1deg);
}
.bp-main {
  padding: 22px 24px;
  display: grid;
  gap: 10px;
}
.bp-label {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.bp-gate {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.bp-gate span {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}
.bp-gate strong {
  font-family: var(--font-display);
  font-size: clamp(54px, 10vw, 76px);
  line-height: 1;
  letter-spacing: 0.14em;
  font-weight: 800;
}
/* The lobby's big "Share invite": opens the share sheet on a phone, copies the link elsewhere. */
.btn-share {
  gap: 10px;
  padding: 14px 20px;
  font-size: 18px;
  width: 100%;
}
.btn-share svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bp-help {
  font-size: 14px;
  color: var(--ink-2);
}
.bp-link {
  display: flex;
  gap: 8px;
}
.bp-link input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  font-size: 14px;
  border: 1.5px dashed var(--ink-3);
  border-radius: 8px;
  background: var(--parchment);
}
.bp-stub {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 18px 22px;
  border-left: 2px dashed var(--ink-3);
  background: var(--gold-soft);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-2);
}
.bp-stub strong {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 8px;
}
.barcode {
  width: 84px;
  height: 34px;
  margin-top: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0 2px,
    transparent 2px 4px,
    var(--ink) 4px 5px,
    transparent 5px 8px,
    var(--ink) 8px 11px,
    transparent 11px 12px
  );
}

.lobby-passports {
  display: grid;
  grid-template-columns: 1fr minmax(80px, 200px) 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.flight-path {
  width: 100%;
  overflow: visible;
}
.flight-path path#flight-path-line {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 2;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
}
.flight-path .plane {
  fill: var(--ink);
  opacity: 0;
}
.lobby-passports.ready .flight-path .plane {
  opacity: 1;
  offset-path: path("M10 60 Q100 -10 190 60");
  animation: fly 2.8s ease-in-out infinite;
}
.lobby-passports.ready path#flight-path-line {
  animation: dash 1.2s linear infinite;
  stroke: var(--teal);
}
@keyframes fly {
  0% {
    offset-distance: 0%;
  }
  100% {
    offset-distance: 100%;
  }
}
@keyframes dash {
  to {
    stroke-dashoffset: -18;
  }
}

.passport {
  position: relative;
  aspect-ratio: 5 / 7;
  width: min(220px, 100%);
  justify-self: center;
  display: grid;
  align-content: space-between;
  justify-items: center;
  text-align: center;
  padding: 22px 16px;
  border-radius: 10px 16px 16px 10px;
  background: linear-gradient(160deg, #26345a, #19223b);
  color: var(--gold-soft);
  box-shadow:
    inset 6px 0 0 rgba(0, 0, 0, 0.25),
    var(--shadow-lift);
  outline: 2px solid var(--gold);
  outline-offset: -10px;
  animation: passport-in 0.6s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.passport::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: var(--pc);
  border-radius: 10px 0 0 10px;
}
.passport .pp-label {
  font-size: 11px;
  letter-spacing: 0.32em;
  font-weight: 600;
  color: var(--gold);
}
.passport .pp-emblem {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  position: relative;
}
.passport .pp-emblem::before,
.passport .pp-emblem::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
}
.passport .pp-emblem::after {
  inset: 0 22px;
  border-radius: 50%;
}
.passport .pp-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #fff8e6;
  word-break: break-word;
}
.passport .pp-seat {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pc-soft);
}
.passport.empty {
  background: transparent;
  color: var(--ink-3);
  outline: none;
  box-shadow: none;
  border: 2px dashed var(--ink-3);
  animation: none;
}
.passport.empty::after {
  display: none;
}
.passport.empty .pp-name {
  color: var(--ink-3);
  font-size: 17px;
  font-weight: 500;
  font-style: italic;
}
.passport.offline {
  filter: grayscale(0.8) brightness(0.9);
}
@keyframes passport-in {
  from {
    transform: translateY(20px) rotate(-6deg) scale(0.9);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.lobby.local .boarding-pass {
  display: none;
}
.lobby-actions {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

/* Room rules */
.rules-card {
  width: min(640px, 100%);
  display: grid;
  gap: 14px;
  padding: 20px 22px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.rules-card h2 {
  font-size: 24px;
}
.rules-sub {
  font-size: 14px;
  color: var(--ink-3);
  margin-top: -8px;
}
.rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1.5px dashed var(--line);
}
.rule-label {
  font-weight: 700;
  display: grid;
}
.rule-label small {
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-3);
}
.seg {
  display: inline-flex;
  border: 2px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 2px 2px 0 var(--ink);
}
.seg button {
  min-width: 46px;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  background: var(--card);
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  border-right: 1.5px solid var(--ink);
  transition:
    background 0.15s,
    color 0.15s;
}
.seg button:last-child {
  border-right: 0;
}
/* Inside the box: .seg clips anything drawn outside it. */
.seg button:focus-visible {
  outline-offset: -5px;
}
.seg button:hover {
  background: var(--parchment-2);
}
.seg button[aria-checked="true"] {
  background: var(--ink);
  color: var(--parchment);
}
.seg-wide button {
  font-size: 14px;
  padding: 8px 12px;
}
.rules-card.flash {
  animation: flash 0.8s ease;
}
@keyframes flash {
  30% {
    box-shadow:
      0 0 0 4px var(--gold),
      var(--shadow);
  }
}

/* Guesses left on the mini passports */
.guess-dots {
  display: inline-flex;
  gap: 4px;
  vertical-align: middle;
  margin-left: 2px;
}
.guess-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 1.5px rgba(255, 248, 230, 0.4);
}
.guess-dots i.used {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(255, 248, 230, 0.45);
}

.must-guess {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
  background: var(--red-soft);
  border: 2px dashed var(--red);
  color: var(--red-2);
  animation: screen-in 0.4s ease;
}
.must-guess strong {
  font-family: var(--font-display);
  font-size: 20px;
}
.foot-buttons {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

/* Cycle timer: a ring that drains as time runs out */
.cycle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 2px;
}
.cycle-timer {
  --p: 1;
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--teal) calc(var(--p) * 360deg), rgba(31, 42, 68, 0.12) 0);
}
.cycle-timer::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.cycle-timer span {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
/* "No timer" fits inside the ring, on two short lines. */
.cycle-timer.untimed span {
  max-width: 40px;
  font-size: 11px;
  line-height: 1.05;
  text-align: center;
}
.cycle-timer.urgent {
  background: conic-gradient(var(--red) calc(var(--p) * 360deg), rgba(180, 67, 47, 0.15) 0);
  animation: tick-pulse 1s ease-in-out infinite;
}
.cycle-timer.urgent span {
  color: var(--red);
}
@keyframes tick-pulse {
  50% {
    transform: scale(1.06);
  }
}
.cycle-chip {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  max-width: 170px;
  text-align: left;
  line-height: 1.25;
}
.mini-passport.found {
  box-shadow:
    0 0 0 3px var(--gold),
    var(--shadow);
}
/* Shared screen: dim the player who isn't holding the phone right now. */
.mini-passport.shared:not(.active) {
  opacity: 0.75;
}
.note.n-found strong {
  color: var(--gold-2);
}
.result-pill {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--pc-soft);
  color: var(--pc-2);
}
.reveal-result:has(.result-pill) {
  background: none;
  padding: 0;
}
/* When it's time to guess, bring the guess buttons up under the banner. */
.col-deck.guess-time .deck-head {
  order: -3;
}
.col-deck.guess-time .must-guess {
  order: -2;
}
.col-deck.guess-time .deck-foot {
  order: -1;
  margin: 0 0 6px;
}
.col-deck.guess-time .deck-cards {
  opacity: 0.6;
}
.btn-globe {
  padding: 14px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  background: var(--teal);
  color: #f6fbf9;
}
.btn-globe:hover:not(:disabled) {
  background: var(--teal-2);
}
.btn-globe svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
/* The pulsing rings (Guess, and Play when blocked) fade a ring drawn once, instead of animating a
   box-shadow: a shadow animation repaints the button every frame, which kept slow phones (and
   browsers drawing without a GPU) busy for as long as the button waited (#195). */
.btn-guess.pulse,
.play-btn.nudge {
  position: relative;
}
.btn-guess.pulse::after,
.play-btn.nudge::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  box-shadow: 0 0 0 8px rgba(180, 67, 47, 0.2);
  opacity: 0;
  pointer-events: none;
  animation: ring-pulse 1.4s ease-in-out infinite;
}
.play-btn.nudge::after {
  box-shadow: 0 0 0 10px rgba(180, 67, 47, 0.18);
}
@keyframes ring-pulse {
  50% {
    opacity: 1;
  }
}
.lobby-status {
  color: var(--ink-2);
  font-size: 15px;
}

/* ---------- Round ---------- */
#screen-round {
  padding: 0 clamp(12px, 2.5vw, 28px) 32px;
  max-width: 1400px;
  margin: 0 auto;
}
.round-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.round-meta {
  text-align: center;
}
.round-number {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
}
.turns-left {
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.mini-passport {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(160deg, #26345a, #19223b);
  color: var(--gold-soft);
  box-shadow: var(--shadow);
  position: relative;
  min-width: 0;
  transition:
    transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1),
    box-shadow 0.35s;
  border-left: 6px solid var(--pc);
}
.mini-passport.seat-1 {
  flex-direction: row-reverse;
  text-align: right;
  border-left: 0;
  border-right: 6px solid var(--pc);
}
.mini-passport .mp-score {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  min-width: 1.2em;
  text-align: center;
}
.mini-passport .mp-text {
  display: grid;
  min-width: 0;
}
.mini-passport .mp-name {
  font-family: var(--font-display);
  font-size: 18px;
  color: #fff8e6;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-passport .mp-pot {
  font-size: 12px;
  color: var(--pc-soft);
  letter-spacing: 0.04em;
}
.mini-passport.active {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 3px var(--pc),
    var(--shadow-lift);
}
.mini-passport.active::before {
  content: var(--badge, "You");
  position: absolute;
  top: -10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--pc);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
}
.mini-passport.seat-0.active::before {
  left: 14px;
}
.mini-passport.seat-1.active::before {
  right: 14px;
}
.mini-passport.offline {
  opacity: 0.6;
}
.mini-passport.offline .mp-pot::after {
  content: " · offline";
}
.mini-passport.bump .mp-score {
  animation: bump 0.6s ease;
}
@keyframes bump {
  40% {
    transform: scale(1.5);
    color: #fff;
  }
}

.round-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

/* Speaker */
.col-speaker {
  display: grid;
  gap: 18px;
}
.speaker-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}
.speaker-photo {
  position: relative;
  justify-self: center;
  width: 150px;
  aspect-ratio: 1;
  padding: 10px 10px 26px;
  background: #fffdf6;
  box-shadow: 0 6px 16px -8px rgba(31, 42, 68, 0.5);
  transform: rotate(-2.5deg);
}
.speaker-photo svg {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #d9e6e2, #c4d6d1);
  fill: var(--ink-3);
  opacity: 0.9;
}
.mystery-stamp {
  position: absolute;
  right: -16px;
  bottom: 6px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 3px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 900;
  transform: rotate(14deg);
  background: rgba(244, 219, 207, 0.5);
  -webkit-mask: var(--stamp-mask);
  mask: var(--stamp-mask);
}
.speaker-caption {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.waveform {
  width: 100%;
  height: 64px;
  display: block;
}
.speaker-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}
.play-btn {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--print);
  transition:
    transform 0.12s,
    box-shadow 0.12s,
    background 0.2s;
}
.play-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.play-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.play-btn svg {
  width: 26px;
  height: 26px;
  fill: var(--parchment);
}
.play-btn .icon-pause {
  display: none;
}
.play-btn.playing {
  background: var(--red);
}
.play-btn.playing .icon-play {
  display: none;
}
.play-btn.playing .icon-pause {
  display: inline;
}
.play-label {
  font-weight: 700;
}
.play-sub {
  font-size: 13px;
  color: var(--ink-3);
}

.compass-box {
  display: grid;
  justify-items: center;
  gap: 10px;
}
.compass {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--card) 0 55%, var(--parchment-2) 56% 100%);
  border: 2px solid var(--ink);
  box-shadow:
    inset 0 0 0 6px var(--card),
    inset 0 0 0 7px var(--ink-3),
    var(--shadow);
}
.compass span {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-2);
}
.cp-n {
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--red) !important;
}
.cp-s {
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
}
.cp-e {
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
}
.cp-w {
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
}
.needle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 84px;
  margin: -42px 0 0 -8px;
  transform: rotate(var(--needle, 0deg));
  transition: transform 1.1s cubic-bezier(0.3, 1.7, 0.45, 1);
}
.needle::before,
.needle::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 42px;
}
.needle::before {
  top: 0;
  background: var(--needle-color, var(--red));
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.needle::after {
  bottom: 0;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.compass::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--ink);
}
.turn-label {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  text-align: center;
}
.turn-label b {
  color: var(--pc);
}

/* Deck */
.col-deck {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.deck-head {
  display: grid;
  gap: 4px;
}
.deck-head h2 {
  font-size: 26px;
}
.deck-hint {
  font-size: 14px;
  color: var(--ink-2);
}
.deck-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 7px 12px 7px 9px;
  border-radius: 999px;
  border: 1.5px solid var(--cat);
  background: var(--card);
  color: var(--cat);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.15s;
}
.tab:hover {
  transform: translateY(-1px);
}
.tab[aria-selected="true"] {
  background: var(--cat);
  color: #fff;
}
.tab svg,
.card-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab .count {
  font-size: 11px;
  opacity: 0.8;
}

.deck-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.q-card {
  position: relative;
  text-align: left;
  min-height: 112px;
  padding: 16px 16px 14px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  background:
    repeating-linear-gradient(180deg, transparent 0 25px, rgba(60, 120, 168, 0.12) 25px 26px) 0 38px / 100% calc(100% - 38px) no-repeat,
    var(--card);
  border: 1.5px solid var(--line);
  border-top: 6px solid var(--cat);
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition:
    transform 0.2s cubic-bezier(0.2, 1.4, 0.4, 1),
    box-shadow 0.2s;
}
.deck-cards.dealing .q-card {
  animation: deal 0.45s cubic-bezier(0.2, 1.2, 0.4, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.q-card:nth-child(odd):hover:not(:disabled) {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: var(--shadow-lift);
}
.q-card:nth-child(even):hover:not(:disabled) {
  transform: translateY(-4px) rotate(1deg);
  box-shadow: var(--shadow-lift);
}
.q-card .q-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.q-card .card-icon {
  color: var(--cat);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.q-card .cost {
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 600;
}
.q-card:disabled {
  cursor: not-allowed;
}
.q-card.used {
  opacity: 0.55;
  filter: saturate(0.4);
}
.q-card.used::after {
  content: "USED";
  position: absolute;
  right: 12px;
  top: 40%;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.12em;
  color: var(--red);
  border: 3px solid var(--red);
  border-radius: 6px;
  padding: 0 8px;
  transform: rotate(-14deg);
  -webkit-mask: var(--stamp-mask);
  mask: var(--stamp-mask);
}
.deck-locked .q-card:not(.used) {
  filter: saturate(0.7);
  opacity: 0.85;
}
@keyframes deal {
  from {
    opacity: 0;
    transform: translateY(14px) rotate(-3deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ask-form {
  display: flex;
  gap: 8px;
}
/* Shared screen: hand the turn on without asking (more) questions. */
.skip-ask {
  justify-self: start;
  margin-top: 8px;
}
.ask-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--ink-2);
  background: var(--card);
}
.ask-form input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(31, 122, 122, 0.18);
}

.ask-note {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: -6px;
}
.deck-foot {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.btn-guess {
  justify-self: stretch;
  padding: 16px 22px;
  font-size: 19px;
  font-family: var(--font-display);
  font-weight: 700;
  background: var(--red);
  color: #fff8ee;
  border-color: var(--ink);
}
.btn-guess:hover:not(:disabled) {
  background: var(--red-2);
}
.btn-guess svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transition: transform 0.3s;
}
.btn-guess:hover:not(:disabled) svg {
  transform: translate(4px, -3px) rotate(8deg);
}
.guess-hint {
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}
.waiting-note {
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  background: var(--pc-soft, var(--parchment-2));
  color: var(--pc-2, var(--ink-2));
}
.thinking::after {
  content: "…";
  display: inline-block;
  animation: dots 1.2s steps(4) infinite;
  width: 1.2em;
  text-align: left;
  overflow: hidden;
  vertical-align: bottom;
}
@keyframes dots {
  from {
    width: 0;
  }
  to {
    width: 1.2em;
  }
}

/* Notebook */
.col-notes {
  min-width: 0;
}
.notebook {
  position: relative;
  padding: 30px 18px 22px 44px;
  border-radius: 6px 14px 14px 6px;
  background:
    linear-gradient(90deg, transparent 0 32px, rgba(180, 67, 47, 0.45) 32px 33.5px, transparent 33.5px),
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(60, 120, 168, 0.18) 31px 32px) 0 62px / 100% 100%,
    #fdf9ee;
  box-shadow:
    var(--shadow),
    inset 0 0 40px rgba(201, 150, 43, 0.12);
  border: 1.5px solid var(--line);
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.notebook::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 18px;
  bottom: 18px;
  width: 12px;
  background: radial-gradient(circle, var(--parchment-3) 0 4px, transparent 5px) 0 0 / 12px 32px repeat-y;
}
.notebook-title {
  font-family: var(--font-hand);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 10px;
  color: var(--ink);
}
.notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.note {
  animation: write 0.6s ease both;
}
.note .n-who {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pc);
}
.note .n-q {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}
.note .n-a {
  font-family: var(--font-hand);
  font-size: 23px;
  line-height: 1.12;
  color: var(--ink);
  margin-top: 2px;
}
.note.n-guess {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 15px;
}
.note.n-system {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-3);
}
.mini-stamp {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.12em;
  padding: 1px 7px;
  border: 2.5px solid currentColor;
  border-radius: 5px;
  transform: rotate(-6deg);
  -webkit-mask: var(--stamp-mask);
  mask: var(--stamp-mask);
}
.mini-stamp.denied {
  color: var(--red);
}
.mini-stamp.close {
  color: var(--gold-2);
}
.mini-stamp.arrived {
  color: var(--green);
}
.mini-stamp.sealed {
  color: var(--ink-3);
}
.mini-stamp.timeout {
  color: var(--ink-3);
}
.note.n-locked strong {
  color: var(--ink-2);
}
.notes-empty {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-3);
}
@keyframes write {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

/* ---------- Big stamp overlay ---------- */
.stamp-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.big-stamp {
  --stamp: var(--red);
  opacity: 0;
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  font-size: clamp(54px, 11vw, 132px);
  line-height: 0.95;
  letter-spacing: 0.08em;
  color: var(--stamp);
  border: clamp(6px, 1vw, 10px) solid var(--stamp);
  border-radius: 18px;
  padding: 0.12em 0.35em 0.1em;
  background: rgba(253, 249, 238, 0.35);
  -webkit-mask: var(--stamp-mask);
  mask: var(--stamp-mask);
}
.big-stamp small {
  display: block;
  font-size: 0.24em;
  letter-spacing: 0.2em;
  font-weight: 700;
}
.big-stamp.show {
  animation: slam 1.7s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
.big-stamp.denied {
  --stamp: var(--red);
}
.big-stamp.close {
  --stamp: var(--gold-2);
}
.big-stamp.arrived {
  --stamp: var(--green);
}
.big-stamp.timeout {
  --stamp: var(--ink-2);
}
@keyframes slam {
  0% {
    opacity: 0;
    transform: scale(2.6) rotate(-2deg);
  }
  14% {
    opacity: 1;
    transform: scale(0.94) rotate(-11deg);
  }
  20% {
    transform: scale(1.02) rotate(-10deg);
  }
  26%,
  78% {
    opacity: 1;
    transform: scale(1) rotate(-10deg);
  }
  100% {
    opacity: 0;
    transform: scale(1) rotate(-10deg);
  }
}
body.shake #app {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes shake {
  15%,
  85% {
    transform: translateX(-2px);
  }
  30%,
  70% {
    transform: translateX(5px);
  }
  45%,
  55% {
    transform: translateX(-7px);
  }
}

/* ---------- Pass the device ---------- */
.pass-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(25, 34, 59, 0.92);
  backdrop-filter: blur(6px);
  animation: screen-in 0.4s ease;
}
.pass-card {
  width: min(480px, 100%);
  display: grid;
  gap: 18px;
  text-align: center;
  padding: 32px 26px;
  background: var(--card);
  border-radius: 20px;
  border-top: 10px solid var(--pc);
  box-shadow: var(--shadow-lift);
}
.pass-card h2 {
  font-size: clamp(34px, 7vw, 48px);
  line-height: 1.05;
}
.pass-card h2 b {
  color: var(--pc);
}
.pass-last {
  text-align: left;
  padding: 14px 16px;
  background: #fdf9ee;
  border-radius: 10px;
  border: 1.5px solid var(--line);
}
.pass-last:empty {
  display: none;
}
.pass-last .n-q {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}
.pass-last .n-a {
  font-family: var(--font-hand);
  font-size: 24px;
  line-height: 1.15;
}

/* End-of-cycle results card */
.results-card {
  border-top-color: var(--gold);
}
.results-card .eyebrow {
  color: var(--gold-2);
}
.cycle-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.cycle-results li {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  font-size: 16px;
  padding-left: 10px;
  border-left: 4px solid var(--pc);
}
.cycle-results .cr-who {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pc);
}
.cycle-results .cr-what {
  flex: 1 1 auto;
}
.cycle-results .mini-stamp {
  margin-left: auto;
}
.cr-tip {
  margin: 12px 0 0;
  font-family: var(--font-hand);
  font-size: 23px;
  line-height: 1.15;
  color: var(--green);
}
.pass-next {
  margin: 0;
  font-size: 14px;
  color: var(--ink-3);
}
.pass-next:empty {
  display: none;
}

/* ---------- Guess dialog ---------- */
dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
}
dialog::backdrop {
  background: rgba(25, 34, 59, 0.6);
  backdrop-filter: blur(3px);
}
.guess-dialog[open] {
  animation: screen-in 0.3s ease;
}
.guess-inner {
  width: min(900px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 24px;
  background: var(--card);
  border-radius: 18px;
  border: 2px solid var(--ink);
  box-shadow: var(--print);
}
.guess-left {
  display: grid;
  gap: 12px;
  grid-template-rows: auto auto 1fr;
  min-height: 0;
}
.guess-left h2 {
  font-size: 26px;
}
#guess-search {
  padding: 12px 14px;
  font-size: 17px;
  border-radius: 10px;
  border: 2px solid var(--ink-2);
  background: #fffdf6;
}
#guess-search:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(31, 122, 122, 0.18);
}
.guess-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  height: 340px;
  overflow-y: auto;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fffdf6;
}
.guess-list li {
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.guess-list li:hover {
  background: var(--teal-soft);
}
.guess-list li[aria-selected="true"] {
  background: var(--ink);
  color: var(--parchment);
}
.guess-list li.wrong {
  color: var(--ink-3);
  text-decoration: line-through;
  cursor: not-allowed;
  background: none;
}
.guess-list li.wrong::after {
  content: "tried";
  font-size: 12px;
  text-decoration: none;
}
.guess-right {
  display: grid;
  gap: 14px;
  justify-items: center;
  align-content: center;
}
#guess-globe {
  width: min(320px, 100%);
  aspect-ratio: 1;
}
.guess-selected {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  min-height: 1.3em;
}
.guess-right .btn-row {
  width: 100%;
}

/* Globe explorer */
.explorer-dialog[open] {
  animation: screen-in 0.3s ease;
}
.explorer {
  width: min(1180px, calc(100vw - 24px));
  height: min(820px, calc(100dvh - 24px));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  padding: 18px 20px;
  background: var(--card);
  border-radius: 18px;
  border: 2px solid var(--ink);
  box-shadow: var(--print);
}
.explorer-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.explorer-top > div {
  flex: 1 1 220px;
}
.explorer-top h2 {
  font-size: 26px;
}
.explorer-sub {
  font-size: 13px;
  color: var(--ink-3);
}
#explorer-search {
  flex: 0 1 280px;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid var(--ink-2);
  background: #fffdf6;
  font-size: 16px;
}
#explorer-search:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(31, 122, 122, 0.18);
}
.icon-btn svg path {
  fill: none;
}
#explorer-close svg,
.zoom-controls svg {
  stroke: var(--ink);
  stroke-width: 2;
  fill: none;
}
.explorer-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  min-height: 0;
}
.explorer-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  container-type: size;
}
/* Square globe that fits the stage both ways */
#explorer-globe {
  width: min(100cqw, 100cqh);
  height: min(100cqw, 100cqh);
  display: block;
}
.zoom-controls {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  gap: 8px;
}
.zoom-controls .icon-btn {
  background: var(--card);
  box-shadow: var(--shadow);
}
.hover-name {
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  pointer-events: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(251, 246, 232, 0.92);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.15s;
}
.hover-name.show {
  opacity: 1;
}
.explorer-side {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow-y: auto;
  min-height: 0;
}
.picked {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: #fffdf6;
  border: 1.5px solid var(--line);
  border-radius: 14px;
}
.picked-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
}
.picked-status {
  font-size: 14px;
  color: var(--ink-3);
  min-height: 1.2em;
}
.mark-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mark-buttons .btn {
  flex: 1 1 auto;
}
.mark-out[aria-pressed="true"] {
  background: var(--ink-2);
  color: var(--parchment);
}
.mark-maybe[aria-pressed="true"] {
  background: var(--gold);
  color: #3d2b04;
}
#explorer-guess {
  font-size: 17px;
  padding: 12px 16px;
}
.explorer-guess-note {
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sw {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid rgba(31, 42, 68, 0.3);
}
.sw-maybe {
  background: rgba(201, 150, 43, 0.85);
}
.sw-out {
  background: rgba(31, 42, 68, 0.42);
}
.sw-wrong {
  background: rgba(31, 42, 68, 0.28);
}
.maybe-list {
  display: grid;
  gap: 8px;
}
.private {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-3);
  margin-left: 6px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--gold-2);
  background: var(--gold-soft);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.chip:hover {
  background: var(--gold);
}
.chips-empty {
  font-family: var(--font-hand);
  font-size: 20px;
  color: var(--ink-3);
}
#marks-reset {
  justify-self: start;
  font-size: 13px;
  padding: 4px 0;
}

.credits-dialog form {
  width: min(560px, calc(100vw - 24px));
  padding: 26px;
  display: grid;
  gap: 16px;
  background: var(--card);
  border-radius: 18px;
  border: 2px solid var(--ink);
  box-shadow: var(--print);
}
.credits-dialog ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 15px;
}
.credits-dialog .credits-note {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}
.credits-dialog .btn {
  justify-self: end;
}

/* ---------- Reveal ---------- */
.reveal {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
}
.reveal-globe-wrap {
  position: relative;
}
#reveal-globe {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  max-width: 620px;
  margin: 0 auto;
}
.reveal-card {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 3vw, 32px);
  background: var(--card);
  border-radius: 18px;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-lift);
  position: relative;
}
.reveal-card > * {
  animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.reveal-card > *:nth-child(2) {
  animation-delay: 0.9s;
}
.reveal-card > *:nth-child(3) {
  animation-delay: 1.05s;
}
.reveal-card > *:nth-child(4) {
  animation-delay: 1.2s;
}
.reveal-card > *:nth-child(5) {
  animation-delay: 1.35s;
}
.reveal-card > *:nth-child(6) {
  animation-delay: 1.5s;
}
.reveal-card > *:nth-child(7) {
  animation-delay: 1.65s;
}
.reveal-card > *:nth-child(8) {
  animation-delay: 1.8s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.reveal-result {
  justify-self: start;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--pc-soft, var(--parchment-2));
  color: var(--pc-2, var(--ink-2));
}
.reveal-name {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1;
  font-weight: 800;
  font-variation-settings: "opsz" 144;
}
.reveal-name img {
  flex: none;
  width: 54px;
  height: auto;
  border-radius: 4px;
  box-shadow:
    0 0 0 1.5px var(--line),
    0 4px 10px -4px rgba(31, 42, 68, 0.5);
  transform: rotate(-4deg);
}
.reveal-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}
.reveal-facts div {
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fffdf6;
}
.reveal-facts dt {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.reveal-facts dd {
  margin: 0;
  font-weight: 700;
  font-size: 17px;
}
.reveal-quote {
  margin: 0;
  padding: 4px 0 4px 18px;
  border-left: 4px solid var(--gold);
  display: grid;
  gap: 6px;
}
.reveal-quote .original {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.35;
}
.reveal-quote .translation {
  font-family: var(--font-hand);
  font-size: 23px;
  line-height: 1.15;
  color: var(--ink-2);
}
.reveal-persona {
  color: var(--ink-2);
}
/* The reveal's postcard: a fact about the country on the left, a line about the language on the
   right under a little rubber stamp. Shared by the game and the daily. */
.postcard {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: #fffdf6;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.postcard[hidden],
.postcard-side[hidden] {
  display: none;
}
.postcard-side {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px 16px;
  min-width: 0;
}
.postcard-note {
  display: block; /* so the line can wrap around the stamp */
  border-left: 2px dashed var(--line);
}
.postcard-note .postcard-line {
  margin-top: 4px;
}
.postcard:has(.postcard-side[hidden]) {
  grid-template-columns: 1fr;
}
.postcard:has(.postcard-side[hidden]) .postcard-note {
  border-left: 0;
}
.postcard-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.2em;
  font-weight: 700;
  text-transform: uppercase;
  color: #7a5810;
}
.postcard-fact {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}
.postcard-line {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 21px;
  line-height: 1.15;
  color: var(--ink-2);
}
.postcard-stamp {
  float: right;
  display: grid;
  place-items: center;
  min-width: 56px;
  max-width: 104px;
  min-height: 42px;
  margin: 0 0 8px 12px;
  padding: 4px 6px;
  border: 2px solid var(--red);
  border-radius: 4px;
  outline: 2px dotted var(--red-soft);
  outline-offset: 2px;
  color: var(--red);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(6deg);
  -webkit-mask: var(--stamp-mask);
  mask: var(--stamp-mask);
}
.postcard-stamp:empty {
  display: none;
}
@media (max-width: 560px) {
  .postcard {
    grid-template-columns: 1fr;
  }
  .postcard-note {
    border-left: 0;
    border-top: 2px dashed var(--line);
  }
}
#next-btn {
  justify-self: start;
}

/* ---------- Final ---------- */
#screen-final {
  position: relative;
  overflow: hidden;
  min-height: calc(100dvh - 70px);
}
.final {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto;
  padding: 8px 16px 48px;
  display: grid;
  gap: 26px;
  justify-items: center;
  text-align: center;
}
.final-title {
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1;
  font-weight: 800;
  font-variation-settings: "opsz" 144;
}
.final-title b {
  color: var(--pc);
}
.final-passports {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
}
.open-passport {
  position: relative;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  text-align: left;
  background: #fdf9ee;
  border-radius: 10px;
  box-shadow: var(--shadow-lift);
  border: 1.5px solid var(--line);
  min-height: 260px;
  animation: passport-in 0.7s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.open-passport:nth-child(2) {
  animation-delay: 0.15s;
}
.open-passport .page {
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.open-passport .page:first-child {
  border-right: 2px dashed var(--line);
  background: linear-gradient(90deg, transparent 85%, rgba(31, 42, 68, 0.05));
}
.open-passport .op-label {
  font-size: 11px;
  letter-spacing: 0.26em;
  font-weight: 700;
  color: var(--pc);
}
.open-passport .op-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  word-break: break-word;
}
.open-passport .op-score {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  color: var(--pc);
}
.open-passport .op-score small {
  font-size: 16px;
  color: var(--ink-3);
  font-weight: 600;
}
.stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}
.stamp {
  --sc: var(--teal);
  display: grid;
  place-items: center;
  text-align: center;
  width: 92px;
  height: 92px;
  padding: 8px;
  border: 4px double var(--sc);
  border-radius: 50%;
  color: var(--sc);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  line-height: 1.05;
  text-transform: uppercase;
  transform: rotate(var(--rot, -8deg));
  -webkit-mask: var(--stamp-mask);
  mask: var(--stamp-mask);
  animation: stamp-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  animation-delay: calc(0.5s + var(--i, 0) * 0.18s);
}
.stamp:nth-child(3n + 2) {
  border-radius: 12px;
}
.stamp:nth-child(3n) {
  border-radius: 30% 30% 50% 50%;
}
.stamp small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.16em;
  font-weight: 700;
}
.stamps-empty {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-3);
}
@keyframes stamp-in {
  from {
    opacity: 0;
    transform: scale(2) rotate(0deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(var(--rot, -8deg));
  }
}
.medal {
  position: absolute;
  right: -14px;
  top: -22px;
  width: 104px;
  height: 104px;
  z-index: 2;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f6dc8e, var(--gold) 55%, var(--gold-2));
  border: 3px solid #fff3c8;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 12px;
  line-height: 1.05;
  color: #5a3e05;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  animation: medal 0.8s 1.2s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.medal::before,
.medal::after {
  content: "";
  position: absolute;
  top: 88px;
  width: 26px;
  height: 44px;
  z-index: -1;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}
.medal::before {
  left: 22px;
  transform: rotate(14deg);
}
.medal::after {
  right: 22px;
  transform: rotate(-14deg);
  background: var(--teal);
}
@keyframes medal {
  from {
    opacity: 0;
    transform: scale(0) rotate(-90deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.confetti svg {
  position: absolute;
  top: -40px;
  width: 26px;
  height: 26px;
  animation: plane-fall linear forwards;
}
@keyframes plane-fall {
  0% {
    transform: translate(0, 0) rotate(var(--r0));
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), 110vh) rotate(var(--r1));
    opacity: 0.9;
  }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  transform: translate(-50%, 140%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--parchment);
  font-weight: 500;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.35s cubic-bezier(0.2, 1.2, 0.4, 1),
    opacity 0.25s,
    visibility 0s 0.35s;
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  transition:
    transform 0.35s cubic-bezier(0.2, 1.2, 0.4, 1),
    opacity 0.25s;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .round-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .col-speaker {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .speaker-card {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "photo wave" "photo controls";
    align-items: center;
    column-gap: 26px;
  }
  .speaker-photo {
    grid-area: photo;
    width: 120px;
  }
  .speaker-caption {
    display: none;
  }
  .waveform {
    grid-area: wave;
  }
  .speaker-controls {
    grid-area: controls;
  }
  .compass-box {
    padding-right: 8px;
  }
  .notebook {
    max-height: 640px;
  }
}

@media (max-width: 860px) {
  .title-globe {
    opacity: 0.35;
    right: -30vw;
    width: 110vw;
    height: 110vw;
    top: 40%;
  }
  .title-card {
    margin: 0 auto;
  }
  .reveal {
    grid-template-columns: 1fr;
  }
  #reveal-globe {
    max-width: 420px;
  }
  .final-passports {
    grid-template-columns: 1fr;
  }
  .guess-inner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }
  .guess-list {
    height: 200px;
  }
  #guess-globe {
    width: 180px;
  }
  .guess-right {
    grid-row: 1;
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: start;
  }
  .guess-right .btn-row {
    grid-column: 1 / -1;
  }
  .guess-selected {
    text-align: left;
  }
  .explorer {
    padding: 14px;
    gap: 10px;
  }
  .explorer-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 1fr) auto;
    overflow-y: auto;
  }
  .explorer-side {
    overflow: visible;
  }
  #explorer-search {
    flex: 1 1 100%;
    order: 3;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }
  .round-grid {
    grid-template-columns: 1fr;
  }
  .col-speaker {
    grid-template-columns: 1fr;
  }
  .speaker-card {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "photo controls" "wave wave";
    column-gap: 18px;
    padding: 14px;
  }
  .speaker-photo {
    width: 84px;
    padding: 6px 6px 16px;
  }
  .mystery-stamp {
    width: 40px;
    height: 40px;
    font-size: 22px;
    right: -12px;
  }
  .compass-box {
    grid-template-columns: auto 1fr;
    justify-items: start;
    align-items: center;
    gap: 14px;
    padding: 0 4px;
  }
  .compass {
    width: 76px;
    height: 76px;
  }
  .compass span {
    font-size: 10px;
  }
  .needle {
    height: 54px;
    width: 12px;
    margin: -27px 0 0 -6px;
  }
  .needle::before,
  .needle::after {
    width: 12px;
    height: 27px;
  }
  .turn-label {
    text-align: left;
  }
  .round-head {
    grid-template-columns: 1fr 1fr;
  }
  .round-meta {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }
  .mini-passport {
    padding: 8px 10px;
    gap: 8px;
  }
  .mini-passport .mp-score {
    font-size: 26px;
  }
  .mini-passport .mp-name {
    font-size: 15px;
  }
  .deck-cards {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    margin: 0 -12px;
    padding: 4px 12px 14px;
    scrollbar-width: thin;
  }
  .q-card {
    flex: 0 0 72%;
    scroll-snap-align: start;
    min-height: 120px;
  }
  .deck-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -12px;
    padding: 0 12px 4px;
    scrollbar-width: none;
  }
  .tab {
    flex: none;
  }
  .notebook {
    max-height: none;
    padding-left: 40px;
  }
  .lobby-passports {
    grid-template-columns: 1fr 64px 1fr;
    gap: 4px;
  }
  .passport {
    padding: 16px 10px;
  }
  .passport .pp-name {
    font-size: 19px;
  }
  .passport .pp-emblem {
    width: 44px;
    height: 44px;
  }
  .boarding-pass {
    grid-template-columns: 1fr;
    transform: none;
  }
  .bp-stub {
    display: none;
  }
  .open-passport {
    grid-template-columns: 1fr;
  }
  .open-passport .page:first-child {
    border-right: 0;
    border-bottom: 2px dashed var(--line);
  }
  .medal {
    width: 84px;
    height: 84px;
    font-size: 10px;
    right: -6px;
  }
  .medal::before,
  .medal::after {
    top: 70px;
  }
  .stamp {
    width: 78px;
    height: 78px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .big-stamp.show {
    animation: none;
    opacity: 1;
    transform: rotate(-10deg);
  }
}

.mini-passport.pickable.active {
  --badge: "Playing";
}

/* Phone: round header with the cycle timer */
@media (max-width: 720px) {
  .round-meta {
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
  }
  .round-number {
    white-space: nowrap;
    font-size: 20px;
  }
  .cycle-row {
    margin: 0;
  }
  .cycle-timer {
    flex: none;
    width: 50px;
    height: 50px;
  }
  .cycle-timer span {
    font-size: 13px;
  }
  .cycle-chip {
    max-width: none;
  }
  .turns-left {
    flex-basis: 100%;
    text-align: left;
  }
}

/* A phone held sideways (#150): too short to stack things, so the guess picker and the explorer
   go side by side, and the list, the search box and the Guess button all stay on screen. */
@media (max-height: 500px) and (orientation: landscape) {
  .guess-inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    height: calc(100dvh - 24px);
    gap: 12px;
    padding: 12px 14px;
  }
  .guess-left {
    gap: 8px;
  }
  .guess-left h2 {
    font-size: 18px;
  }
  #guess-search {
    padding: 8px 12px;
  }
  .guess-list {
    height: auto;
    min-height: 0;
  }
  .guess-list li {
    padding: 7px 10px;
  }
  .guess-right {
    grid-row: auto;
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: center;
    gap: 8px;
    min-height: 0;
  }
  #guess-globe {
    width: min(100%, calc(100dvh - 170px));
  }
  .guess-selected {
    font-size: 18px;
    text-align: center;
  }
  .explorer {
    height: calc(100dvh - 24px);
    padding: 10px 14px;
    gap: 8px;
  }
  .explorer-top {
    flex-wrap: nowrap;
    gap: 10px;
  }
  .explorer-top > div {
    flex: 0 1 auto;
  }
  .explorer-top h2 {
    font-size: 18px;
  }
  .explorer-sub {
    display: none;
  }
  #explorer-search {
    flex: 1 1 160px;
    order: 0;
    padding: 8px 12px;
  }
  .explorer-body {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 40%);
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }
  .explorer-side {
    overflow-y: auto;
    gap: 10px;
  }
  .picked {
    padding: 10px 12px;
    gap: 8px;
  }
  .picked-name {
    font-size: 20px;
  }
}
