/* PICK! Casual: the same paper, ink, rounded type and tactile controls. */
html {
  background: var(--bg);
  min-height: 100%;
}
body {
  background: transparent;
  min-height: 100dvh;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: none;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.tag-done {
  background: var(--mint);
  color: #173f30;
  border: 0;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--mint) 58%, #173f30);
}
.tag-delete-toggle {
  background: var(--soft);
  color: var(--muted);
  border: 0;
  box-shadow: 0 4px 0 var(--line);
}
.tag-delete-mode .tag-delete-toggle {
  background: var(--danger);
  color: var(--bg);
  border: 0;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--danger) 60%, #411f21);
}
.login-form-wrap {
  transform: translateY(-16px);
}
.login-art.login-brand {
  position: relative;
  min-height: 480px;
  padding-top: 42px;
}
.login-brand h1 {
  font-size: clamp(42px, 5.4vw, 70px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0;
  position: relative;
  z-index: 2;
}
.login-brand h1 > span {
  display: inline-block;
  color: var(--coral);
  margin-top: 8px;
  white-space: nowrap;
}
.login-brand .luck-collage {
  position: relative;
  height: 210px;
  margin: 16px auto 35px;
  width: 100%;
  max-width: 380px;
}
.login-signature {
  position: absolute;
  right: 22px;
  bottom: 15px;
  opacity: 0.4;
  z-index: 1;
  font-size: 12px;
  letter-spacing: 0.12em;
  font-style: italic;
}
.login-brand .checker {
  height: 25px;
  margin-bottom: 42px;
}
.tool-mark {
  width: 100px;
  height: 100px;
  fill: none;
  color: currentColor;
  flex-shrink: 0;
}
.luck-collage {
  position: absolute;
  width: 220px;
  height: 210px;
  right: 20px;
  bottom: 86px;
  color: #302922;
}
.luck-collage > span {
  position: absolute;
  display: grid;
  place-items: center;
  border: 2px solid #302922;
  box-shadow: 4px 5px 0 #30292222;
}
.collage-wheel {
  width: 130px;
  height: 130px;
  background: #edca77;
  border-radius: 50%;
  left: 6px;
  top: 0;
  transform: rotate(-16deg);
}
.collage-wheel .tool-mark {
  width: 112px;
  height: 112px;
}
.collage-die {
  width: 110px;
  height: 110px;
  background: #f5eee1;
  border-radius: 23px;
  right: 0;
  bottom: 0;
  transform: rotate(13deg);
}
.collage-die .tool-mark {
  width: 100px;
  height: 100px;
}
.collage-coin {
  width: 65px;
  height: 65px;
  background: #a7d6bb;
  border-radius: 50%;
  right: 0;
  top: 10px;
  transform: rotate(19deg);
}
.collage-coin .tool-mark {
  width: 65px;
  height: 65px;
}
.collage-spark {
  position: absolute;
  left: 18px;
  bottom: 5px;
  font-style: normal;
  font-size: 45px;
  color: var(--coral-dark);
}
.home-signoff {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding-top: 35px;
  font-size: 15px;
  color: var(--muted);
}
.home-signoff b {
  color: var(--ink);
}
.home-signoff i {
  color: var(--coral);
  font-size: 26px;
  margin-left: 12px;
  font-style: normal;
}
.casual-hub .main-heading {
  margin-bottom: 32px;
}
.casual-tool-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.casual-tool-card {
  padding: 20px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 5px 0 var(--line);
  background: var(--surface);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
  min-width: 0;
}
.casual-tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 9px 0 var(--line);
}
.tool-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.tool-card-top .mini-label {
  font-size: 9px;
}
.tool-card-top .circle-arrow {
  width: 30px;
  height: 30px;
}
.casual-tool-card > .tool-mark {
  width: 128px;
  height: 128px;
  margin: 25px auto 20px;
  display: block;
  padding: 12px;
  background: var(--soft);
  border-radius: 30px;
}
.tool-wheel {
  --casual-tint: var(--food-bg);
  --accent: var(--coral);
}
.tool-coin {
  --casual-tint: #edce84;
  --accent: #e5bd64;
}
.tool-dice {
  --casual-tint: var(--drink-bg);
  --accent: var(--mint);
}
.tool-number {
  --casual-tint: #d4c5e4;
  --accent: #beaad4;
}
.casual-tool-card.tool-wheel > .tool-mark {
  background: var(--food-bg);
}
.casual-tool-card.tool-coin > .tool-mark {
  background: #ead39a;
  color: #45371f;
}
.casual-tool-card.tool-dice > .tool-mark {
  background: var(--drink-bg);
}
.casual-tool-card.tool-number > .tool-mark {
  background: #d4c5e4;
  color: #40324f;
}
.casual-tool-card h2 {
  font:
    750 25px/1.2 "Baloo 2",
    sans-serif;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.casual-fineprint {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin: 33px 0 0;
  line-height: 1.8;
}
.casual-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 48px 70px;
}
.casual-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.casual-page-heading h1 {
  font:
    800 clamp(32px, 4vw, 48px) / 1.1 "Baloo 2",
    sans-serif;
  letter-spacing: -0.035em;
  margin: 0;
}
.casual-tabs {
  display: flex;
  padding: 5px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}
