:root {
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #171717;
  --muted: #6b6b6b;
  --line: #e7e7e7;
  --red: #d4533a;
  --red-deep: #a33b26;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  color: var(--ink);
  background: var(--bg);
  font-family: Pretendard, "Malgun Gothic", sans-serif;
  letter-spacing: -0.011em;
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; color: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 23, 23, 0.32) transparent;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 23, 23, 0.32) transparent;
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: rgba(23, 23, 23, 0.28);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(212, 83, 58, 0.72);
}

*::-webkit-scrollbar-thumb:active {
  background-color: var(--red-deep);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

a { color: var(--red-deep); }

h1, h2, h3, p { margin: 0; }

h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

h2 { font-size: 22px; letter-spacing: -0.03em; }

h2 a, h3 a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  width: min(1120px, calc(100% - 28px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-family: "Black Han Sans", Pretendard, sans-serif;
  font-size: 30px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.mark {
  width: 34px;
  height: 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}

.mark i {
  display: block;
  border-radius: 6px;
}

.mark i:first-child { background: #e36a45; transform: skewY(-8deg); }
.mark i:last-child { background: #1d1a16; transform: skewY(8deg); }

.modes {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: #f6f6f6;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.modes a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  padding: 9px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.modes a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}

.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
}

.nav a[aria-current="page"] {
  color: var(--ink);
  background: #f4f4f4;
}

.nick {
  margin-left: 0;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nick.ghost { color: var(--muted); font-weight: 700; }

.admin-bar { min-height: 56px; }
.admin-bar strong { font-size: 18px; letter-spacing: -0.03em; }
.narrow { width: min(760px, 100%); margin: 0 auto; }

.main, .foot {
  width: min(1120px, calc(100% - 28px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  margin: 0 auto;
}

.main { padding: 22px 0 36px; }

.foot {
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 28px;
}

.page-head { display: grid; gap: 8px; margin-bottom: 16px; }

.eyebrow {
  color: var(--red-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.lede, .muted { color: var(--muted); }

.lede { max-width: 640px; }

.filters, .row, .actions, .meta, .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filters { margin: 8px 0 12px; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: #f6f6f6;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.seg button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
}

.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.cats, .seg.cats { margin-bottom: 16px; }

.search, input, textarea, select {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
}

.search-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: min(220px, 100%);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--card);
  color: var(--muted);
  -webkit-tap-highlight-color: transparent;
}

.search-wrap:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.08);
}

.search-wrap input {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
  min-width: 0;
  width: 100%;
  outline: none;
  box-shadow: none;
}

.search-wrap input:focus,
.search-wrap input:focus-visible {
  outline: none;
  box-shadow: none;
}

.icon { width: 22px; height: 22px; display: block; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.icon-btn.solid { background: var(--ink); color: #fff; border-color: var(--ink); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }

.seg.icon-seg button { width: 36px; height: 32px; padding: 0; display: inline-grid; place-items: center; }

.spinner {
  width: 26px;
  height: 26px;
  margin: 28px auto;
  border: 3px solid #eee;
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 22px;
  margin-top: 16px;
}

.card, .panel, .request-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.card { overflow: hidden; }

a.pair-card {
  color: inherit;
  text-decoration: none;
  display: grid;
  gap: 10px;
  padding: 12px;
}

a.pair-card .pair {
  gap: 10px;
  background: transparent;
}

a.pair-card .face {
  border-radius: 16px;
}

a.pair-card .split {
  border-radius: 999px;
}

.split {
  display: flex;
  height: 8px;
  background: #1d1a16;
}

.split i {
  display: block;
  height: 100%;
  background: #e07a55;
  min-width: 0;
}

.split i:last-child { flex: 1; background: #1d1a16; }

.pair, .hero-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.pair { height: 292px; gap: 3px; background: #f2f2f2; text-decoration: none; }

.card-body, .panel, .request-card { padding: 14px 16px 16px; }

.card h2 { margin: 8px 0 6px; font-size: 20px; }

.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  min-height: 3em;
}

.meta { color: var(--muted); font-size: 13px; font-weight: 700; }

.stats { display: flex; flex-wrap: wrap; gap: 6px; }

.stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: #f4f4f4;
  color: var(--ink);
  line-height: 1;
}

.stat .icon { width: 15px; height: 15px; color: var(--muted); }

.stat-label, .stat-unit {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat b {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.pill, .chip, .medal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f3f3f3;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.pill.wait { background: #fff1d2; }
.pill.ok { background: #e4f6e8; color: #1f6b3a; }
.pill.no { background: #fde8e2; color: var(--red-deep); }
.medal { background: #f3f3f3; color: var(--ink); }

.btn {
  border: 1px solid transparent;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn.light {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn:disabled { opacity: 0.45; cursor: default; }

.actions { margin-top: 12px; }
.actions.center { justify-content: center; }

.face {
  position: relative;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.45), transparent 42%);
  pointer-events: none;
}

.face.has-photo { background: #161310; }
.face.has-photo::after { display: none; }

.face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.face-emoji, .face-name { position: relative; z-index: 1; }

.face-emoji {
  font-size: 64px;
  filter: drop-shadow(0 10px 0 rgba(255, 255, 255, 0.28));
}

.face-name {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.face.has-photo .face-name {
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 0;
  padding: 36px 12px 12px;
  background: linear-gradient(180deg, transparent, rgba(16, 12, 8, 0.82));
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.face.large { min-height: 280px; border-radius: 28px; }
.face.large .face-emoji { font-size: clamp(84px, 12vw, 148px); }
.face.large .face-name { font-size: 20px; }
.face.large.has-photo .face-name { padding: 56px 18px 16px; }

.face.tiny { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.face.tiny .face-emoji { font-size: 26px; }
.face.tiny .face-name { display: none; }

.back {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.hero-pair { gap: 10px; }
.hero-pair .face { min-height: 320px; }

.play-setup { margin: 16px 0; }

.candidate-wrap {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding-bottom: 6px;
  margin-bottom: 22px;
}

.mini {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 74px;
  font-size: 12px;
  font-weight: 800;
}

.duel {
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  gap: 12px 10px;
  align-items: start;
}

.duel-tools { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; gap: 8px; }
.duel .split { grid-column: 1 / -1; grid-row: 3; border-radius: 999px; overflow: hidden; }

.duel .pick-l { grid-column: 1; grid-row: 2; }
.duel .vs { grid-column: 2; grid-row: 2; align-self: center; }
.duel .pick-r { grid-column: 3; grid-row: 2; }
.duel .side-l { grid-column: 1; grid-row: 4; }
.duel .side-r { grid-column: 3; grid-row: 4; }
.duel-note { grid-column: 1 / -1; grid-row: 5; margin: 0; }
.duel-note:empty { display: none; }

.duel .pick .face { min-height: min(520px, 62vh); border-radius: 28px; }
.duel .vs { width: 48px; height: 48px; }

.request-pair { min-height: 180px; }
.request-pair img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.request-pair span {
  display: grid;
  place-items: center;
  padding: 12px;
  font-weight: 800;
  background: #f6f6f6;
}
.request-head { display: grid; gap: 6px; }
.request-form textarea { min-height: 72px; }
.request-meta { display: grid; gap: 2px; padding: 12px 14px 14px; }
.request-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px;
  background: #f6f6f6;
}
.request-thumbs img, .request-thumbs span {
  width: 72px;
  height: 96px;
  flex: none;
  object-fit: cover;
  border-radius: 12px;
  background: #fff;
}
.request-thumbs span {
  display: grid;
  place-items: center;
  padding: 6px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.shot-card { position: relative; }
.shot-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.94);
}
.lineup.duel .shot { aspect-ratio: 3 / 4; }
.request-card { padding: 0; overflow: hidden; }
.request-card.wait { box-shadow: inset 0 0 0 3px #e3b341; }
.request-card.ok { box-shadow: inset 0 0 0 3px #2f9e62; }
.request-card.no { box-shadow: inset 0 0 0 3px #d4533a; }
.request-card .row { padding: 10px 12px 12px; }
.request-card input { flex: 1; min-width: 0; }
.board form > .icon-btn { justify-self: end; }

.drawer-close { position: absolute; top: 12px; right: 12px; z-index: 2; }

.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea { min-height: 46px; }

.like {
  height: auto;
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.like .icon { width: 16px; height: 16px; }

.nick-modal { display: grid; gap: 10px; }
.nick-modal input { width: 100%; }

.login-card { width: min(380px, 100%); margin: 8vh auto 0; }
.login-card h1 { margin: 0; font-size: 28px; }
.login-head { display: grid; gap: 4px; margin-bottom: 6px; }
.login-head .muted { margin: 0; }
.login-card .btn { width: 100%; min-height: 46px; }
.login-card .form-error:empty { display: none; }
.admin-tools { align-items: center; }
.admin-list { margin-top: 4px; }
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 0 12px 14px;
}
.admin-actions input { flex: 1 1 160px; min-width: 0; }
.admin-actions .btn { min-height: 42px; }

.sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.side {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px 16px 8px;
  min-width: 0;
}

.side-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.side-head strong { display: block; }
.side-head .muted { display: block; font-size: 13px; }

.lineup.duel { grid-template-columns: 1fr 1fr; }
.section-title { margin: 22px 0 10px; }

.stack, .field { display: grid; gap: 8px; }

.field span { font-size: 13px; font-weight: 800; }
.field input, .field textarea, .field select { width: 100%; }

textarea { resize: vertical; width: 100%; }

.comments { display: grid; }

.comment {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}

.comment-body { white-space: pre-wrap; margin-top: 6px; }

.comment-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

.reply-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.reply-toggle:hover { color: var(--red-deep); }

.reply-form { margin-top: 8px; }
.reply-form textarea { min-height: 40px; }

.replies {
  display: grid;
  margin-top: 4px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.comment.reply { padding: 10px 0 4px; border-top: 0; }

.like.on {
  background: #fde8e2;
  border-color: #f0b2a4;
  color: var(--red-deep);
}

.rank-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }

.rank-row {
  display: grid;
  grid-template-columns: 36px 64px 1fr;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 12px;
}

.rank-no { font-size: 20px; font-weight: 800; text-align: center; }

.rank-main { display: grid; gap: 4px; }

.bar {
  height: 8px;
  background: #f3f3f3;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #e07a55, #1d1a16);
  border-radius: inherit;
}

.photo-chip img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}

.board { width: min(960px, 100%); min-width: 0; max-width: 100%; }
.request-form { width: 100%; min-width: 0; }
.request-form input,
.request-form textarea,
.request-form .seg.cats,
.request-form .lineup { width: 100%; max-width: 100%; min-width: 0; }

.shot.has-photo .shot-hint {
  position: absolute;
  left: 8px;
  bottom: 8px;
}

.lineup {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
  min-width: 0;
}

.shot-card { display: grid; gap: 8px; min-width: 0; }

.shot {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 1;
  align-self: start;
  border-radius: 18px;
  border: 1px dashed #d9d9d9;
  background: #fafafa;
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.shot.has-photo { border-style: solid; border-color: transparent; }

.shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot-hint {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
}

.shot input { display: none; }

.text-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.text-link:disabled { opacity: 0.4; cursor: default; }

.mini-row { display: flex; gap: 6px; }
.mini-row img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 10px;
}

.cand-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 8px;
}

.row.spread { justify-content: space-between; }

.banner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}

.banner.error { background: #fde8e2; border-color: #f0b2a4; }
.banner.ok { background: #e8f6ec; border-color: #b7e0c4; }

.form-error {
  color: var(--red-deep);
  min-height: 1.2em;
  font-size: 13px;
  font-weight: 700;
}

.empty { padding: 42px 8px; text-align: center; color: var(--muted); }

.modal-back, .drawer-back {
  position: fixed;
  inset: 0;
  background: rgba(29, 26, 22, 0.46);
  z-index: 30;
}

.modal-back { display: grid; place-items: center; padding: 18px; }

.drawer-back { border: 0; cursor: pointer; }

.modal {
  width: min(440px, 100%);
  background: var(--card);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 31;
  width: min(420px, 100%);
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.08);
}

.drawer-top, .chat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
}

.drawer-host { flex: 1; min-height: 0; }

.chat-page {
  height: calc(100dvh - 180px);
  min-height: 460px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-host, .drawer .chat { height: 100%; }

.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
}

.drawer .chat { border: 0; border-radius: 0; }

.chat-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }

.live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d0d0d0;
}

.live.on { background: #2f9e62; }

.online {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.person {
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 8px;
}

.log {
  flex: 1;
  overflow: auto;
  padding: 8px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
}

.pad { padding: 18px 6px; }

.bubble {
  max-width: min(460px, 86%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 6px;
  padding: 8px 12px;
}

.bubble p { white-space: pre-wrap; }

.bubble.mine {
  margin-left: auto;
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  border-radius: 16px 16px 6px 16px;
}

.who { font-size: 12px; font-weight: 800; margin-bottom: 3px; color: var(--muted); }
.bubble.mine .who { color: #f0c7bc; }

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.chat-form input { flex: 1; }

body.is-play .foot { display: none; }
body.is-play .main { width: min(1180px, calc(100% - 16px)); padding-top: 10px; }

.play-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.play-head .back { margin: 0; }
.play-head strong { display: block; }
.play-head span { color: var(--muted); font-size: 13px; font-weight: 700; }

.round-status {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 8px;
}

.round-status strong {
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.045em;
  line-height: 1;
}

.round-status span {
  color: var(--ink);
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 800;
}

.round-status b {
  color: var(--red);
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.04em;
  line-height: 1;
}

.progress {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.progress i {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #ececec;
}

.progress i.done { background: var(--ink); }
.progress i.now { background: var(--red); }

.versus {
  display: grid;
  grid-template-columns: 1fr 72px 1fr;
  gap: 12px;
  min-height: calc(100dvh - 230px);
}

.pick {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 28px;
  transition: transform 160ms ease, opacity 160ms ease;
}

.pick .face { height: 100%; }

.pick:hover { transform: translateY(-3px); }
.pick.flash { transform: scale(1.015); }
.pick.flash .face, .pick.chosen .face { box-shadow: inset 0 0 0 5px rgba(29, 26, 22, 0.85); }
.pick.dim { opacity: 0.42; }
.pick:disabled { cursor: default; }
.pick:disabled:hover, .pick.chosen:hover { transform: none; }
.choice-mark {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1d1a16;
  color: #fff;
  display: grid;
  place-items: center;
}

.vs {
  align-self: center;
  justify-self: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.key-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }

.winner {
  min-height: calc(100dvh - 180px);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
}

.winner .face { width: min(460px, 88vw); }

.stamp {
  display: inline-block;
  border: 3px solid var(--red);
  color: var(--red);
  font-weight: 800;
  letter-spacing: 0.18em;
  padding: 2px 10px;
  border-radius: 8px;
  transform: rotate(-8deg);
}

.round-banner {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 25;
}

.round-banner span {
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 28px;
  font-weight: 800;
  animation: pop 680ms ease;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  z-index: 40;
  font-weight: 700;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes pop {
  from { transform: scale(0.86); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.world-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.world-card h2,
.world-card .clamp,
.world-card .stats,
.world-card .actions {
  padding-left: 4px;
  padding-right: 4px;
}

.world-card h2 { margin: 0; font-size: 18px; }
.world-card .clamp { min-height: 0; margin: 0; }
.world-card .clamp:empty { display: none; }
.world-card .pair {
  height: 220px;
  gap: 10px;
  background: transparent;
}
.world-card .face { border-radius: 16px; }
.world-card .actions { margin-top: 0; padding-bottom: 2px; }

.setup { display: grid; gap: 12px; align-content: start; }
.field-label { margin: 4px 0 0; font-weight: 800; }
.round-note { margin: 0; color: var(--muted); font-weight: 700; }
.rank-title { font-size: 22px; }

@media (max-width: 720px) {
  h1 { font-size: 28px; }
  .topbar { padding-top: env(safe-area-inset-top); }
  .topbar-inner {
    min-height: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "brand nav nick"
      "modes modes modes";
    gap: 8px;
    padding: 8px 0;
  }
  .topbar-inner.admin-bar {
    display: flex;
    align-items: center;
    min-height: 52px;
  }
  .brand { grid-area: brand; }
  .modes { grid-area: modes; width: auto; min-width: 0; order: unset; }
  .modes a {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 11px 8px;
    font-size: 14px;
  }
  .nav { grid-area: nav; margin-left: 0; justify-content: flex-end; }
  .nick {
    grid-area: nick;
    max-width: 28vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .main { padding-top: 14px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .filters { gap: 8px; }
  .search, .search-wrap { margin-left: 0; width: 100%; flex-basis: 100%; }
  .seg.cats, .filters .seg {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .seg.cats::-webkit-scrollbar, .filters .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: none; min-height: 36px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .pair, .world-card .pair { height: 200px; }
  .world-card .actions {
    display: grid;
    grid-template-columns: 1.15fr 1.15fr 0.7fr;
    gap: 8px;
  }
  .world-card .actions.duo {
    grid-template-columns: 1fr 0.7fr;
  }
  .world-card .btn { min-height: 42px; padding: 10px 6px; font-size: 13px; }
  .setup .actions, .winner .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .setup .actions .btn:first-child, .winner .actions .btn:first-child { grid-column: 1 / -1; }
  .duel-tools { width: 100%; min-width: 0; }
  .rank-title { flex: 1; min-width: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rank-row { grid-template-columns: 28px 52px minmax(0, 1fr); gap: 8px; }
  .face.tiny { width: 52px; height: 52px; }
  .duel {
    grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
    gap: 8px;
  }
  .duel > * { order: unset; }
  .duel-tools { grid-column: 1 / -1; grid-row: 1; flex-wrap: nowrap; overflow-x: auto; }
  .duel .pick-l { grid-column: 1; grid-row: 2; }
  .duel .vs { grid-column: 2; grid-row: 2; width: 36px; height: 36px; font-size: 12px; justify-self: center; }
  .duel .pick-r { grid-column: 3; grid-row: 2; }
  .duel .split { grid-column: 1 / -1; grid-row: 3; }
  .duel .side-l, .duel .side-r, .duel-note { grid-column: 1 / -1; }
  .duel .side-l { grid-row: 4; }
  .duel .side-r { grid-row: 5; }
  .duel-note { grid-row: 6; }
  .duel .pick { min-width: 0; }
  .duel .pick .face { min-height: 52vw; border-radius: 18px; }
  .duel .face.large .face-name, .duel .face.large.has-photo .face-name { font-size: 14px; padding: 24px 8px 8px; }
  .comment { grid-template-columns: auto minmax(0, 1fr); }
  .comment-form { align-items: stretch; }
  .comment-form textarea { min-height: 44px; font-size: 16px; }
  .hero-pair, .sides { grid-template-columns: 1fr; }
  .lineup { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lineup.duel .shot { aspect-ratio: 1; }
  .request-form h1 { font-size: 24px; }
  .request-form .lede { font-size: 14px; }
  .request-form .seg.cats {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .request-form .seg.cats::-webkit-scrollbar { display: none; }
  .request-form .seg.cats button { flex: none; min-height: 40px; }
  .shot-card input { width: 100%; min-width: 0; }
  .shot-remove { width: 36px; height: 36px; }
  .request-form .btn { width: 100%; min-height: 46px; }
  .request-form .btn[type="submit"] {
    position: sticky;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 5;
    box-shadow: 0 8px 18px rgba(23, 23, 23, 0.16);
  }
  .chat-page { height: calc(100dvh - 220px - env(safe-area-inset-top)); min-height: 320px; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); text-align: center; }
  input, textarea, select { font-size: 16px; }

  .play-head { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
  .play-head div { min-width: 0; }
  .play-head strong, .play-head span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.is-play #app, body.is-play .shell { height: 100dvh; }
  body.is-play .shell { display: flex; flex-direction: column; min-height: 0; }
  body.is-play .topbar-inner {
    grid-template-areas: "brand nav nick";
    min-height: 48px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  body.is-play .modes, body.is-play .key-hint { display: none; }
  body.is-play .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - 12px - env(safe-area-inset-left) - env(safe-area-inset-right));
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    min-height: 0;
    overflow: auto;
  }
  body.is-play .arena, body.is-play .stage {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  body.is-play .versus {
    flex: 1;
    min-height: 0;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 8px;
  }
  body.is-play .versus .vs { display: none; }
  body.is-play .versus .pick { min-width: 0; min-height: 0; height: 100%; }
  body.is-play .versus .face.large {
    min-height: 0;
    height: 100%;
    border-radius: 18px;
  }
  body.is-play .versus .face.large .face-name,
  body.is-play .versus .face.large.has-photo .face-name { font-size: 15px; padding: 28px 8px 10px; }
  body.is-play .play-head { margin-bottom: 6px; }
  body.is-play .progress { margin-bottom: 8px; }
  body.is-play .winner { min-height: auto; padding: 8px 0 12px; }
  body.is-play .winner .face.large { width: min(100%, 420px); min-height: 220px; height: auto; }
  body.is-play .arena:has(.winner),
  body.is-play .stage:has(.winner) { flex: none; display: block; min-height: auto; }
}

@media (max-height: 500px) and (orientation: landscape) {
  body.is-play .key-hint { display: none; }
  body.is-play .versus { min-height: 0; }
  .duel .pick .face { min-height: 34vh; }
}

@media (hover: none) {
  .pick:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

body.is-world-play {
  overflow: hidden;
}

body.is-world-play .topbar { display: none; }

body.is-world-play #app,
body.is-world-play .shell {
  height: 100dvh;
  min-height: 100dvh;
}

body.is-world-play .shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.is-world-play .main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: calc(100% - 12px - env(safe-area-inset-left) - env(safe-area-inset-right));
  max-width: none;
  min-height: 0;
  margin: 0 auto;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  overflow: hidden;
}

body.is-world-play .arena,
body.is-world-play .stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.is-world-play .play-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0;
}

body.is-world-play .versus {
  flex: 1;
  min-height: 0;
  height: auto;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
}

body.is-world-play .versus .pick {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

body.is-world-play .versus .face.large {
  min-height: 0;
  height: 100%;
  border-radius: 18px;
}

body.is-world-play .arena:has(.winner),
body.is-world-play .stage:has(.winner) {
  display: block;
  overflow: auto;
}

body.is-world-play .winner {
  min-height: 100%;
}

body.is-world-play .main:has(.winner) { overflow: auto; }
