/* PICK! Warm paper, tactile buttons, two distinct motion directions. */
:root {
  color-scheme: light;
  --bg: #e9e5dc;
  --surface: #f4f0e7;
  --ink: #29241f;
  --muted: #68635b;
  --line: #d4cfc3;
  --coral: #ee7657;
  --coral-dark: #ab3d24;
  --food-bg: #eed0b7;
  --mint: #a4d8bf;
  --mint-dark: #1c654e;
  --drink-bg: #cadfd0;
  --accent: var(--coral);
  --accent-ink: #33231c;
  --soft: #e2ded3;
  --shadow: #c8c0b1;
  --danger: #b53736;
  --heart: #ba4054;
  --radius: 24px;
  --display: "Baloo 2", "Be Vietnam Pro", sans-serif;
  --body: "Be Vietnam Pro", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #211f1c;
  --surface: #2a2723;
  --ink: #fff3df;
  --muted: #bcb1a1;
  --line: #4b4238;
  --coral: #f28c6f;
  --coral-dark: #ffc1a8;
  --food-bg: #694330;
  --mint: #a0d8bd;
  --mint-dark: #b1e8cd;
  --drink-bg: #2d5244;
  --accent-ink: #30241e;
  --soft: #343029;
  --shadow: #151311;
  --danger: #ff9c96;
  --heart: #ff9db0;
}
* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
/* One scrollbar system for the document, lists, pickers and dialogs. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
@supports selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
::-webkit-scrollbar-corner {
  background: transparent;
}
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable both-edges;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--body);
  font-synthesis: none;
  cursor: default;
}
/* Natural flow fixes the document height before children start moving.
   Animation overflow is clipped; actual long pages keep their scrollbar. */
