@font-face {
  font-family: 'Vazirmatn';
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/vazirmatn-arabic-400-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/vazirmatn-arabic-700-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/vazirmatn-arabic-900-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/vazirmatn-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/vazirmatn-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}

/*
 * Look and feel follow Apple's Human Interface Guidelines:
 * - system colours and text styles, light and dark appearance
 * - Liquid Glass only on the controls layer (toolbars, round buttons, clock); content sits on
 *   solid surfaces
 * - one prominent button per screen, capsule buttons, concentric corners
 * - inset grouped lists, segmented controls, switches, sheets and alerts as on iOS
 */

:root {
  color-scheme: light dark;

  /* system colours, light */
  --bg: #f2f2f7;
  --card: #ffffff;
  --card2: #f2f2f7;
  --label: #000000;
  --label2: rgba(60, 60, 67, 0.6);
  --label3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.29);
  --fill: rgba(120, 120, 128, 0.12);
  --fill2: rgba(120, 120, 128, 0.2);
  --thumb: #ffffff;
  --tint: #ff9500;        /* saffron: the app's accent */
  --green: #34c759;
  --red: #ff3b30;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  --team: #007aff;

  /* text styles (pt = px) */
  --large-title: 34px;
  --title1: 28px;
  --title2: 22px;
  --title3: 20px;
  --body: 17px;
  --callout: 16px;
  --subhead: 15px;
  --footnote: 13px;
  --caption: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --card2: #2c2c2e;
    --label: #ffffff;
    --label2: rgba(235, 235, 245, 0.6);
    --label3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.65);
    --fill: rgba(118, 118, 128, 0.24);
    --fill2: rgba(118, 118, 128, 0.36);
    --thumb: #636366;
    --tint: #ff9f0a;
    --green: #30d158;
    --red: #ff453a;
    --glass: rgba(44, 44, 48, 0.55);
    --glass-edge: rgba(255, 255, 255, 0.14);
    --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--label);
  /* SF Arabic on Apple devices, Vazirmatn elsewhere */
  font-family: -apple-system, BlinkMacSystemFont, 'Vazirmatn', system-ui, Tahoma, sans-serif;
  font-size: var(--body);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-text-size-adjust: 100%;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { width: 22px; height: 22px; flex: none; }
svg.inline { width: 17px; height: 17px; vertical-align: -3px; }
.hidden { display: none !important; }

#app { height: 100%; max-width: 600px; margin: 0 auto; position: relative; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
.grouped { background: var(--bg); }

/* Home: a soft saffron, herb and pomegranate wash behind the icon (content layer, not glass). */
.home-bg {
  background:
    radial-gradient(120% 60% at 85% 0%, rgba(255, 149, 0, 0.28), transparent 60%),
    radial-gradient(90% 50% at 0% 45%, rgba(52, 199, 89, 0.18), transparent 60%),
    radial-gradient(100% 55% at 100% 100%, rgba(255, 45, 85, 0.16), transparent 60%),
    var(--bg);
}

/* Game screens take the colour of the team whose turn it is. */
.team-bg {
  color: #fff;
  background-color: var(--team);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.32));
  transition: background-color 0.35s ease;
}

/* ---------- glass (controls layer) ---------- */

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 0 0 0.5px var(--glass-edge), var(--glass-shadow);
}
/* Over a rich team colour use the clear variant: more see-through, white content. */
.team-bg .glass {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.35), 0 8px 24px rgba(0, 0, 0, 0.12);
  color: #fff;
}