.casual-tabs a {
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--muted);
  transition: background 140ms;
}
.casual-tabs a:hover {
  background: var(--surface);
}
.casual-tabs a.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 3px #00000012;
}
.casual-tabs .tool-mark {
  width: 23px;
  height: 23px;
}
.casual-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  align-items: start;
  gap: 24px;
}
.casual-play {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 24px;
  overflow: clip;
  box-shadow: 0 5px 0 var(--line);
}
.casual-stage-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 22px 0;
}
.casual-state {
  white-space: nowrap;
  font-size: 10px;
  border-radius: 20px;
  padding: 5px 9px;
  background: var(--soft);
  color: var(--muted);
}
[data-state="animating"] .casual-state {
  background: var(--food-bg);
  color: var(--coral-dark);
}
[data-state="result"] .casual-state {
  background: var(--drink-bg);
  color: var(--mint-dark);
}
.casual-art-stage {
  height: 400px;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: clip;
  background: radial-gradient(circle at center, var(--soft) 0, transparent 67%);
}
.casual-run-area {
  padding: 0 28px 25px;
  position: relative;
}
.casual-run-status {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  min-height: 19px;
  margin: 0 0 14px;
  line-height: 1.7;
}
.casual-run {
  width: 100%;
  color: #29241f;
  background: var(--accent);
  min-height: 51px;
  gap: 9px;
}
.casual-run strong {
  font:
    800 22px/1 "Baloo 2",
    sans-serif;
  margin-left: auto;
}
.casual-run svg {
  width: 18px;
}
.casual-progress {
  position: absolute;
  left: 28px;
  right: 28px;
  top: -12px;
  height: 3px;
  overflow: hidden;
  background: var(--line);
  border-radius: 4px;
}
.casual-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}
.casual-sidebar {
  min-width: 0;
}
#casual-settings {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}
#casual-settings:disabled .casual-settings-panel {
  opacity: 0.62;
}
.casual-settings-panel {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
}
.casual-settings-panel h2 {
  font:
    750 21px/1.2 "Baloo 2",
    sans-serif;
  margin: 0 0 18px;
}
.casual-settings-panel .field {
  font-size: 11px;
  margin: 14px 0;
  gap: 7px;
}
.casual-settings-panel input,
.casual-settings-panel textarea {
  background: var(--surface);
  min-width: 0;
  width: 100%;
  font-size: 13px;
}
.casual-settings-panel input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
.casual-settings-panel input::-webkit-outer-spin-button,
.casual-settings-panel input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.casual-settings-panel .text-button {
  font-size: 10px;
}
.control-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.control-section-heading h2 {
  margin: 0;
}
.control-section-heading h2 > span {
  font:
    400 11px "Be Vietnam Pro",
    sans-serif;
  color: var(--muted);
}
.wheel-items {
  padding: 2px 12px 2px 0;
  margin: 0 0 12px;
  list-style: none;
  display: grid;
  gap: 7px;
  max-height: 246px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.wheel-items li {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}
.wheel-items input {
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
}
.wheel-items .icon-button {
  min-width: 28px;
  width: 28px;
  min-height: 32px;
  height: 32px;
  color: var(--muted);
}
.wheel-items .icon-button svg {
  width: 14px;
}
.slice-swatch {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  font-size: 9px;
  font-weight: 600;
  border-radius: 50%;
  background: var(--slice);
  color: #29241f;
}
.wheel-list-empty {
  font-size: 12px;
  line-height: 1.7;
  padding: 20px 0;
  color: var(--muted);
}
.add-wheel-item {
  min-height: 39px;
  font-size: 11px;
}
.bulk-paste {
  margin-top: 18px;
}
.bulk-paste summary {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 0;
}
.bulk-paste summary svg {
  width: 14px;
}
.bulk-paste textarea {
  resize: vertical;
  min-height: 92px;
  max-height: 220px;
  line-height: 1.7;
}
.bulk-paste .button {
  font-size: 11px;
}
.control-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  margin: 10px 0 0;
}
/* A dedicated play-count card: switch, quick choices and a bounded stepper. */
.best-controls {
  margin-top: 24px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 3px 0 var(--line);
}
.best-controls[data-enabled="true"] {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
}
.best-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  cursor: pointer;
}
.best-emblem {
  display: grid;
  place-items: center;
  width: 30px;
  height: 34px;
  border-radius: 9px;
  background: var(--soft);
  color: var(--muted);
}
.best-emblem svg {
  width: 17px;
  height: 17px;
}
.best-heading strong {
  display: block;
  font: 750 20px/1.15 var(--display);
}
.best-mode-label {
  display: block;
  font-size: 9px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 4px;
}
.best-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  clip-path: inset(50%);
}
.best-switch {
  display: flex;
  align-items: center;
  width: 42px;
  height: 26px;
  padding: 3px;
  border-radius: 999px;
  background: var(--line);
  box-shadow: inset 0 1px 2px #00000012;
  transition: background 160ms ease;
}
.best-switch i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  background: var(--surface);
  color: transparent;
  border-radius: 50%;
  box-shadow: 0 1px 3px #00000020;
  transition:
    transform 180ms ease,
    color 180ms ease;
}
.best-switch svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}
.best-toggle input:checked + .best-switch {
  background: var(--mint);
}
.best-toggle input:checked + .best-switch i {
  transform: translateX(16px);
  background: #f4f0e7;
  color: #23513c;
}
.best-options-content {
  border-top: 1px solid var(--line);
  margin-top: 13px;
  padding-top: 14px;
}
.best-count-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.best-count-heading label {
  font-size: 11px;
  font-weight: 600;
}
.best-count-heading > span {
  color: var(--muted);
  font-size: 9px;
}
.best-stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 12px;
  padding: 3px;
}
.best-stepper button {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 9px;
  font-size: 23px;
  background: var(--surface);
  box-shadow: 0 2px 0 var(--line);
  transition:
    background 140ms,
    transform 140ms;
}
.best-stepper button:hover {
  background: color-mix(in srgb, var(--accent) 25%, var(--surface));
}
.best-stepper button:active {
  transform: translateY(1px);
  box-shadow: none;
}
.best-stepper button svg {
  width: 18px;
  height: 18px;
}
.best-stepper input {
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: center;
  font: 750 29px/1 var(--display);
  padding: 3px;
  min-height: 44px;
}
.best-stepper:has([aria-invalid="true"]) {
  border-color: var(--danger);
}
.best-input-error {
  color: var(--danger);
  font-size: 10px;
  line-height: 1.6;
  margin: 8px 0 0;
}
.n-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.n-presets button {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 3px;
  min-height: 44px;
  padding: 9px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  transition:
    transform 140ms,
    background 140ms;
}
.n-presets button strong {
  font-size: 14px;
  line-height: 1.6;
}
.n-presets button span {
  font-size: 9px;
}
.n-presets button:hover {
  background: var(--soft);
  transform: translateY(-1px);
}
.n-presets button.selected {
  background: color-mix(in srgb, var(--accent) 24%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 70%, var(--ink));
  color: var(--ink);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 70%, var(--ink));
}
.best-explainer {
  margin-top: 16px;
  line-height: 1.7;
}
.best-explainer p {
  font-size: 11px;
}
.best-explainer small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
}
.best-duration {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 11px;
  margin-top: 11px;
  border-top: 1px dashed var(--line);
  font-size: 9px;
  color: var(--muted);
}
.best-duration svg {
  width: 14px;
  height: 14px;
}
.best-duration strong {
  font-weight: 500;
  color: var(--ink);
}
.casual-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--muted);
}
.casual-reset svg {
  width: 13px;
}
.casual-result {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 21px;
  margin-top: 20px;
  background: var(--surface);
  overflow-wrap: anywhere;
}
.casual-result-placeholder {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 50px;
}
.casual-result-placeholder > span {
  color: var(--coral);
  font-size: 38px;
  flex-shrink: 0;
}
.casual-result-placeholder p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
}
.casual-result-placeholder strong {
  font-weight: 500;
  color: var(--ink);
}
.casual-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.casual-result-head .mini-label {
  font-size: 8px;
}
.result-stamp {
  display: flex;
  align-items: center;
  font-size: 8px;
  white-space: nowrap;
  color: var(--mint-dark);
  gap: 3px;
}
.result-stamp svg {
  width: 13px;
}
.casual-winner {
  font:
    800 clamp(30px, 3vw, 42px) / 1.15 "Baloo 2",
    sans-serif;
  margin: 12px 0 6px;
  letter-spacing: -0.025em;
}
.casual-winner small {
  display: block;
  font:
    400 11px "Be Vietnam Pro",
    sans-serif;
  color: var(--muted);
  margin-bottom: 4px;
}
.dice-result-faces,
.winner-count {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin: 5px 0;
}
.tie-note {
  margin: 14px 0 0;
  padding: 10px;
  font-size: 10px;
  line-height: 1.8;
  border-radius: 9px;
  background: var(--soft);
  color: var(--muted);
}
.tie-note b {
  color: var(--coral-dark);
}
.round-breakdown {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.round-breakdown summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}
.round-breakdown summary svg {
  width: 14px;
}
.round-breakdown h3 {
  margin: 15px 0 8px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
}
.frequency-list {
  padding-right: 14px;
}
.frequency-list,
.round-list {
  max-height: 210px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.frequency-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.5;
}
.frequency-row span {
  min-width: 0;
}
.frequency-row b {
  white-space: nowrap;
}
.frequency-row.is-winner {
  background: var(--drink-bg);
  color: var(--mint-dark);
}
.round-list {
  list-style: none;
  padding: 0 14px 0 0;
  margin: 0;
}
.round-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  line-height: 1.7;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.round-list li > span {
  color: var(--muted);
  white-space: nowrap;
}
.round-list strong {
  text-align: right;
  font-weight: 500;
}
.casual-recent:empty {
  display: none;
}
.casual-recent {
  margin-top: 37px;
}
.casual-recent-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}
.casual-recent-heading h2 {
  font:
    750 23px/1.3 "Baloo 2",
    sans-serif;
  margin: 0;
}
.casual-recent-heading span {
  color: var(--muted);
  font-size: 10px;
}
.casual-history {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 2px 0 7px;
  margin: 0;
  list-style: none;
}
.casual-history li {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 11px 16px;
  max-width: 180px;
}
.casual-history strong {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.casual-history span {
  font-size: 9px;
  color: var(--muted);
}
.coin-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  text-align: center;
  margin-bottom: 20px;
}
.coin-legend > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.coin-legend .celestial-mark {
  width: 56px;
  height: 56px;
  color: #927329;
}
.lunar-legend .celestial-mark {
  color: #7385a2;
}
.coin-legend strong {
  font-size: 12px;
  margin-top: 6px;
}
.coin-legend small {
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
}
.dice-stepper {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dice-stepper input {
  text-align: center;
}
.dice-stepper button {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  width: 44px;
  height: 44px;
  font-size: 22px;
}
.number-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.number-fields > span {
  padding-top: 23px;
  color: var(--muted);
}
.number-fields input {
  padding: 11px 9px;
}
/* The wheel is real SVG geometry; the pointer stays outside its rotation. */
/* Pastel enamel sectors, a fixed pin and a finely detailed frame. */
.wheel-object {
  --wheel-ink: #493b30;
  --wheel-frame: #e8dcc6;
  position: relative;
  width: min(100%, 354px);
  aspect-ratio: 1;
  margin-top: 2px;
}
:root[data-theme="dark"] .wheel-object {
  --wheel-frame: #b5a68c;
}
.wheel-rim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    0 6px 0 color-mix(in srgb, var(--wheel-ink) 65%, var(--surface)),
    0 12px 22px #00000014;
}
.wheel-frame,
.wheel-disc {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.wheel-disc {
  border-radius: 50%;
  will-change: transform;
}
.wheel-segment {
  stroke: #f1e7d2;
  stroke-width: 2;
  stroke-linejoin: round;
}
.wheel-pointer {
  position: absolute;
  left: 50%;
  top: -14px;
  width: 38px;
  height: 48px;
  transform: translateX(-50%);
  z-index: 2;
  filter: drop-shadow(0 3px 1px #493b3030);
}
.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 65px;
  height: 65px;
  border: 2px solid var(--wheel-ink);
  border-radius: 50%;
  background: #eee4cf;
  color: var(--wheel-ink);
  box-shadow:
    0 3px 0 #493b3040,
    inset 0 0 0 4px #e8dcc6,
    inset 0 0 0 5px #493b3060;
  font: 800 22px/1 var(--display);
  letter-spacing: -0.06em;
}
.wheel-base {
  position: absolute;
  width: 72%;
  height: 13px;
  bottom: -16px;
  left: 14%;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.09;
  filter: blur(5px);
}
.coin-scene {
  width: 230px;
  height: 280px;
  display: grid;
  place-items: center;
  position: relative;
  perspective: 1000px;
}
.coin-flight {
  --coin-size: 190px;
  width: var(--coin-size);
  height: var(--coin-size);
  position: relative;
  transform-style: preserve-3d;
  z-index: 1;
}
.coin-solid {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}
.coin-heads,
.coin-tails {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
}
.coin-heads {
  transform: translateZ(8px);
}
.coin-tails {
  transform: rotateY(180deg) translateZ(8px);
}
.coin-heads > svg,
.coin-tails > svg {
  display: block;
  width: 100%;
  height: 100%;
}
.coin-rim {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: calc(var(--coin-size) * 0.067);
  background: repeating-linear-gradient(
    to bottom,
    var(--rim-tone) 0 3px,
    #666d69 3px 3.75px,
    var(--rim-tone) 3.75px 5px
  );
  backface-visibility: hidden;
  transform: translate(-50%, -50%) rotateZ(var(--rim-angle))
    translateX(calc(var(--coin-size) * 0.49)) rotateY(90deg);
}
.coin-shadow {
  position: absolute;
  width: 160px;
  height: 18px;
  background: var(--ink);
  filter: blur(7px);
  opacity: 0.2;
  border-radius: 50%;
  bottom: 19px;
}
/* A compact, legible number machine, including full-width integer extremes. */
.number-machine {
  width: 100%;
  max-width: 380px;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--soft);
  box-shadow: 0 7px 0 var(--line);
  padding: 22px;
  transform: none;
}
.number-machine-label {
  font-size: 9px;
  color: var(--muted);
  display: block;
  text-align: center;
  margin-bottom: 17px;
}
.number-window {
  min-height: 150px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: inset 0 3px 0 var(--line);
  overflow: hidden;
}
#number-value {
  font:
    750 80px/1.2 "Baloo 2",
    sans-serif;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