.page-frame {
  display: flow-root;
  overflow: clip;
}
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
}
/* One real composited page layer; no snapshot overlay can steal hover. */
.theme-surface {
  will-change: opacity;
}
html.theme-switching .theme-toggle {
  transform: none;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
a,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border: 0;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
  transform: none !important;
  box-shadow: none !important;
}
button,
summary,
a {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--mint-dark);
}
input,
textarea {
  min-width: 0;
  caret-color: var(--ink);
  cursor: text;
}
input:focus,
textarea:focus {
  border-color: var(--ink);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  overflow-wrap: anywhere;
}
h1,
h2 {
  font-family: var(--display);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
h1 {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 800;
}
h2 {
  font-weight: 800;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
svg {
  flex-shrink: 0;
}
button svg {
  pointer-events: none;
}
.icon {
  display: inline-block;
  vertical-align: middle;
}
.decorative-star {
  display: inline-block;
  vertical-align: -0.125em;
  pointer-events: none;
}
.mini-label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  line-height: 1.5;
}
.muted {
  color: var(--muted);
}
.coral-text {
  color: var(--coral-dark);
}
.full {
  width: 100%;
}
[hidden] {
  display: none !important;
}
.button {
  min-height: 48px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 700;
  border-radius: 12px;
  line-height: 1.3;
  transition:
    transform 0.16s,
    box-shadow 0.16s,
    background-color 0.2s;
  text-align: center;
  overflow-wrap: anywhere;
}
.button:hover:not(:disabled) {
  transform: translateY(-2px);
}
.button:active:not(:disabled) {
  transform: translateY(2px) scale(0.98);
  box-shadow: none;
}
.primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 60%, #392b20);
}
.secondary {
  background: var(--surface);
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
}
.danger {
  background: var(--danger);
  color: var(--bg);
}
.text-button {
  background: none;
  padding: 10px 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 8px;
}
.text-button:hover {
  color: var(--ink);
  background: var(--soft);
}
.text-link {
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
}
.text-link:hover {
  text-decoration: underline;
}
.icon-button {
  height: 44px;
  width: 44px;
  min-width: 44px;
  padding: 10px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition:
    background 0.15s,
    transform 0.15s;
}
.icon-button:hover {
  background: var(--soft);
}
.icon-button:active {
  transform: scale(0.93);
}
.danger-text {
  color: var(--danger) !important;
}
.wordmark {
  font-family: var(--display);
  font-size: 2.3rem;
  letter-spacing: -0.045em;
  font-weight: 800;
  line-height: 1;
  transform: none;
  display: inline-block;
}
.wordmark span {
  color: var(--coral-dark);
}
.topbar {
  max-width: 1280px;
  margin: 0 auto;
  height: 108px;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.desktop-nav {
  display: flex;
  gap: 6px;
  background: var(--soft);
  padding: 5px;
  border-radius: 100px;
}
.nav-link {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 100px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 44px;
}
.nav-link .icon {
  width: 18px;
  height: 18px;
}
.nav-link:hover {
  color: var(--ink);
}
.nav-link.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 3px #30251b0a;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 15px;
}
.account-menu,
.item-menu {
  position: relative;
}
.account-menu summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 600;
}
.account-menu summary > .icon {
  width: 15px;
}
.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  border-radius: 50%;
  font-weight: 800;
}
.menu-panel {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 5px);
  min-width: 170px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 7px 16px #20190c17;
}
.menu-panel button {
  min-height: 44px;
  width: 100%;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-radius: 8px;
  background: none;
  white-space: nowrap;
  font-size: 0.875rem;
}
.menu-panel button:hover {
  background: var(--soft);
}
.menu-label {
  display: block;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.8rem;
}
.mobile-nav {
  display: none;
}
main {
  outline: 0 !important;
}
.home-page,
.standard-page,
.category-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 44px 48px 70px;
}
.home-page,
.standard-page {
  padding-top: 32px;
}
.main-heading {
  margin: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.choice-card {
  border-radius: 30px;
  padding: 27px 32px 24px;
  overflow: hidden;
  position: relative;
  transition:
    transform 0.22s,
    box-shadow 0.22s;
  border: 2px solid transparent;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--food-bg) 80%, var(--ink));
}
.choice-card.food {
  background: var(--food-bg);
}
.choice-card.drink {
  background: var(--drink-bg);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--drink-bg) 80%, var(--ink));
}
.choice-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--ink) 30%, transparent);
}
.choice-card:active {
  transform: translateY(3px);
}
.choice-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.choice-number {
  font-size: 0.8rem;
  opacity: 0.6;
  font-weight: 700;
}
.choice-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 193px;
  gap: 20px;
}
.choice-body h2 {
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  white-space: nowrap;
  letter-spacing: -0.015em;
}
.hero-emoji {
  font-size: 7.4rem;
  line-height: 1.2;
  transform: rotate(-12deg);
  filter: drop-shadow(4px 7px 0 #00000010);
  transition: transform 0.3s;
}
.drink .hero-emoji {
  transform: rotate(12deg);
}
.choice-card:hover .hero-emoji {
  transform: translateY(-5px) rotate(0deg);
}
.choice-bottom {
  border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  padding-top: 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 500;
  gap: 12px;
}
.circle-arrow {
  height: 46px;
  width: 46px;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.home-under {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 31px 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.home-under > span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-under .icon {
  width: 18px;
}
.small-cross {
  color: var(--coral-dark);
}
.recent-section {
  margin-top: 18px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}
.section-heading h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 35px;
}
.title-with-back {
  display: flex;
  align-items: center;
  gap: 17px;
}
.title-with-back h1 {
  font-size: 2.6rem;
}
.back-button {
  border: 1.5px solid var(--line);
  background: var(--surface);
}
.mode-switch {
  display: flex;
  padding: 5px;
  background: var(--soft);
  border-radius: 16px;
  gap: 5px;
}
.mode-switch button {
  padding: 12px 22px;
  min-height: 46px;
  border-radius: 11px;
  background: transparent;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
}
.mode-switch button.selected {
  background: var(--ink);
  color: var(--bg);
}
.category-page.drink {
  --accent: var(--mint);
  --accent-ink: #1d4032;
}
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: 40px;
  align-items: start;
}
.play-section {
  min-width: 0;
}
.pool-bar {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
  min-height: 44px;
}
.pool-label {
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}
.segmented {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.segmented button {
  padding: 9px 13px;
  min-height: 40px;
  background: transparent;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}
.segmented button.selected {
  background: var(--soft);
  color: var(--ink);
  font-weight: 700;
}
.machine {
  border: 1.5px solid var(--line);
  border-radius: 26px;
  background: var(--soft);
  padding: 18px;
  box-shadow: 0 5px 0 var(--line);
}
.machine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 6px 15px;
}
.machine-header .mini-label {
  font-size: 0.69rem;
  letter-spacing: 0.12em;
}
.pool-count {
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  background: var(--surface);
  padding: 4px 8px;
  white-space: nowrap;
}
.machine-inner {
  background: var(--surface);
  border-radius: 16px;
  min-height: 367px;
  padding: 28px;
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ready-ticket {
  width: 100%;
}
.question-mark {
  width: 82px;
  height: 97px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 5px 5px 0 var(--accent);
  display: grid;
  place-items: center;
  font: 700 4rem/1.2 var(--display);
  transform: rotate(-7deg);
  margin: 9px auto 27px;
  background: var(--surface);
}
.ready-ticket h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}
.ready-ticket p {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 320px;
  margin: auto;
}
.start-button {
  width: min(100%, 295px);
  margin-top: 31px;
}
.machine-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  min-height: 38px;
  padding-top: 15px;
  color: var(--muted);
  font-size: 0.75rem;
  flex-wrap: wrap;
}
.machine-dots {
  font-size: 0.55rem;
  letter-spacing: 3px;
  color: var(--coral-dark);
}
.drink .machine-dots {
  color: var(--mint-dark);
}
.machine-foot .text-button {
  font-size: 0.75rem;
  padding: 2px 4px;
  min-height: 28px;
}
.machine-foot .icon {
  width: 13px;
  height: 13px;
}
.list-section {
  padding-top: 3px;
  min-width: 0;
}
.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 23px;
  min-height: 41px;
}
.list-heading .mini-label {
  font-size: 0.63rem;
  color: var(--muted);
}
.list-heading h2 {
  font-size: 1.5rem;
  margin-top: 5px;
}
.list-heading h2 span {
  color: var(--muted);
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 400;
  margin-left: 3px;
}
.add-button {
  padding: 10px 12px;
  min-height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 2px 0 var(--line);
}
.add-button .icon {
  width: 18px;
  height: 18px;
}
.item-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 5px;
}
.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  min-height: 81px;
  position: relative;
}
.item-row:last-child {
  border-bottom: 0;
}
.item-copy {
  min-width: 0;
  flex: 1;
}
.item-copy h3 {
  font-size: 0.95rem;
}
.item-copy p {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-visual {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.item-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.item-visual.small {
  height: 48px;
  width: 48px;
  border-radius: 14px;
  background: var(--soft);
  font-size: 1.7rem;
}
.heart {
  color: var(--muted);
}
.heart .icon {
  width: 20px;
  height: 20px;
}
.is-favorite {
  color: var(--heart);
}
.is-favorite .icon {
  fill: currentColor;
  stroke: currentColor;
}
.item-row .heart {
  margin-left: auto;
}
.item-menu {
  margin-left: -9px;
}
.item-menu summary {
  list-style: none;
}
.item-menu summary::-webkit-details-marker,
.account-menu summary::-webkit-details-marker {
  display: none;
}
.item-menu .icon-button {
  width: 34px;
  min-width: 34px;
  padding: 6px;
  border-radius: 8px;
}
.item-menu .menu-panel {
  top: calc(100% - 4px);
}
.item-row:has(.item-menu[open]) {
  z-index: 31;
}
.item-row:last-child .item-menu .menu-panel,
.item-row:nth-last-child(2) .item-menu .menu-panel {
  top: auto;
  bottom: 100%;
}
.custom-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  background: var(--soft);
  border-radius: 10px;
  padding: 0 10px;
}
.pick-check {
  display: block;
  flex-shrink: 0;
  position: relative;
  height: 44px;
  width: 28px;
  cursor: pointer;
}
.pick-check input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.pick-check > span {
  position: absolute;
  top: 11px;
  left: 0;
  width: 23px;
  height: 23px;
  border-radius: 6px;
  border: 1.5px solid var(--muted);
  pointer-events: none;
  display: grid;
  place-items: center;
}
.pick-check .icon {
  width: 16px;
  opacity: 0;
}
.pick-check input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.pick-check input:checked + span .icon {
  opacity: 1;
}
.pick-check input:focus-visible + span {
  outline: 3px solid var(--mint-dark);
  outline-offset: 3px;
}
.result-ticket {
  width: 100%;
  position: relative;
}
.result-visual {
  width: 105px;
  height: 105px;
  font-size: 4.4rem;
  border-radius: 20px;
  margin-bottom: 16px;
}
.result-ticket .mini-label {
  color: var(--muted);
  font-size: 0.7rem;
}
.result-ticket h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  margin: 8px 0;
  line-height: 1.2;
}
.result-note {
  color: var(--muted);
  font-size: 0.875rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
  margin-top: 12px;
  max-height: 100px;
  overflow: auto;
}
.ticket-divider {
  border-top: 2px dashed var(--line);
  margin: 22px 0;
}
.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 17px;
}
.result-actions .button {
  font-size: 0.875rem;
  min-height: 43px;
  padding: 9px 16px;
}
.result-actions .text-button {
  font-size: 0.75rem;
}
.result-ticket .button:disabled,
.battle-final .button:disabled {
  background: var(--soft);
  color: var(--muted);
  opacity: 1;
}
.shuffle-display {
  width: 100%;
  padding: 25px 0;
}
.shuffle-display .mini-label {
  color: var(--muted);
}
.slot-window {
  height: 72px;
  overflow: hidden;
  margin: 40px -10px 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
}
.slot-track {
  will-change: transform;
}
.slot-row {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 800;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.shuffle-indicator {
  font-size: 2rem;
  color: var(--coral-dark);
}
.shuffle-display p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 19px;
}
.battle-lobby {
  min-height: 440px;
  background: var(--soft);
  border: 1.5px solid var(--line);
  border-radius: 25px;
  text-align: center;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.battle-label {
  color: var(--muted);
}
.lobby-versus {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 32px 0 25px;
}
.lobby-versus > span {
  width: 94px;
  height: 110px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 3rem;
  box-shadow: 0 5px 0 var(--line);
  transform: rotate(-8deg);
}
.lobby-versus > span:last-child {
  transform: rotate(8deg);
}
.lobby-versus b {
  font-size: 1.4rem;
  font-style: italic;
  transform: rotate(-8deg);
}
.battle-lobby h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}
.battle-lobby > p {
  color: var(--muted);
  font-size: 0.875rem;
}
.battle-lobby > .button {
  margin: 27px 0 16px;
  min-width: 240px;
}
.battle-lobby .battle-help {
  font-size: 0.75rem;
}
.battle-lobby > .text-button {
  margin-top: 12px;
}
.battle-stage {
  min-height: 440px;
  padding: 7px 0 0;
  overflow: hidden;
}
.battle-progress {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 24px;
  font-size: 0.875rem;
  color: var(--muted);
}
.battle-progress strong {
  color: var(--ink);
}
.battle-progress [role="progressbar"] {
  height: 6px;
  flex: 1;
  background: var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.battle-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}
