/* Anagrams — mobile-first styling. One dark theme, tuned for thumbs. */

:root {
  --bg: #100e1c;
  --bg-2: #171532;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.11);
  --text: #f2f0ff;
  --muted: #a49fc4;
  --accent: #7c5cff;
  --accent-2: #29d3c6;
  --gold: #ffcb47;
  --win: #45e0a0;
  --loss: #ff6b81;
  --tile: linear-gradient(180deg, #fdfcff 0%, #e6e1f7 100%);
  --tile-ink: #201b3a;
  --paper: #fdfcff;
  --radius: 18px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --tap: 48px;
}

* {
  box-sizing: border-box;
  touch-action: manipulation; /* no double-tap-zoom wait before taps register; pinch zoom still works */
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
}

html {
  background: var(--bg);
}

/* The glow lives on a fixed layer: painted on body it tiled every viewport
   height, so a second copy started mid-page and cut across long screens. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 12% -10%, #2a2260 0%, transparent 55%),
    radial-gradient(100% 70% at 92% 0%, #123f52 0%, transparent 50%);
}

body {
  color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI Variable",
    "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px env(safe-area-inset-bottom);
}

/* ---------------------------------------------------------- top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px 10px;
  padding-top: calc(14px + env(safe-area-inset-top));
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

.brand-name {
  letter-spacing: 0.12em;
  font-size: 17px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  text-decoration: none;
  white-space: nowrap;
}

.chip .elo {
  color: var(--gold);
  font-weight: 700;
}

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
}

.footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 18px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  text-decoration: none;
}

.loading {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
}

/* ---------------------------------------------------------- cards + buttons */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

.card h2 {
  margin: 0 0 4px;
  font-size: 19px;
}

.card p.sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  width: 100%;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.btn:active {
  transform: scale(0.975);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #a06bff 55%, var(--accent-2) 160%);
  border-color: transparent;
  box-shadow: var(--shadow);
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  min-height: 40px;
  width: auto;
  font-size: 14px;
  padding: 0 14px;
}

.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.hero {
  text-align: center;
  padding: 10px 0 6px;
}

.hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(30px, 9vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0 auto 18px;
  max-width: 34ch;
  color: var(--muted);
  line-height: 1.5;
}

.seg {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.seg button {
  flex: 1;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.seg button[aria-pressed='true'] {
  background: var(--panel-strong);
  color: var(--text);
  border-color: rgba(124, 92, 255, 0.6);
}

label.field {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

label.field input {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  font-size: 16px; /* keeps iOS from zooming on focus */
}

label.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-error {
  color: var(--loss);
  font-size: 14px;
  margin: 0 0 10px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

/* ---------------------------------------------------------- game screen */

/* Fills the viewport so the rack and buttons stay under the thumb. */
.game {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Rapid tapping shouldn't select text or open the long-press menu. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.hud .stat {
  font-size: 13px;
  color: var(--muted);
}

.hud .stat b {
  display: block;
  font-size: 22px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.hud .stat.right {
  text-align: right;
}

.clock {
  min-width: 76px;
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 4px 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.clock.warn {
  color: var(--gold);
}

.clock.danger {
  color: var(--loss);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% {
    transform: scale(1.06);
  }
}

.timerbar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.timerbar > i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transform-origin: left;
  transition: transform 0.25s linear;
}

.found {
  flex: 1 1 auto;
  min-height: 96px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 7px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

.found:empty::after {
  content: 'Words you find land here';
  color: var(--muted);
  font-size: 14px;
}

.word-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
  animation: pop 0.18s ease-out;
}

.word-pill small {
  color: var(--accent-2);
  font-size: 11px;
  letter-spacing: 0;
}

.word-pill.len6 {
  background: linear-gradient(135deg, rgba(255, 203, 71, 0.28), rgba(124, 92, 255, 0.28));
  border-color: rgba(255, 203, 71, 0.55);
}

.word-pill.len5 {
  border-color: rgba(41, 211, 198, 0.5);
}

.word-pill.miss {
  opacity: 0.55;
  background: transparent;
}

.word-pill.only {
  border-color: rgba(255, 107, 129, 0.6);
}

@keyframes pop {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
}

.tray {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.current {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 56px;
}

.current .placeholder {
  color: var(--muted);
  font-size: 14px;
}

.current.shake {
  animation: shake 0.3s;
}

@keyframes shake {
  25% {
    transform: translateX(-7px);
  }
  75% {
    transform: translateX(7px);
  }
}

.mini {
  width: 38px;
  height: 46px;
  border: 0;
  border-radius: 9px;
  background: var(--tile);
  color: var(--tile-ink);
  font-weight: 800;
  font-size: 20px;
  text-transform: uppercase;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  animation: pop 0.12s ease-out;
}

.rack {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.tile {
  aspect-ratio: 1 / 1.12;
  border: 0;
  border-radius: 14px;
  background: var(--tile);
  color: var(--tile-ink);
  font-size: clamp(22px, 7vw, 30px);
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.45), inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.06s ease-out, opacity 0.08s ease-out;
}

.tile:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.tile.used {
  opacity: 0.22;
  pointer-events: none;
  transform: translateY(4px);
}

.tile:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 8px;
  padding-bottom: 8px;
}

.controls .btn {
  min-height: 52px;
}

.floater {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  font-weight: 800;
  font-size: 20px;
  color: var(--win);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  animation: rise 0.9s ease-out forwards;
}

@keyframes rise {
  to {
    transform: translate(-50%, -60px);
    opacity: 0;
  }
}

/* ---------------------------------------------------------- results */

.banner {
  text-align: center;
  padding: 22px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 14px;
}

.banner h1 {
  margin: 0 0 4px;
  font-size: 30px;
}

.banner.win {
  background: linear-gradient(160deg, rgba(69, 224, 160, 0.24), var(--panel));
  border-color: rgba(69, 224, 160, 0.45);
}

.banner.loss {
  background: linear-gradient(160deg, rgba(255, 107, 129, 0.2), var(--panel));
  border-color: rgba(255, 107, 129, 0.4);
}

.banner.draw {
  background: linear-gradient(160deg, rgba(255, 203, 71, 0.18), var(--panel));
}

.elo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  font-weight: 700;
}

.elo-chip .up {
  color: var(--win);
}

.elo-chip .down {
  color: var(--loss);
}

.scoreline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 16px 0 6px;
}

.scoreline.solo {
  grid-template-columns: 1fr;
}

.scoreline .side {
  text-align: center;
}

.scoreline .side .name {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scoreline .side .pts {
  font-size: clamp(26px, 8vw, 36px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.scoreline .side.winner .pts {
  color: var(--win);
}

.scoreline .vs {
  color: var(--muted);
  font-size: 13px;
}

.share-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.share-link {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--line);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

details.reveal {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 6px;
}

details.reveal summary {
  cursor: pointer;
  font-weight: 700;
  padding: 6px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 10px;
}

.stat-box {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}

.stat-box b {
  display: block;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.stat-box span {
  font-size: 12px;
  color: var(--muted);
}

/* ---------------------------------------------------------- tables + lists */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}

.table td {
  padding: 11px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table tr.me {
  background: rgba(124, 92, 255, 0.16);
}

.hist {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.badge {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-weight: 800;
  font-size: 13px;
  background: var(--panel-strong);
}

.badge.win {
  background: rgba(69, 224, 160, 0.2);
  color: var(--win);
}

.badge.loss {
  background: rgba(255, 107, 129, 0.18);
  color: var(--loss);
}

.badge.draw {
  background: rgba(255, 203, 71, 0.18);
  color: var(--gold);
}

.hist .grow {
  flex: 1;
  min-width: 0;
}

.hist .grow div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 50;
}

.toast {
  background: #241f45;
  border: 1px solid var(--line);
  padding: 11px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: pop 0.16s ease-out;
  max-width: 90vw;
}

.toast.bad {
  border-color: rgba(255, 107, 129, 0.6);
}

/* ---------------------------------------------------------- ranks + levels */

.t-unranked {
  --tier: #6f6a93;
}

.t-bronze {
  --tier: #d8894a;
}

.t-silver {
  --tier: #c3cbdc;
}

.t-gold {
  --tier: #ffcb47;
}

.t-platinum {
  --tier: #3fd9c6;
}

.t-diamond {
  --tier: #8fb4ff;
}

/* A hexagon in the tier's colour with the division number on it. */
.tier-badge {
  --badge: 22px;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--badge);
  height: calc(var(--badge) * 1.12);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.5), transparent 55%, rgba(0, 0, 0, 0.28)),
    var(--tier);
  color: #1b1633;
  font-size: calc(var(--badge) * 0.52);
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.tier-badge.xs {
  --badge: 16px;
}

.tier-badge.sm {
  --badge: 24px;
}

.tier-badge.lg {
  --badge: 42px;
}

.tier-name {
  color: var(--tier);
  font-weight: 700;
}

.level-badge {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  font-size: 17px;
  font-weight: 800;
}

.meter {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.meter > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.meter.tier > i {
  background: var(--tier);
}

.progression {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-row .grow {
  flex: 1;
  min-width: 0;
}

.progress-row .line,
.xp-summary .line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.chip .lvl {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2);
}

.rank-change {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  font-weight: 700;
}

.rank-change.up {
  color: var(--win);
}

.rank-change.down {
  color: var(--loss);
}

.xp-summary {
  max-width: 340px;
  margin: 16px auto 0;
  text-align: left;
}

.xp-summary .muted {
  margin-top: 6px;
}

.xp-summary.leveled .line b {
  color: var(--gold);
}

.xp-gain {
  color: var(--accent-2);
  font-weight: 700;
  text-align: right;
}

.xp-gain small {
  color: var(--muted);
  font-weight: 400;
}

.who-meta {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ladder {
  display: grid;
  gap: 8px;
  margin: 4px 0 12px;
}

.ladder div {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.ladder .muted {
  margin-left: auto;
}

/* ---------------------------------------------------------- characters */

/* A round profile picture. Strokes thicken as it shrinks so the doodle stays readable. */
.avatar {
  --size: 56px;
  display: inline-block;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--line), 0 4px 12px rgba(0, 0, 0, 0.3);
  vertical-align: middle;
}

.avatar svg {
  display: block;
  width: 100%;
  height: 100%;
}

.avatar .ink {
  stroke-width: 6;
}

.avatar.xs {
  --size: 26px;
}

.avatar.xs .ink {
  stroke-width: 11;
}

.avatar.sm {
  --size: 38px;
}

.avatar.sm .ink {
  stroke-width: 8;
}

.avatar.lg {
  --size: 76px;
}

.avatar.xl {
  --size: 104px;
}

.avatar.lg .ink,
.avatar.xl .ink {
  stroke-width: 5;
}

.avatar.empty {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 2px dashed var(--muted);
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 34px;
  font-weight: 700;
}

.chip .avatar {
  margin: -4px 0 -4px -7px;
}

.hero .avatar {
  margin-bottom: 8px;
}

.with-pic,
.who {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.card .profile-head p.sub {
  margin: 0;
}

.scoreline .side .avatar {
  margin-bottom: 8px;
}

.versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}

.versus .player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
}

.versus .player.right {
  justify-content: flex-end;
}

.versus .player b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.versus .player small {
  color: var(--gold);
  font-weight: 700;
}

.creator {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  align-items: start;
}

.stage {
  overflow: hidden;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.45);
}

.stage > svg {
  display: block;
  width: 100%;
  height: auto;
}

.stage-pic {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 0;
}

#cc-slots button {
  padding: 0 4px;
  font-size: 13px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.swatch {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.45);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.swatch[aria-pressed='true'] {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

.swatch:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

.parts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}

.part {
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
  transition: transform 0.08s ease;
}

.part:active {
  transform: translateY(2px);
}

.part svg {
  display: block;
  width: 100%;
  height: 100%;
}

.part .ink {
  stroke-width: 5;
}

.part[aria-pressed='true'] {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.part:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

@media (max-width: 479px) {
  .creator {
    grid-template-columns: 1fr;
  }

  .stage {
    width: 140px;
    margin: 0 auto 6px;
  }
}

/* ---------------------------------------------------------- friends */

.nav-friends {
  position: relative;
  padding: 7px 10px;
}

.nav-friends svg {
  display: block;
  width: 18px;
  height: 18px;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--loss);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.nav-friends .count {
  position: absolute;
  top: -6px;
  right: -6px;
}

.inline-form {
  display: flex;
  gap: 8px;
}

.text-input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  font-size: 16px; /* keeps iOS from zooming on focus */
}

.text-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.inline-form .btn {
  width: auto;
}

.inline-form + .form-error {
  margin: 10px 0 0;
}

.person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.person-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.person-row .grow {
  flex: 1;
  min-width: 0;
}

.person-row .grow > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.btn.icon {
  width: 40px;
  padding: 0;
}

a.card {
  display: block;
  text-decoration: none;
}

.card.inbox {
  display: flex;
  align-items: center;
  gap: 12px;
  border-color: rgba(124, 92, 255, 0.6);
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.2), var(--panel));
}

.card.inbox .grow {
  flex: 1;
}

/* Phones: the account chip keeps its picture, level and rank badge but drops the name and Elo. */
@media (max-width: 419px) {
  .chip .avatar + .chip-name,
  .chip .elo {
    display: none;
  }

  .chip .avatar {
    margin-right: -3px;
  }
}

@media (max-width: 359px) {
  .brand-name {
    display: none;
  }
}

/* ---------------------------------------------------------- larger screens */

@media (min-width: 620px) {
  .rack {
    gap: 12px;
  }

  .tile {
    aspect-ratio: 1 / 1;
    font-size: 34px;
  }

  .controls {
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }
}

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