.glass-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--label);
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 0 0 0.5px var(--glass-edge), var(--glass-shadow);
  transition: transform 0.15s ease;
}
.glass-btn:active { transform: scale(0.92); }
.team-bg .glass-btn { color: #fff; background: rgba(255, 255, 255, 0.18); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.35); }

/* ---------- navigation bar ---------- */

.navbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  min-height: 60px;
  flex: none;
  position: relative;
  z-index: 2;
}
.nav-space { width: 44px; flex: none; }
.nav-actions { display: flex; gap: 10px; }
.nav-title {
  flex: 1;
  text-align: center;
  font-size: var(--body);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.nav-title.shown, .scrolled .nav-title { opacity: 1; }
/* scroll edge: once content moves under the bar, the bar gets a soft backing and a hairline */
.grouped .navbar { transition: box-shadow 0.2s ease, background-color 0.2s ease; }
.grouped.scrolled .navbar {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 0.5px 0 var(--sep);
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 24px;
  -webkit-overflow-scrolling: touch;
}
.large-title { margin: 0 4px 8px; font-size: var(--large-title); font-weight: 700; line-height: 1.25; }

/* ---------- buttons ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: var(--body);
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.2s ease;
}
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn svg { width: 20px; height: 20px; }
.btn.prominent { background: var(--tint); color: #fff; }
.btn.tinted { background: color-mix(in srgb, var(--tint) 16%, transparent); color: var(--tint); margin-top: 12px; }
.btn.gray { background: var(--fill); color: var(--label); }
.btn.destructive { color: var(--red); }
.team-bg .btn.gray { background: rgba(255, 255, 255, 0.2); color: #fff; }
.btn.on-team { background: #fff; color: var(--team); font-size: var(--title3); min-height: 58px; }
.btn.correct {
  min-height: 76px;
  background: var(--green);
  color: #fff;
  font-size: var(--title1);
  font-weight: 800;
}
.btn.correct svg { width: 30px; height: 30px; }
.pen { font-size: var(--footnote); font-weight: 400; opacity: 0.8; }

.actions { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 12px 24px calc(20px + env(safe-area-inset-bottom)); }
.actions .btn { min-height: 56px; font-size: var(--title3); }

/* Floating glass toolbar; its corners stay concentric with the capsules inside it. */
.toolbar {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 12px calc(10px + env(safe-area-inset-bottom));
  padding: 8px;
  border-radius: 34px;
  position: relative;
  z-index: 2;
}
.row-btns { display: flex; gap: 8px; }
.row-btns .btn { flex: 1; padding: 0 12px; }

/* ---------- home ---------- */

.home-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
}
.app-icon {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(160deg, #ffb340, #ff8a00 55%, #f56300);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 12px 30px rgba(255, 140, 0, 0.35);
}
.app-icon svg { width: 76px; height: 76px; }
.home-body h1 { margin: 18px 0 0; font-size: 48px; font-weight: 800; line-height: 1.2; }
.home-body p { margin: 4px 0 0; font-size: var(--body); color: var(--label2); }

/* ---------- lists ---------- */

.section-head {
  margin: 22px 16px 7px;
  font-size: var(--footnote);
  color: var(--label2);
}
.section-foot {
  margin: 7px 16px 0;
  font-size: var(--footnote);
  color: var(--label2);
  line-height: 1.6;
}
.list {
  background: var(--card);
  border-radius: 26px;
  overflow: hidden;
}
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  text-align: right;
  font-size: var(--body);
}
/* hairline separators, inset from the leading edge */
.list > .row + .row::before {
  content: '';
  position: absolute;
  top: 0;
  right: 16px;
  left: 0;
  height: 0.5px;
  background: var(--sep);
}
.list > .row.inset + .row::before, .list > .row + .row.inset::before { right: 46px; }
button.row:active { background: var(--fill); }
.row .grow { flex: 1; }
.row .value { color: var(--label2); }
.row .chev { width: 16px; height: 16px; color: var(--label3); }
.row.col { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; }
.row.destructive { color: var(--red); justify-content: center; }
.row svg.check { color: var(--tint); }

.row input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: var(--body);
  user-select: text;
  -webkit-user-select: text;
}
.row input::placeholder { color: var(--label3); }

.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--team); flex: none; }

/* ---------- segmented control ---------- */