#number-value.long-number {
  font-size: clamp(25px, 3vw, 38px);
}
.number-machine-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 17px;
  color: var(--muted);
  font-size: 9px;
}
.number-machine-foot > span:first-child {
  letter-spacing: 4px;
  color: var(--coral);
}
#number-range {
  overflow-wrap: anywhere;
  text-align: right;
}

@media (max-width: 1050px) {
  .casual-tool-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .casual-page {
    padding-left: 32px;
    padding-right: 32px;
  }
  .casual-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr);
    gap: 18px;
  }
  .casual-art-stage {
    height: 360px;
    padding: 25px 16px;
  }
  .casual-stage-top {
    padding: 17px 17px 0;
  }
  .casual-page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
  .number-machine {
    padding: 16px;
  }
}
@media (max-width: 700px) {
  .home-signoff {
    font-size: 12px;
    padding-top: 26px;
  }
  .casual-page {
    padding: 22px 22px 96px;
  }
  .casual-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .casual-page-heading h1 {
    font-size: 37px;
  }
  .casual-tabs {
    width: 100%;
  }
  .casual-tabs a {
    flex: 1;
    justify-content: center;
    padding: 8px 5px;
  }
  .casual-art-stage {
    height: 350px;
    padding: 22px;
  }
  .wheel-object {
    width: min(100%, 304px);
  }
  .casual-run-area {
    padding: 0 22px 22px;
  }
  .casual-settings-panel {
    padding: 22px;
  }
  .casual-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .casual-result {
    order: -1;
    margin: 0;
  }
  .casual-result:has(.casual-result-placeholder) {
    display: none;
  }
  .casual-sidebar .form-error {
    order: -2;
    margin: 0;
  }
  .casual-winner {
    font-size: 38px;
  }
  .casual-recent {
    margin-top: 28px;
  }
  .number-machine {
    max-width: 340px;
  }
  #number-value.long-number {
    font-size: 30px;
  }
  .login-art.login-brand {
    min-height: 0;
    padding-top: 27px;
  }
  .login-brand h1 {
    font-size: clamp(33px, 8vw, 47px);
    line-height: 1.08;
  }
  .login-brand .luck-collage {
    height: 130px;
    width: 240px;
    margin: 13px auto 17px;
    transform: scale(0.7);
    transform-origin: center top;
  }
  .login-brand .checker {
    margin-bottom: 35px;
    height: 18px;
  }
  .login-signature {
    bottom: 9px;
    font-size: 10px;
  }
  .login-form-wrap {
    transform: translateY(-7px);
  }
}
@media (max-width: 380px) {
  .casual-page {
    padding-left: 16px;
    padding-right: 16px;
  }
  .casual-page-heading h1 {
    font-size: 31px;
  }
  .casual-art-stage {
    height: 300px;
    padding: 19px;
  }
  .casual-tabs a {
    font-size: 10px;
    gap: 3px;
  }
  .casual-tabs .tool-mark {
    width: 20px;
  }
  .casual-tool-cards {
    gap: 12px;
  }
  .casual-tool-card {
    padding: 15px 13px;
  }
  .casual-tool-card > .tool-mark {
    width: 94px;
    height: 94px;
    padding: 5px;
  }
  .casual-tool-card h2 {
    font-size: 21px;
  }
  .casual-tool-card p {
    font-size: 10px;
  }
  .tool-card-top .mini-label {
    font-size: 7px;
  }
  .tool-card-top .circle-arrow {
    width: 25px;
    height: 25px;
  }
  .casual-stage-top {
    gap: 5px;
  }
  .casual-state {
    font-size: 8px;
  }
  .number-machine {
    padding: 13px;
  }
  .number-machine-label {
    font-size: 7px;
  }
  #number-value.long-number {
    font-size: 24px;
  }
  .coin-flight {
    --coin-size: 160px;
  }
  .coin-scene {
    height: 235px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mode-card,
  .casual-tool-card,
  .casual-tabs a {
    transition: none;
  }
}