.arena {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  position: relative;
  padding: 8px 2px;
}
.battle-card {
  padding: 20px 17px 18px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--line);
  min-width: 0;
  min-height: 294px;
  display: flex;
  align-items: center;
  flex-direction: column;
  position: relative;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.battle-card:disabled {
  opacity: 1;
}
.battle-card.left {
  background: color-mix(in srgb, var(--accent) 17%, var(--surface));
}
.battle-card:hover {
  border-color: var(--accent);
}
.battle-card.round-winner {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 45%, var(--surface));
}
.contestant-label {
  min-height: 23px;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--muted);
}
.battle-visual {
  width: 86px;
  height: 86px;
  border-radius: 15px;
  font-size: 3.7rem;
  margin: 16px 0;
}
.battle-card h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin-bottom: 24px;
}
.battle-pick {
  margin-top: auto;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
}
.battle-pick .icon {
  width: 18px;
}
.versus {
  position: absolute;
  top: 47%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%) rotate(-8deg);
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.3rem;
  background: var(--ink);
  color: var(--bg);
  border: 4px solid var(--bg);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.battle-caption {
  text-align: center;
  margin-top: 27px;
  color: var(--muted);
  font-size: 0.8rem;
}
.battle-final {
  padding: 27px;
  min-height: 440px;
  background: var(--soft);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.trophy {
  font-size: 2.7rem;
  margin: 10px;
}
.champion-ticket {
  width: 100%;
  margin: 4px 0 20px;
}
.champion-ticket .result-visual {
  font-size: 4.5rem;
  margin-bottom: 8px;
}
.champion-ticket h2 {
  font-size: 2rem;
  line-height: 1.2;
}
.champion-ticket p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 12px;
}
.battle-final > .button {
  max-width: 100%;
  white-space: normal;
}
.battle-final > .text-button {
  margin-top: 16px;
}
.particles {
  position: absolute;
  pointer-events: none;
  inset: 0;
}
.particles i {
  position: absolute;
  left: 50%;
  top: 36%;
  width: 6px;
  height: 10px;
  background: var(--accent);
  border-radius: 2px;
  animation: particle 0.7s ease-out forwards;
  --angle: calc(var(--i) * 45deg);
  transform: rotate(var(--angle));
}
.particles i:nth-child(even) {
  background: var(--mint);
}
@keyframes particle {
  0% {
    opacity: 1;
    transform: rotate(var(--angle)) translateY(-32px);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translateY(-130px) rotate(90deg);
  }
}
.empty-state {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-mark {
  border: 1.5px dashed var(--line);
  border-radius: 50%;
  height: 58px;
  width: 58px;
  display: grid;
  place-items: center;
  color: var(--muted);
  margin-bottom: 5px;
}
.empty-state h3 {
  font-size: 1rem;
}
.empty-state p {
  color: var(--muted);
  font-size: 0.875rem;
  max-width: 300px;
}
.empty-state .button {
  margin-top: 10px;
  font-size: 0.875rem;
}
.favorites-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 42px;
}
.favorite-section {
  min-width: 0;
}
.favorite-section .section-heading {
  padding-bottom: 13px;
  border-bottom: 2px solid var(--food-bg);
}
.favorite-section.drink .section-heading {
  border-color: var(--drink-bg);
}
.favorite-section .item-list {
  max-height: none;
  overflow: visible;
}
.history-group {
  margin: 32px 0;
}
.history-group > h2 {
  font: 700 0.875rem var(--body);
  color: var(--muted);
  margin-bottom: 10px;
}
.history-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 22px;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 19px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.history-row:last-child {
  border: 0;
}
.history-row time {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.history-mode {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: var(--muted);
}
.history-mode .icon {
  width: 16px;
  height: 16px;
}
.dialog {
  border: 1.5px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  padding: 28px;
  width: min(460px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  box-shadow: 0 12px 40px #1e1a1526;
}
.dialog::backdrop {
  background: #17140f70;
  backdrop-filter: blur(3px);
}
.dialog[open] {
  animation: dialog-in 0.18s ease-out;
}
.dialog[open]::backdrop {
  animation: backdrop-in 0.18s ease-out;
}
.dialog.closing {
  pointer-events: none;
  animation: none;
}
.dialog.closing::backdrop {
  animation: backdrop-out 0.16s ease-in both;
}
@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes backdrop-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 25px;
}
.dialog-heading h2 {
  font-size: 1.6rem;
  line-height: 1.25;
}
.dialog-heading .icon-button {
  margin: -10px -12px -10px 0;
  flex-shrink: 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-weight: 400;
  outline-offset: 2px;
}
.field input {
  height: 49px;
}
.field textarea {
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
}
.form-error {
  color: var(--danger);
  font-size: 0.875rem;
  line-height: 1.4;
  min-height: 0;
  margin: 0;
}
.form-error:not(:empty) {
  padding: 10px 0;
}
.dialog .full {
  margin-top: 20px;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  background: var(--ink);
  color: var(--bg);
  border-radius: 14px;
  padding: 13px 18px;
  max-width: min(580px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 20px;
  transition:
    transform 0.2s,
    opacity 0.2s;
  font-size: 0.875rem;
  box-shadow: 0 5px 20px #0002;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
#toast button {
  color: var(--bg);
  text-decoration: underline;
  background: none;
  font-weight: 700;
  white-space: nowrap;
  min-height: 35px;
}
.login-page {
  max-width: 1240px;
  margin: auto;
  padding: 0 48px;
}
.login-header {
  height: 115px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.login-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 100px;
  align-items: center;
  min-height: calc(100dvh - 190px);
  padding: 20px 0 70px;
}
.login-art {
  position: relative;
  border-radius: 28px;
  background: var(--soft);
  padding: 37px 40px 0;
  overflow: hidden;
}
.login-art > .mini-label {
  color: var(--muted);
  font-size: 0.65rem;
}
.login-art h1 {
  font-size: 4.5rem;
  margin-top: 22px;
  letter-spacing: -0.015em;
  line-height: 1.13;
}
.login-art h1 > span {
  color: var(--coral-dark);
}
.emoji-tickets {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  padding: 20px 0 38px;
}
.emoji-ticket {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 124px;
  border: 2px solid var(--ink);
  border-radius: 15px;
  font-size: 3.1rem;
  box-shadow: 3px 4px 0 var(--ink);
  transform: rotate(-12deg);
  color: var(--ink);
}
.emoji-ticket span {
  font: 700 0.65rem var(--body);
  letter-spacing: 0.05em;
  margin-top: 6px;
}
.emoji-ticket.coral {
  background: var(--food-bg);
}
.emoji-ticket.mint {
  background: var(--drink-bg);
  transform: rotate(9deg);
  margin-top: -30px;
}
.checker {
  height: 18px;
  background: repeating-conic-gradient(var(--ink) 0% 25%, transparent 0% 50%) 0
    0/18px 18px;
  margin: 0 -40px;
  opacity: 0.18;
}
.login-form-wrap {
  max-width: 370px;
  width: 100%;
  padding-bottom: 15px;
}
.login-form-wrap > .mini-label {
  color: var(--muted);
  margin-bottom: 12px;
}
.login-form-wrap h2 {
  font-size: 2.6rem;
  margin-bottom: 32px;
}
.login-form-wrap .field {
  margin-bottom: 22px;
}
.login-form-wrap .full {
  margin-top: 15px;
  justify-content: space-between;
}
.login-form-wrap input {
  background: var(--surface);
}
.storage-error {
  max-width: 600px;
  padding: 60px 24px;
  margin: auto;
}
.storage-error h1 {
  font-size: 2rem;
  margin: 40px 0 20px;
}
.storage-error p {
  margin-bottom: 16px;
}
.page-enter {
  animation: page-in 0.24s ease-out;
}
.fresh {
  animation: added 0.28s ease-out;
}
@keyframes page-in {
  from {
    opacity: 0.4;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes dialog-in {
  from {
    opacity: 0.5;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes added {
  from {
    opacity: 0;
    transform: translateY(-9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* V1 refinements: local Vietnamese fonts, explicit choices, quiet inputs. */
::selection {
  background: transparent;
  color: inherit;
}
::-moz-selection {
  background: transparent;
  color: inherit;
}
a,
summary,
input[type="checkbox"],
.tactile-check,
.tactile-check * {
  cursor: pointer;
}
.section-heading h2,
.list-heading h2,
.dialog-heading h2,
.login-form-wrap h2 {
  font-family: var(--body);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
}
.item-copy h3 {
  line-height: 1.55;
}
.result-ticket h2,
.battle-card h2,
.champion-ticket h2 {
  line-height: 1.3;
}
.add-button {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  min-height: 44px;
}
.dialog.drink {
  --accent: var(--mint);
  --accent-ink: #1d4032;
}
.item-dialog {
  --dialog-pad: 24px;
  width: min(540px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
}
#item-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 42px);
}
.item-dialog .dialog-heading {
  margin: 0;
  padding: 18px var(--dialog-pad) 12px;
  flex-shrink: 0;
}
.item-form-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px var(--dialog-pad) 8px;
}
.item-name-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
}
.item-name-row .field {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.item-favorite {
  flex: 0 0 49px;
  height: 49px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 3px 0 var(--line);
}
.item-favorite.is-favorite {
  background: color-mix(in srgb, var(--heart) 10%, var(--surface));
  border-color: var(--heart);
}
.item-choice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}
.item-choice-layout .choice-picker {
  margin: 0;
}
.item-note {
  margin: 0;
}
.optional-label {
  margin-left: 8px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}
.dialog-footer {
  flex-shrink: 0;
  padding: 12px var(--dialog-pad) 20px;
  background: var(--surface);
}
.dialog-footer .button {
  width: 100%;
}
.tactile-check {
  position: relative;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
  line-height: 1.5;
}
.tactile-check input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  z-index: 1;
}
.checkbox-mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--muted);
  border-radius: 6px;
  box-shadow: 0 2px 0 var(--line);
  background: var(--surface);
  transition:
    background 0.15s,
    transform 0.15s;
}
.tactile-check .checkbox-mark .icon {
  width: 16px;
  height: 16px;
  opacity: 0;
  color: var(--accent-ink);
}
.tactile-check input:checked + .checkbox-mark {
  background: var(--accent);
  border-color: var(--accent-ink);
}
.tactile-check input:checked + .checkbox-mark .icon {
  opacity: 1;
}
.tactile-check input:focus-visible + .checkbox-mark {
  outline: 3px solid var(--mint-dark);
  outline-offset: 4px;
}
.tactile-check input:active + .checkbox-mark {
  transform: translateY(2px);
  box-shadow: none;
}
.remember-check {
  margin: -4px 0 5px;
}
.choice-picker {
  padding: 0;
  margin: 0 0 18px;
  border: 0;
  min-width: 0;
}
.choice-picker legend {
  padding: 0;
  margin-bottom: 10px;
  font-size: 0.875rem;
  font-weight: 600;
}
.tag-count {
  color: var(--muted);
  font-weight: 400;
}
.picker-options {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 8px;
  padding: 4px;
  margin: -4px;
}
.compact-options {
  max-height: 104px;
  overflow: hidden;
}
.icon-picker .compact-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
}
.tag-picker .compact-options [data-choice] {
  /* A long tag must still leave room for the final 44px dots button and gap. */
  max-width: calc(100% - 52px);
}
.picker-option {
  position: relative;
  border: 1.5px solid var(--line);
  background: var(--bg);
  min-height: 44px;
  height: 44px;
  min-width: 0;
  max-width: 100%;
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.8125rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 0 var(--line);
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
.picker-option:hover {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  border-color: var(--accent-ink);
  transform: translateY(-2px);
}
.picker-option:active {
  transform: translateY(1px);
  box-shadow: none;
}
.picker-option.selected {
  background: color-mix(in srgb, var(--accent) 65%, var(--surface));
  border-color: var(--accent-ink);
  color: var(--accent-ink);
  box-shadow: 0 2px 0 var(--accent-ink);
  font-weight: 600;
}
.icon-picker .picker-option,
.icon-gallery .picker-option {
  display: grid;
  place-items: center;
  padding: 0;
  width: 100%;
  overflow: visible;
}
.picker-emoji {
  font:
    25px/1 "Apple Color Emoji",
    "Segoe UI Emoji",
    "Noto Color Emoji",
    sans-serif;
  pointer-events: none;
  transition: transform 160ms ease;
}
/* Designed hover labels replace the browser's native title tooltip. */
.icon-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  pointer-events: none;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font: 500 11px/1.5 var(--body);
  text-align: center;
  overflow-wrap: anywhere;
  box-shadow: 0 4px 12px #00000020;
  opacity: 0;
  transform: translateY(3px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}
.icon-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.icon-picker [data-choice],
.icon-gallery [data-choice] {
  border-radius: 14px;
  background: var(--surface);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}
.icon-picker [data-choice].selected,
.icon-gallery [data-choice].selected {
  background: color-mix(in srgb, var(--accent) 32%, var(--surface));
  border-color: var(--accent-ink);
  box-shadow: 0 3px 0 var(--accent-ink);
}
@media (hover: hover) {
  .icon-picker [data-choice]:hover,
  .icon-gallery [data-choice]:hover {
    background: color-mix(in srgb, var(--accent) 20%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 75%, var(--ink));
    transform: translateY(-3px);
    box-shadow:
      0 5px 0 color-mix(in srgb, var(--accent) 35%, var(--line)),
      0 8px 14px #0000000b;
  }
  .icon-picker [data-choice]:hover .picker-emoji,
  .icon-gallery [data-choice]:hover .picker-emoji {
    transform: scale(1.12);
  }
}
.icon-picker [data-choice]:active,
.icon-gallery [data-choice]:active {
  transform: translateY(1px);
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  .icon-tooltip,
  .picker-emoji {
    transition: none;
  }
}
.picker-tick {
  display: none;
  position: absolute;
  right: -2px;
  bottom: -2px;
  background: var(--ink);
  color: var(--bg);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
}
.picker-tick .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2.5;
}
.picker-option.selected .picker-tick {
  display: flex;
}
.picker-more {
  display: inline-grid;
  place-items: center;
  width: 44px;
  padding: 0;
  border-style: dashed;
  background: var(--surface);
}
.picker-more .icon {
  width: 23px;
  height: 23px;
}
.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.item-tag {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  background: var(--soft);
  font-size: 0.68rem;
  line-height: 1.55;
  color: var(--muted);
}
html:has(.picker-overlay[open]) {
  overflow: hidden;
}
.dialog.picker-overlay {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  padding: clamp(12px, 3vw, 36px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}
.picker-overlay[open] {
  display: grid;
  place-items: center;
}
.picker-overlay::backdrop {
  background: #17140f85;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.picker-sheet {
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  height: 100%;
  min-height: 0;
  min-width: 0;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 15px 65px #17140f30;
  overflow: hidden;
}
.picker-sheet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 26px 16px;
  flex: 0 0 auto;
}
.picker-sheet-heading h2 {
  font-size: 1.7rem;
}
.picker-selection-count {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 3px;
}
.picker-sheet-heading .icon-button {
  flex-shrink: 0;
}
.picker-gallery {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 8px 26px 26px;
  flex: 1;
  align-content: start;
}
.icon-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 12px;
}
.icon-gallery .picker-option {
  height: 64px;
}
.icon-gallery .picker-emoji {
  font-size: 32px;
}
.tag-gallery {
  display: block;
}
.tag-section + .tag-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.tag-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tag-section-heading {
  margin-bottom: 10px;
}
.tag-section-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}
.tag-section-heading h3 {
  font: 600 1rem/1.4 var(--body);
}
.tag-add {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
}
.tag-section-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
}
.tag-section-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-gallery .picker-option {
  border-radius: 999px;
  padding-inline: 16px;
}
.tag-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 0 12px;
  padding: 0 26px 18px;
  flex-shrink: 0;
}
.tag-create-form .field {
  margin: 0;
}
.tag-create-form .button {
  min-height: 49px;
}
.tag-create-form .form-error {
  grid-column: 1 / -1;
}
.picker-sheet-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 26px 22px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.picker-sheet-footer .button {
  min-width: min(130px, 42%);
}
.tag-delete-mode .tag-gallery .picker-option:hover {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
  color: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--danger) 40%, var(--line));
}
.tag-delete-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.tag-delete-feedback[hidden] {
  display: none;
}
.tag-delete-feedback > span {
  overflow-wrap: anywhere;
}
.tag-delete-feedback .text-button {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .picker-sheet {
    border-radius: 20px;
  }
  .picker-sheet-heading {
    padding: 16px 16px 12px;
  }
  .picker-sheet-heading h2 {
    font-size: 1.5rem;
  }
  .picker-gallery {
    padding: 6px 16px 18px;
  }
  .icon-gallery {
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 10px;
  }
  .icon-gallery .picker-option {
    height: 54px;
  }
  .icon-gallery .picker-emoji {
    font-size: 28px;
  }
  .tag-create-form {
    padding: 0 16px 14px;
    gap: 0 8px;
  }
  .tag-create-form .button {
    padding-inline: 12px;
  }
  .tag-create-form .button .icon {
    display: none;
  }
  .picker-sheet-footer {
    padding: 12px 16px 16px;
  }
}
@media (max-height: 500px) {
  .dialog.picker-overlay {
    padding-block: 10px;
  }
  .picker-sheet-heading {
    padding-block: 10px;
  }
  .picker-sheet-heading h2 {
    font-size: 1.3rem;
  }
  .picker-selection-count {
    margin: 0;
  }
  .tag-create-form {
    padding-bottom: 10px;
  }
  .tag-create-form .field {
    gap: 4px;
  }
  .picker-sheet-footer {
    padding-block: 10px;
  }
}