.segmented {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--fill);
}
.segmented button {
  flex: 1;
  min-height: 38px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: var(--subhead);
  font-weight: 600;
  transition: background-color 0.2s ease;
}
.segmented button.on {
  background: var(--thumb);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

/* ---------- switch ---------- */

.switch {
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: var(--fill2);
  flex: none;
  transition: background-color 0.2s ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: right 0.2s ease;
}
[aria-checked="true"] .switch { background: var(--green); }
[aria-checked="true"] .switch::after { right: 22px; }

/* ---------- players and teams ---------- */

#count-seg button { font-size: var(--body); }
#name-list .row input { padding: 0; }
.team-list { margin-top: 22px; --team: #007aff; }
.team-list .team-row input { font-weight: 700; color: var(--team); }
.slot .swap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--label2);
  flex: none;
}
.slot .swap svg { width: 18px; height: 18px; }
.slot.picked { background: color-mix(in srgb, var(--tint) 14%, transparent); }
.slot.picked .swap { background: var(--tint); color: #fff; }
.slot .num { width: 12px; flex: none; font-size: var(--footnote); color: var(--label3); text-align: center; }

/* ---------- pass the phone (first turn) ---------- */

.pass-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 24px 20px;
  text-align: center;
}
/* centred, but scrolls from the top when it does not fit */
.pass-body > :first-child { margin-top: auto; }
.pass-body > :last-child { margin-bottom: auto; }
.eyebrow { font-size: var(--title3); font-weight: 600; opacity: 0.85; }
.pass-name { font-size: 54px; font-weight: 800; line-height: 1.3; word-break: break-word; }
.pass-to { font-size: var(--title2); font-weight: 600; }
.pass-to b { font-weight: 800; }
.pass-hint { max-width: 340px; margin: 16px 0 0; font-size: var(--subhead); line-height: 1.7; opacity: 0.85; }
.pass-teams { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; max-width: 360px; }
.pass-teams span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: var(--subhead);
  font-weight: 600;
}
.pass-teams span.now { background: #fff; color: var(--team); }
.pass-teams .dot { width: 10px; height: 10px; box-shadow: 0 0 0 1.5px #fff; }

/* ---------- turn ---------- */

.clock {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  font-size: var(--title3);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  flex: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.ring { width: 22px; height: 22px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: rgba(255, 255, 255, 0.3); }
.ring .fill { stroke: #fff; stroke-linecap: round; stroke-dasharray: 56.55; transition: stroke-dashoffset 0.1s linear; }
.team-bg .clock.low { background: #fff; color: var(--red); }
.clock.low .ring .fill { stroke: var(--red); }
.clock.low .ring .track { stroke: color-mix(in srgb, var(--red) 25%, transparent); }

.turn-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 16px 14px;
}
/* Team board: every team in turn order, who explains to whom, and the time each has left. */
.tboard { flex: none; margin: 0 16px 12px; padding: 6px; border-radius: 26px; }
.trow {
  --team: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 20px;
  font-size: var(--subhead);
}
.trow .dot { width: 10px; height: 10px; box-shadow: 0 0 0 1.5px #fff; }
.trow .nm { font-weight: 700; max-width: 30%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .pp { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.9; }
.trow .bar { width: 56px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.3); overflow: hidden; flex: none; }
.trow .bar i { display: block; height: 100%; width: 100%; border-radius: 3px; background: #fff; transition: width 0.1s linear; }
.trow .tm { width: 36px; flex: none; text-align: left; direction: ltr; font-weight: 700; font-variant-numeric: tabular-nums; }
.trow.now { background: #fff; color: var(--team); }
.trow.now .pp { font-weight: 800; opacity: 1; }
.trow.now .bar { background: color-mix(in srgb, var(--team) 22%, transparent); }
.trow.now .bar i { background: var(--team); }
.trow.now.low .bar i { background: var(--red); }
.trow.now.low .tm { color: var(--red); }
.trow.out { opacity: 0.45; }
.trow.out .nm, .trow.out .pp { text-decoration: line-through; }
.word-card {
  width: 100%;
  flex: 1;
  max-height: 340px;
  border-radius: 36px;
  background: var(--card);
  color: var(--label);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}
.word-cat { font-size: var(--subhead); font-weight: 600; color: var(--label2); min-height: 1.5em; }
.word { font-size: 58px; font-weight: 800; line-height: 1.3; word-break: break-word; }
.word.mid { font-size: 42px; }
.word.long { font-size: 30px; line-height: 1.6; }
#turn.paused .word-card > * { visibility: hidden; }
.word-card.handover { animation: handover 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes handover { from { transform: scale(0.9); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* ---------- result ---------- */

.hero { text-align: center; padding: 28px 16px 4px; }
.hero .medal {
  width: 88px;
  height: 88px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--team);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--team) 45%, transparent);
}
.hero .medal svg { width: 48px; height: 48px; }
.hero h1 { margin: 16px 0 0; font-size: var(--large-title); font-weight: 800; line-height: 1.3; }
.hero p { margin: 4px 0 0; color: var(--label2); }
.rank-n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-size: var(--footnote);
  font-weight: 700;
  background: var(--fill);
}
.rank-main { flex: 1; min-width: 0; padding: 10px 0; }
.rank-main b { display: block; font-weight: 700; }
.rank-main small { display: block; font-size: var(--subhead); color: var(--label2); }
.row.words { padding-top: 0; padding-bottom: 14px; min-height: 0; }
.list > .row + .row.words::before { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { padding: 4px 11px; border-radius: 999px; background: var(--fill); font-size: var(--subhead); }
.chips span.lost { background: transparent; color: var(--label3); text-decoration: line-through; box-shadow: inset 0 0 0 1px var(--sep); }

/* ---------- sheet ---------- */

#sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.32);
  animation: fade 0.25s ease;
}
.sheet-panel {
  width: min(100%, 600px);
  max-height: calc(100% - 44px - env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 38px 38px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  animation: rise 0.35s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--label3); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 16px 4px; min-height: 52px; flex: none; }
.sheet-title { flex: 1; text-align: center; font-weight: 700; }
.sheet-link { min-width: 64px; min-height: 44px; display: flex; align-items: center; gap: 2px; color: var(--tint); font-size: var(--body); }
.sheet-link.done { justify-content: flex-end; font-weight: 700; }
.sheet-link.back svg { width: 18px; height: 18px; }
.sheet-head > .sheet-link:first-child.hidden + .sheet-title { margin-right: 72px; }
.sheet-body { overflow-y: auto; padding: 0 16px calc(28px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.sheet-body > .list:first-child, .sheet-body > .section-head:first-child { margin-top: 8px; }
.rule-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  background: var(--c, var(--tint));
}
.rule-icon svg { width: 18px; height: 18px; }
.rule-text { flex: 1; padding: 12px 0; line-height: 1.7; }
.rule-text b { display: block; }
.rule-text small { display: block; font-size: var(--subhead); color: var(--label2); }

/* ---------- alert ---------- */

#alert {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.35);
  animation: fade 0.2s ease;
}
.alert-box {
  width: min(100%, 300px);
  padding: 22px 16px 14px;
  border-radius: 34px;
  text-align: center;
  color: var(--label);
  background: var(--glass);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  box-shadow: inset 0 0 0 0.5px var(--glass-edge), 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .alert-box, .glass, .glass-btn { background: var(--card); }
}
.alert-box h2 { margin: 0 8px; font-size: var(--body); font-weight: 700; line-height: 1.5; }
.alert-box p { margin: 6px 8px 0; font-size: var(--footnote); line-height: 1.7; color: var(--label2); }
.alert-box .btns { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.alert-box .btn { min-height: 48px; }
.alert-box .btn.prominent { background: var(--tint); }
.alert-box .btn.gray, .alert-box .btn.destructive { background: var(--fill); }
.alert-box .btn.destructive { color: var(--red); }

/* ---------- toast ---------- */

#toast {
  position: fixed;
  left: 50%;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 40;
  transform: translate(-50%, -16px);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: var(--subhead);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s ease;
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes pop { from { transform: scale(1.12); opacity: 0; } }

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

@media (max-height: 640px) {
  .navbar { min-height: 52px; padding: 4px 14px; }
  .word { font-size: 48px; }
  .btn.correct { min-height: 66px; font-size: var(--title2); }
  .pass-name { font-size: 44px; }
  .app-icon { width: 96px; height: 96px; border-radius: 22px; }
  .app-icon svg { width: 64px; height: 64px; }
}