/* Input borders are shared with the existing forms, including inline wheel rows. */
.wheel-items input {
  border: 1.5px solid var(--line);
  color: var(--ink);
  box-shadow: none;
  outline: none;
}
.wheel-items input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--coral) 15%, transparent);
}
.tactile-check input:focus-visible + .checkbox-mark {
  outline: none;
}
/* Keep the outcome in view while the wheel list grows. */
.casual-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.casual-result {
  order: -1;
  margin: 0;
}
.casual-sidebar > .form-error {
  order: -2;
  margin: 0;
}
.casual-art-stage:has(.dice-count-10, .dice-count-11, .dice-count-12) {
  min-height: 400px;
}
@media (max-width: 700px) {
  .casual-settings-panel input:not([type="checkbox"], [data-casual-field="n"]),
  .casual-settings-panel textarea {
    font-size: 16px;
  }
  .wheel-items input {
    min-height: 41px;
  }
  .wheel-items .icon-button {
    min-width: 36px;
    height: 41px;
  }
  .casual-tabs a {
    min-height: 44px;
  }
  .n-presets button {
    min-height: 44px;
  }
}
@media (max-width: 380px) {
  .casual-art-stage:has(.dice-count-10, .dice-count-11, .dice-count-12) {
    min-height: 370px;
  }
}
#number-value.medium-number {
  font-size: 48px;
}
@media (max-width: 700px) {
  #number-value.medium-number {
    font-size: 32px;
  }
}
@media (max-width: 380px) {
}
.casual-run strong,
.number-machine-foot > span:first-child {
  white-space: nowrap;
  flex-shrink: 0;
}
.casual-winner.long-number {
  font-size: 26px;
  white-space: nowrap;
}
.casual-winner.medium-number {
  font-size: 32px;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .casual-run {
    font-size: 13px;
    gap: 6px;
  }
  .casual-run strong {
    font-size: 20px;
  }
  .casual-winner.long-number {
    font-size: 24px;
  }
}
.login-brand .luck-collage {
  bottom: auto;
  right: auto;
}