@media (min-width: 1450px) {
  .choice-body {
    min-height: 214px;
  }
}
@media (max-width: 1050px) {
  .topbar {
    padding: 0 28px;
  }
  .home-page,
  .standard-page,
  .category-page {
    padding: 30px 28px 60px;
  }
  .play-layout {
    gap: 26px;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr);
  }
  .choice-card {
    padding: 24px;
  }
  .hero-emoji {
    font-size: 5.8rem;
  }
  .choice-body {
    min-height: 175px;
  }
  .choice-body h2 {
    font-size: 2.9rem;
  }
  .login-layout {
    gap: 55px;
  }
  .login-art {
    padding: 30px 28px 0;
  }
  .login-art h1 {
    font-size: 3.8rem;
  }
  .checker {
    margin: 0 -28px;
  }
  .machine-inner {
    padding: 22px;
  }
  .list-heading {
    flex-wrap: wrap;
  }
  .list-heading .add-button {
    padding: 8px 10px;
  }
  .add-button span {
    font-size: 0.8rem;
  }
  .battle-card {
    padding: 18px 10px;
  }
  .battle-card h2 {
    font-size: 1.2rem;
  }
  .battle-visual {
    width: 70px;
    height: 70px;
    font-size: 3rem;
  }
  .pool-bar {
    gap: 8px;
  }
  .segmented {
    gap: 0;
  }
  .segmented button {
    padding: 9px 10px;
  }
  .item-row {
    gap: 8px;
  }
}
@media (max-width: 800px) {
  .desktop-nav {
    gap: 0;
  }
  .nav-link {
    padding: 9px 12px;
  }
  .header-tools {
    gap: 5px;
  }
  .account-name {
    display: none;
  }
  .account-menu summary > .icon {
    display: none;
  }
  .topbar {
    height: 90px;
  }
  .play-layout {
    grid-template-columns: 1fr;
    gap: 35px;
  }
  .list-section {
    padding: 0;
  }
  .list-heading {
    margin-bottom: 12px;
  }
  .item-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .play-section {
    max-width: 600px;
    width: 100%;
    margin: auto;
  }
  .list-section {
    max-width: 600px;
    width: 100%;
    margin: auto;
  }
  .favorites-grid {
    gap: 26px;
  }
  .choice-grid {
    gap: 20px;
  }
  .choice-body {
    min-height: 158px;
  }
  .choice-body h2 {
    font-size: 2.4rem;
  }
  .hero-emoji {
    font-size: 4.8rem;
  }
  .choice-card {
    padding: 20px;
  }
  .choice-bottom {
    font-size: 0.8rem;
  }
  .circle-arrow {
    width: 38px;
    height: 38px;
  }
  .login-layout {
    gap: 35px;
  }
  .login-page {
    padding: 0 28px;
  }
  .login-art h1 {
    font-size: 3.2rem;
  }
  .emoji-ticket {
    width: 90px;
    height: 108px;
    font-size: 2.7rem;
  }
  .emoji-tickets {
    gap: 14px;
  }
  .login-form-wrap h2 {
    font-size: 2.1rem;
  }
  .machine-inner {
    min-height: 345px;
  }
  .battle-stage {
    min-height: 385px;
  }
  .arena {
    gap: 26px;
  }
  .battle-card {
    min-height: 272px;
  }
  .battle-card h2 {
    font-size: 1.7rem;
  }
  .battle-visual {
    width: 84px;
    height: 84px;
    font-size: 3.8rem;
  }
}
@media (max-width: 600px) {
  .topbar {
    height: 84px;
    padding: 0 22px;
  }
  .wordmark {
    font-size: 2.1rem;
  }
  .desktop-nav {
    display: none;
  }
  .header-tools {
    gap: 14px;
  }
  .mobile-nav {
    position: fixed;
    z-index: 40;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  }
  .mobile-nav .nav-link {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 5px 10px;
    font-size: 0.69rem;
    border-radius: 12px;
    max-width: 110px;
    min-height: 52px;
  }
  .mobile-nav .nav-link .icon {
    width: 21px;
    height: 21px;
  }
  .mobile-nav .nav-link.active {
    background: var(--soft);
    box-shadow: none;
  }
  .home-page,
  .standard-page,
  .category-page {
    padding: 24px 22px 112px;
  }
  .main-heading {
    margin: 2px 0 29px;
  }
  .main-heading h1 {
    font-size: 2.4rem;
    max-width: 330px;
  }
  .choice-grid {
    grid-template-columns: 1fr;
    gap: 23px;
  }
  .choice-card {
    padding: 20px 24px 18px;
    border-radius: 24px;
  }
  .choice-body {
    min-height: 125px;
  }
  .choice-body h2 {
    font-size: 2.8rem;
  }
  .hero-emoji {
    font-size: 5.2rem;
  }
  .choice-bottom {
    padding-top: 13px;
    font-size: 0.8rem;
  }
  .choice-top .mini-label {
    font-size: 0.65rem;
  }
  .choice-number {
    font-size: 0.7rem;
  }
  .home-under {
    padding: 25px 0 18px;
    gap: 12px;
    font-size: 0.7rem;
    flex-wrap: wrap;
  }
  .home-under .icon {
    width: 16px;
    height: 16px;
  }
  .home-under > span {
    gap: 5px;
  }
  .small-cross {
    font-size: 0.7rem;
  }
  .recent-section {
    margin-top: 12px;
  }
  .section-heading {
    gap: 8px;
  }
  .section-heading h2 {
    font-size: 1.1rem;
  }
  .text-link {
    font-size: 0.75rem;
  }
  .text-link .icon {
    width: 17px;
  }
  .page-heading {
    display: block;
    margin-bottom: 20px;
  }
  .title-with-back {
    gap: 13px;
    margin-bottom: 24px;
  }
  .title-with-back h1 {
    font-size: 2.2rem;
  }
  .mode-switch {
    width: 100%;
    border-radius: 13px;
  }
  .mode-switch button {
    flex: 1;
    padding: 11px 14px;
    font-size: 0.9rem;
    border-radius: 9px;
    min-height: 45px;
  }
  .mode-switch .icon {
    width: 19px;
  }
  .pool-bar {
    margin-bottom: 15px;
    justify-content: space-between;
    gap: 6px;
  }
  .pool-label {
    font-size: 0.8rem;
  }
  .segmented button {
    font-size: 0.8rem;
    padding: 9px 10px;
    min-height: 40px;
  }
  .machine {
    padding: 13px;
    border-radius: 21px;
  }
  .machine-header {
    padding: 2px 3px 12px;
  }
  .machine-header .mini-label {
    font-size: 0.58rem;
  }
  .pool-count {
    font-size: 0.65rem;
  }
  .machine-inner {
    min-height: 326px;
    padding: 25px 19px;
    border-radius: 12px;
  }
  .question-mark {
    width: 67px;
    height: 80px;
    font-size: 3.3rem;
    margin: 2px auto 27px;
  }
  .ready-ticket h2 {
    font-size: 1.4rem;
  }
  .ready-ticket p {
    font-size: 0.8rem;
  }
  .start-button {
    margin-top: 27px;
  }
  .machine-foot {
    font-size: 0.64rem;
    gap: 6px;
    padding-top: 11px;
  }
  .machine-dots {
    font-size: 0.45rem;
    letter-spacing: 1px;
  }
  .result-ticket h2 {
    font-size: 1.95rem;
  }
  .result-visual {
    width: 87px;
    height: 87px;
    font-size: 3.8rem;
    margin-bottom: 13px;
  }
  .result-ticket .mini-label {
    font-size: 0.6rem;
  }
  .result-actions {
    gap: 4px;
  }
  .result-actions .button {
    font-size: 0.8rem;
    padding: 8px 13px;
  }
  .result-actions .text-button {
    font-size: 0.7rem;
  }
  .ticket-divider {
    margin: 18px 0;
  }
  .list-heading h2 {
    font-size: 1.4rem;
  }
  .list-heading .mini-label {
    font-size: 0.6rem;
  }
  .item-row {
    gap: 10px;
    padding: 12px 0;
    min-height: 76px;
  }
  .item-row .item-copy h3 {
    font-size: 0.95rem;
  }
  .item-row .item-copy p {
    font-size: 0.75rem;
  }
  .item-visual.small {
    width: 43px;
    height: 43px;
    border-radius: 12px;
    font-size: 1.6rem;
  }
  .item-row .heart {
    margin-left: 0;
  }
  .item-menu {
    margin-left: -8px;
  }
  .item-menu .icon-button {
    width: 34px;
  }
  .play-layout {
    gap: 32px;
  }
  .battle-lobby {
    min-height: 385px;
    padding: 22px 14px;
  }
  .battle-lobby h2 {
    font-size: 1.7rem;
  }
  .battle-lobby > p {
    font-size: 0.8rem;
  }
  .lobby-versus {
    margin: 28px 0 24px;
  }
  .lobby-versus > span {
    height: 91px;
    width: 80px;
    font-size: 2.7rem;
  }
  .battle-stage {
    min-height: 344px;
  }
  .battle-progress {
    margin-bottom: 15px;
    font-size: 0.8rem;
  }
  .arena {
    gap: 20px;
    padding: 5px 2px;
  }
  .battle-card {
    min-height: 255px;
    padding: 16px 10px 18px;
    border-radius: 16px;
  }
  .contestant-label {
    font-size: 0.54rem;
    letter-spacing: 0.04em;
  }
  .battle-visual {
    font-size: 3.1rem;
    width: 70px;
    height: 70px;
    margin: 13px 0;
  }
  .battle-card h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
  }
  .battle-pick {
    font-size: 0.8rem;
  }
  .versus {
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
  }
  .battle-caption {
    font-size: 0.75rem;
    margin-top: 24px;
  }
  .battle-final {
    padding: 25px 20px;
    min-height: 395px;
  }
  .battle-final > .mini-label {
    font-size: 0.65rem;
  }
  .champion-ticket h2 {
    font-size: 1.8rem;
  }
  .battle-final .button {
    font-size: 0.9rem;
  }
  .favorites-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .history-list {
    padding: 0 14px;
  }
  .history-row {
    gap: 11px;
    padding: 15px 0;
    flex-wrap: wrap;
  }
  .history-row time {
    font-size: 0.7rem;
  }
  .history-row .item-copy h3 {
    font-size: 0.875rem;
  }
  .history-row .item-copy p {
    font-size: 0.65rem;
  }
  .history-mode {
    gap: 4px;
    font-size: 0.65rem;
  }
  .history-mode span {
    display: none;
  }
  .history-mode .icon {
    width: 17px;
    height: 17px;
  }
  .history-row .item-visual.small {
    width: 38px;
    height: 38px;
    font-size: 1.4rem;
  }
  .history-page .main-heading > .text-button {
    margin-left: -8px;
  }
  .dialog {
    padding: 24px;
    border-radius: 21px;
    max-height: calc(100dvh - 24px);
  }
  .dialog-heading h2 {
    font-size: 1.5rem;
  }
  .dialog-heading {
    margin-bottom: 23px;
  }
  .field input,
  .field textarea {
    font-size: 1rem;
  }
  .dialog-actions .button {
    min-width: 92px;
  }
  .login-page {
    padding: 0 24px;
  }
  .login-header {
    height: 91px;
  }
  .login-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 10px 0 45px;
    min-height: 0;
  }
  .login-art {
    padding: 22px 25px 0;
    border-radius: 20px;
  }
  .login-art h1 {
    font-size: 2.4rem;
    margin: 11px 0 26px;
    max-width: 230px;
  }
  .login-art > .mini-label {
    font-size: 0.54rem;
  }
  .emoji-tickets {
    position: absolute;
    right: 30px;
    bottom: 42px;
    padding: 0;
    gap: 7px;
    transform: scale(0.72);
    transform-origin: bottom right;
  }
  .emoji-ticket {
    width: 78px;
    height: 96px;
    font-size: 2.5rem;
  }
  .emoji-ticket.mint {
    margin-top: 55px;
  }
  .emoji-ticket.coral {
    margin-top: 27px;
  }
  .checker {
    margin: 0 -25px;
    height: 12px;
    background-size: 12px 12px;
  }
  .login-form-wrap {
    max-width: none;
    padding: 0;
  }
  .login-form-wrap > .mini-label {
    display: none;
  }
  .login-form-wrap h2 {
    font-size: 1.9rem;
    margin-bottom: 24px;
  }
  .login-form-wrap .field {
    margin-bottom: 19px;
  }
  #toast {
    bottom: 95px;
    font-size: 0.8rem;
    gap: 12px;
    width: max-content;
    max-width: calc(100% - 32px);
  }
  .empty-state {
    padding: 30px 14px;
  }
}
@media (max-width: 360px) {
  .topbar {
    padding: 0 16px;
  }
  .home-page,
  .category-page,
  .standard-page {
    padding-left: 16px;
    padding-right: 16px;
  }
  .main-heading h1 {
    font-size: 2.1rem;
  }
  .choice-body h2 {
    font-size: 2.5rem;
  }
  .pool-label {
    display: none;
  }
  .pool-bar .segmented {
    width: 100%;
    justify-content: space-between;
  }
  .home-under {
    gap: 9px;
  }
  .item-row {
    gap: 7px;
  }
  .item-row .small {
    width: 36px;
    height: 36px;
  }
  .item-row .heart {
    width: 36px;
    min-width: 36px;
    padding: 8px;
  }
  .pick-check {
    width: 24px;
  }
  .machine-inner {
    padding: 22px 14px;
  }
  .login-art h1 {
    font-size: 2.15rem;
  }
  .emoji-tickets {
    transform: scale(0.6);
    right: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-emoji {
    filter: none;
  }
  .particles {
    display: none;
  }
}
/* Keep small metadata readable at every viewport. */
.mini-label,
.machine-header .mini-label,
.list-heading .mini-label,
.choice-top .mini-label,
.contestant-label,
.result-ticket .mini-label,
.battle-final > .mini-label,
.login-art > .mini-label,
.machine-foot,
.machine-foot .text-button,
.pool-count,
.history-row time,
.history-row .item-copy p,
.history-mode,
.emoji-ticket span {
  font-size: 0.75rem;
}
.item-copy p,
.history-mode,
.battle-caption,
.battle-help {
  line-height: 1.5;
}
/* Names can reflow when the browser's text size is enlarged. */
.choice-body h2 {
  min-width: 0;
  white-space: normal;
}
.hero-emoji {
  font-size: 118px;
  flex-shrink: 0;
}
@media (max-width: 1050px) {
  .hero-emoji {
    font-size: 93px;
  }
}
@media (max-width: 800px) {
  .hero-emoji {
    font-size: 77px;
  }
}
@media (max-width: 600px) {
  .hero-emoji {
    font-size: 83px;
  }
}
@media (max-width: 360px) {
  .mode-switch button {
    padding: 10px 8px;
    gap: 6px;
  }
  .login-art h1 {
    font-size: 2rem;
  }
  .emoji-tickets {
    transform: scale(0.48);
    right: 15px;
  }
}

/* Wide viewports get a horizontal form; portrait keeps full-size controls. */
@media (min-width: 700px), (orientation: landscape) and (min-width: 600px) {
  .item-dialog {
    width: min(860px, calc(100vw - 40px));
    --dialog-pad: 28px;
  }
  .item-choice-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
  }
  .dialog-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
  }
  .dialog-footer .form-error {
    margin-right: auto;
  }
  .dialog-footer .button {
    width: auto;
    min-width: 160px;
  }
}
@media (max-width: 600px) {
  .item-dialog {
    padding: 0;
  }
  #item-form {
    max-height: calc(100dvh - 26px);
  }
}
@media (orientation: landscape) and (max-height: 500px) and (min-width: 600px) {
  .item-dialog {
    --dialog-pad: 20px;
    max-height: calc(100dvh - 20px);
  }
  #item-form {
    max-height: calc(100dvh - 22px);
  }
  .item-dialog .dialog-heading {
    padding-top: 10px;
    padding-bottom: 8px;
  }
  .item-dialog .dialog-heading h2 {
    font-size: 1.25rem;
  }
  .item-name-row {
    margin-bottom: 14px;
  }
  .item-choice-layout {
    gap: 22px;
    margin-bottom: 14px;
  }
  .item-dialog .picker-option {
    min-height: 44px;
  }
  .item-dialog .icon-picker .picker-option {
    height: 44px;
  }
  .dialog-footer {
    padding-top: 8px;
    padding-bottom: 12px;
  }
}