/* Mode chooser: names and one line illustration, with no supporting card copy. */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 310px;
  padding: 32px;
  border: 1.5px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--ink) 13%, transparent);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}
.mode-casual {
  background: var(--food-bg);
}
.mode-food {
  background: var(--drink-bg);
}
.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 color-mix(in srgb, var(--ink) 13%, transparent);
}
.mode-card:active {
  transform: translateY(1px);
}
.mode-card h2 {
  position: relative;
  z-index: 1;
  font:
    800 clamp(42px, 4.6vw, 62px) / 1.03 "Baloo 2",
    sans-serif;
  letter-spacing: -0.035em;
  margin: 0;
}
.mode-card > .circle-arrow {
  margin-top: auto;
}
.mode-art {
  position: absolute;
  right: 26px;
  bottom: 22px;
}
.mode-art .tool-mark {
  display: block;
  width: 180px;
  height: 180px;
}
.casual-page-heading .title-with-back {
  min-width: 0;
  margin-bottom: 0;
}
.casual-page-heading .back-button {
  flex-shrink: 0;
}
.dice-type-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.dice-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}
.dice-types button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 11px;
  min-height: 46px;
  padding: 7px;
  cursor: pointer;
  transition:
    transform 120ms,
    box-shadow 120ms;
}
.dice-types strong {
  font:
    750 21px/1.2 "Baloo 2",
    sans-serif;
}
.dice-types button:hover {
  transform: translateY(-2px);
}
.dice-types button.selected {
  border-color: var(--mint-dark);
  background: var(--drink-bg);
  box-shadow: 0 3px 0 var(--mint-dark);
}
.dice-types button:disabled {
  cursor: default;
  transform: none;
}
.dice-scene {
  --die-size: 74px;
  display: grid;
  grid-template-columns: repeat(3, var(--die-size));
  place-content: center;
  gap: 14px 14px;
  width: 100%;
}
.dice-count-1 {
  --die-size: 196px;
  grid-template-columns: var(--die-size);
}
.dice-count-2 {
  --die-size: 168px;
  grid-template-columns: repeat(2, var(--die-size));
  gap: 18px;
}
.dice-count-3 {
  --die-size: 100px;
}
.die-toss {
  width: var(--die-size);
  height: var(--die-size);
  position: relative;
}
.die-body {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}
[data-state="animating"] .die-body {
  will-change: transform;
}
.die-shadow {
  position: absolute;
  width: 66%;
  height: 9%;
  left: 17%;
  bottom: 5%;
  border-radius: 50%;
  background: var(--ink);
  filter: blur(4px);
  opacity: 0.2;
}
@media (min-width: 1150px) {
  .dice-count-4,
  .dice-count-7,
  .dice-count-8,
  .dice-count-10,
  .dice-count-11,
  .dice-count-12 {
    grid-template-columns: repeat(4, var(--die-size));
  }
}
@media (max-width: 1050px) {
  .mode-art .tool-mark {
    width: 148px;
    height: 148px;
  }
  .mode-card {
    padding: 26px;
  }
  .mode-art {
    right: 18px;
  }
  .dice-scene {
    --die-size: 62px;
  }
  .dice-count-1 {
    --die-size: 178px;
  }
  .dice-count-2 {
    --die-size: 112px;
  }
  .dice-count-3 {
    --die-size: 72px;
  }
}
@media (max-width: 700px) {
  .casual-art-stage:has(.dice-count-10, .dice-count-11, .dice-count-12) {
    min-height: 440px;
  }
  .mode-cards {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .mode-card {
    min-height: 250px;
    padding: 27px;
  }
  .mode-card h2 {
    font-size: 48px;
  }
  .mode-art {
    right: 20px;
    bottom: 20px;
  }
  .mode-art .tool-mark {
    width: 145px;
    height: 145px;
  }
  #app[data-section="casual"] .home-page,
  #app[data-section="casual"] .standard-page,
  .casual-page {
    padding-bottom: 48px;
  }
  .casual-page-heading .title-with-back {
    gap: 12px;
  }
  .casual-page-heading h1 {
    font-size: clamp(25px, 6.6vw, 37px);
  }
  .dice-scene {
    --die-size: 72px;
    gap: 14px 10px;
  }
  .dice-count-1 {
    --die-size: 196px;
  }
  .dice-count-2 {
    --die-size: 126px;
  }
}
@media (max-width: 380px) {
  .casual-art-stage:has(.dice-count-10, .dice-count-11, .dice-count-12) {
    min-height: 400px;
  }
  .mode-card h2 {
    font-size: 41px;
  }
  .mode-art .tool-mark {
    width: 126px;
    height: 126px;
  }
  .mode-card {
    min-height: 234px;
    padding: 23px;
  }
  .dice-scene {
    --die-size: 62px;
  }
  .dice-count-1 {
    --die-size: 145px;
  }
  .dice-count-2 {
    --die-size: 96px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mode-card,
  .dice-types button {
    transition: none;
  }
}

/* Inline disclosure content remains in flow; only its measured height animates. */
.disclosure-body,
.best-options {
  display: flow-root;
}
.disclosure-animating {
  overflow: clip;
}
details > summary {
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary > .icon:last-child {
  transition: transform 220ms ease;
}
details[data-expanded="true"] > summary > .icon:last-child {
  transform: rotate(180deg);
}
.best-stepper:focus-within {
  outline: 2px solid var(--mint-dark);
  outline-offset: 2px;
}
.best-stepper input:focus-visible {
  outline: none;
}
.best-stepper:has([aria-invalid="true"]):focus-within {
  outline-color: var(--danger);
}
.wheel-presets {
  border-top: 1px dashed var(--line);
  margin-top: 16px;
  padding-top: 12px;
}
.wheel-presets > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.wheel-presets > summary .icon {
  width: 15px;
  height: 15px;
  margin-left: auto;
}
.wheel-preset-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}
.wheel-presets .preset-error {
  color: var(--danger);
}
.wheel-presets .button {
  min-height: 44px;
  font-size: 11px;
}
.wheel-preset-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  max-height: 258px;
  padding: 3px 10px 4px 1px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.wheel-preset-list > li:not(.presets-empty) {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  min-width: 0;
}
.wheel-preset-load {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 10px;
  background: transparent;
  border-radius: 11px;
  transition: background 160ms;
}
.wheel-preset-load:hover {
  background: color-mix(in srgb, var(--coral) 14%, var(--surface));
}
.preset-mini-wheel {
  display: grid;
  place-items: center;
  width: 32px;
  height: 36px;
  flex-shrink: 0;
  background: var(--food-bg);
  border-radius: 8px;
}
.preset-mini-wheel .tool-mark {
  width: 28px;
  height: 28px;
}
.wheel-preset-load > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}
.wheel-preset-load strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.5;
}
.wheel-preset-load small {
  display: block;
  font-size: 9px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 3px;
}
.wheel-preset-load > .icon {
  width: 15px;
  height: 15px;
}
.wheel-preset-list .icon-button {
  width: 36px;
  min-width: 36px;
  height: 44px;
  margin-right: 4px;
  color: var(--muted);
}
.wheel-preset-list .icon-button .icon {
  width: 16px;
  height: 16px;
}
.presets-empty {
  padding: 8px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
#casual-settings:disabled summary {
  cursor: default;
}
@media (prefers-reduced-motion: reduce) {
  details > summary > .icon:last-child {
    transition: none;
  }
}
