@font-face {
  font-family: "Noto Sans SC Local";
  src: url("/garden/assets/fonts/NotoSansSC-VF.ttf?v=1") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #292d38;
  --muted: #6e7481;
  --paper: #fffdf8;
  --cream: #f7f2e8;
  --line: rgb(42 49 65 / 13%);
  --red: #c44e55;
  --red-deep: #963941;
  --red-soft: #f9d9d7;
  --blue: #4778bd;
  --blue-deep: #315b98;
  --blue-soft: #dce9fb;
  --gold: #d8aa56;
  --shadow: 0 24px 70px rgb(40 45 56 / 11%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgb(244 198 191 / 38%), transparent 28%),
    radial-gradient(circle at 91% 22%, rgb(180 207 241 / 35%), transparent 30%),
    linear-gradient(145deg, #f8f3e9, #f3eee8 58%, #edf2f6);
  color: var(--ink);
  font-family: "Noto Sans SC Local", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a,
summary,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.ambient-orbit {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orbit span {
  position: absolute;
  width: 220px;
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 50%;
  background: rgb(255 255 255 / 16%);
  animation: orbit-drift 18s ease-in-out infinite alternate;
}

.ambient-orbit span:nth-child(1) {
  top: 12%;
  left: -90px;
}

.ambient-orbit span:nth-child(2) {
  top: 48%;
  right: -120px;
  width: 330px;
  animation-delay: -8s;
}

.ambient-orbit span:nth-child(3) {
  bottom: -130px;
  left: 32%;
  width: 270px;
  animation-delay: -13s;
}

@keyframes orbit-drift {
  to {
    transform: translate3d(26px, -18px, 0) scale(1.08);
  }
}

.login-view {
  display: grid;
  min-height: 100svh;
  padding: 24px;
  place-items: center;
}

.login-card {
  width: min(480px, 100%);
  padding: clamp(34px, 8vw, 58px);
  border: 1px solid var(--line);
  border-radius: 32px 32px 12px 32px;
  background: rgb(255 253 248 / 90%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-deep);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.login-card h1,
.hero h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: -0.05em;
}

.login-card h1 {
  font-size: clamp(46px, 12vw, 72px);
}

.login-card > p:not(.eyebrow) {
  margin: 14px 0 30px;
  color: var(--muted);
}

.login-card label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 750;
}

.password-row {
  display: flex;
}

.password-row input {
  min-width: 0;
  flex: 1;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px 0 0 12px;
  outline: none;
  background: white;
}

.password-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(71 120 189 / 12%);
}

.password-row button,
.primary-button,
.generator-controls button {
  border: 0;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-weight: 750;
}

.password-row button {
  padding-inline: 20px;
  border-radius: 0 12px 12px 0;
}

.form-status {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--red-deep);
  font-size: 11px;
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.site-header,
main,
footer {
  width: min(1080px, calc(100% - 36px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

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

.brand > span {
  display: grid;
  width: 36px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-weight: 800;
  place-items: center;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
}

.site-header nav a,
.site-header nav button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}

.hero {
  display: grid;
  padding: clamp(58px, 9vw, 105px) 0 50px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: end;
  gap: clamp(28px, 6vw, 80px);
}

.hero h1 {
  max-width: 680px;
  font-size: clamp(48px, 7.5vw, 86px);
  line-height: 1.03;
}

.hero-copy {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.official-card {
  padding: 26px;
  border: 1px solid rgb(49 91 152 / 16%);
  border-radius: 28px 28px 8px 28px;
  background: rgb(255 255 255 / 68%);
  box-shadow: 0 18px 48px rgb(48 65 88 / 8%);
  backdrop-filter: blur(16px);
}

.official-mark {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 9px;
  font-weight: 800;
}

.official-card h2 {
  margin: 17px 0 10px;
  font-size: 25px;
}

.official-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.official-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.official-card a,
.check-button {
  display: inline-flex;
  padding: 10px 13px;
  align-items: center;
  border-radius: 10px;
  background: var(--blue-deep);
  color: white;
  border: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

.check-button {
  background: var(--ink);
}

.official-card .check-status {
  min-height: 17px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.draw-summary {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid rgb(49 91 152 / 15%);
  border-radius: 17px 17px 6px 17px;
  background: rgb(255 255 255 / 68%);
}

.draw-summary-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.draw-summary-heading strong,
.draw-summary-heading span {
  display: block;
}

.draw-summary-heading strong {
  font-size: 12px;
}

.draw-summary-heading span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.official-card .draw-summary-heading a {
  padding: 0;
  background: none;
  color: var(--blue-deep);
  font-size: 9px;
  text-align: right;
}

.draw-balls {
  margin-top: 13px;
}

.draw-balls .balls {
  gap: 4px;
}

.draw-balls .ball {
  width: 29px;
  font-size: 10px;
}

.official-card .draw-result-note {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.6;
}

.official-card small,
.draw-summary small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.panel {
  margin-bottom: 28px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 32px 32px 10px 32px;
  background: rgb(255 253 248 / 82%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.section-heading {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 {
  font-size: clamp(29px, 5vw, 46px);
}

.section-heading > span {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.saved-list,
.generated-list,
.game-result-list {
  display: grid;
  margin-top: 26px;
  gap: 10px;
}

.saved-list { gap: 20px; }

.saved-origin-group {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.saved-origin-heading,
.game-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 11px;
}

.saved-origin-heading span,
.game-result-heading span {
  color: var(--muted);
  font-size: 9px;
}

.saved-origin-manual .saved-origin-heading strong { color: var(--blue-deep); }
.saved-origin-generator .saved-origin-heading strong { color: #7d6428; }
.saved-origin-game .saved-origin-heading strong { color: var(--red-deep); }

.number-row {
  display: flex;
  min-width: 0;
  padding: 13px 14px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 255 255 / 72%);
}

.number-row-index {
  width: 24px;
  flex: 0 0 24px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.balls {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: clamp(4px, 1.2vw, 9px);
}

.ball {
  display: grid;
  width: clamp(31px, 6.6vw, 42px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 50%;
  color: white;
  font-size: clamp(11px, 2.7vw, 14px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  place-items: center;
}

.ball-red {
  background: linear-gradient(145deg, #d76468, var(--red-deep));
  box-shadow: 0 5px 12px rgb(150 57 65 / 18%);
}

.ball-blue {
  margin-left: 5px;
  background: linear-gradient(145deg, #6093d4, var(--blue-deep));
  box-shadow: 0 5px 12px rgb(49 91 152 / 18%);
}

.ball-match {
  outline: 3px solid rgb(216 170 86 / 78%);
  outline-offset: 2px;
  box-shadow:
    0 0 0 5px rgb(255 244 194 / 48%),
    0 7px 18px rgb(140 103 35 / 26%);
}

.number-meta {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.pick-rule {
  display: grid;
  min-width: 112px;
  max-width: 158px;
  flex: 0 1 158px;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--cream);
  line-height: 1.25;
}

.pick-rule strong { color: var(--ink); font-size: 9px; }
.pick-rule span { color: var(--muted); font-size: 7px; }
.pick-rule-generator { background: rgb(244 229 177 / 48%); }
.pick-rule-game { background: rgb(249 217 215 / 58%); }
.pick-rule-manual { background: rgb(220 233 251 / 58%); }

.delete-button,
.save-generated-button {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.number-row-checked {
  border-color: rgb(216 170 86 / 42%);
  background: rgb(255 252 238 / 88%);
}

.check-badge {
  display: grid;
  min-width: 96px;
  flex: 0 0 auto;
  padding: 7px 9px;
  border-radius: 10px;
  line-height: 1.25;
  text-align: right;
}

.check-badge strong,
.check-badge span {
  display: block;
}

.check-badge strong {
  font-size: 10px;
}

.check-badge span {
  margin-top: 3px;
  font-size: 8px;
}

.check-badge-win {
  background: #fff0b8;
  color: #725011;
}

.check-badge-none {
  background: var(--cream);
  color: var(--muted);
}

.delete-button {
  background: var(--red-soft);
  color: var(--red-deep);
}

.save-generated-button {
  background: var(--blue-soft);
  color: var(--blue-deep);
}

.empty-state {
  padding: 34px 20px;
  border: 1px dashed rgb(42 49 65 / 18%);
  border-radius: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.manual-entry {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.manual-entry summary {
  padding: 18px 2px 5px;
  color: var(--blue-deep);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.manual-entry summary::-webkit-details-marker {
  display: none;
}

.manual-entry form {
  display: grid;
  padding-top: 16px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 14px;
}

.manual-text-entry {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 10px;
}

.manual-text-entry label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.manual-text-entry input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.manual-text-entry input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(60 103 174 / 10%);
}

.manual-text-help,
.manual-picker-label {
  grid-column: 1 / -1;
  margin: -5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.manual-picker-label {
  margin-top: 2px;
  color: var(--ink-soft);
  font-weight: 750;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.generator-controls label {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.number-inputs {
  display: grid;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  gap: 6px;
}

.number-inputs select,
.blue-fieldset select,
.generator-controls select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: white;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.number-inputs select:focus {
  border-color: var(--red);
}

.blue-fieldset select:focus,
.generator-controls select:focus {
  border-color: var(--blue);
}

.primary-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
}

.manual-entry .form-status {
  grid-column: 1 / -1;
}

.generator-heading {
  align-items: center;
}

.generator-controls {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 5px 8px;
}

.generator-controls > label:not(.check-control) {
  align-self: center;
  margin: 0;
}

.generator-controls select {
  min-width: 92px;
  padding-inline: 8px;
}

.generator-controls button {
  min-height: 40px;
  padding-inline: 14px;
  border-radius: 10px;
}

.generator-controls .check-control {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 6px;
  margin: 3px 0 0;
}

.row-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.text-button {
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: var(--cream);
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}

.number-row-pinned {
  border-color: rgb(216 170 86 / 44%);
  background: linear-gradient(90deg, rgb(255 245 209 / 72%), rgb(255 255 255 / 76%));
}

.game-grid {
  display: grid;
  margin-top: 26px;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.game-grid button {
  display: grid;
  min-height: 138px;
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: 22px 22px 8px 22px;
  background: rgb(255 255 255 / 72%);
  color: var(--ink);
  cursor: pointer;
  place-items: center;
}

.game-grid button:hover {
  border-color: rgb(71 120 189 / 35%);
  transform: translateY(-2px);
}

.game-grid button[aria-pressed="true"] {
  border-color: rgb(167 68 72 / 48%);
  background: linear-gradient(145deg, rgb(255 247 232 / 94%), rgb(245 229 224 / 80%));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 70%);
}

.game-grid span {
  font-size: 38px;
  line-height: 1;
}

.game-grid strong {
  font-size: 13px;
}

.game-grid small {
  color: var(--muted);
  font-size: 9px;
}

.game-stage {
  min-height: 108px;
  margin-top: 14px;
  padding: 22px;
  border: 1px dashed rgb(42 49 65 / 20%);
  border-radius: 20px;
  color: var(--muted);
}

.game-stage .balls {
  flex: 0 0 auto;
}

.game-stage p {
  margin: 8px 0 0;
  font-size: 10px;
}

.game-stage > p:only-child {
  text-align: center;
}

.game-session-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-session-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.game-session-title > span {
  font-size: 32px;
  line-height: 1;
}

.game-session-title div {
  display: grid;
  gap: 3px;
}

.game-session-title strong { font-size: 13px; }
.game-session-title small { color: var(--muted); font-size: 9px; }

.game-target {
  padding: 6px 9px;
  border-radius: 999px;
  color: white;
  font-size: 9px;
  font-weight: 800;
}

.game-target-red { background: var(--red); }
.game-target-blue { background: var(--blue); }

.game-picked-balls {
  min-height: 32px;
  margin-top: 16px;
  justify-content: center;
}

.game-empty-pick {
  color: var(--muted);
  font-size: 9px;
}

.game-instruction {
  min-height: 16px;
  text-align: center;
}

.game-rule {
  display: grid;
  margin-top: 14px;
  padding: 10px 12px;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
  border: 1px solid rgb(42 49 65 / 10%);
  border-radius: 12px;
  background: rgb(255 255 255 / 52%);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.game-rule strong {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 8px;
}

.game-action {
  display: grid;
  min-height: 182px;
  margin-top: 12px;
  align-content: center;
  justify-items: center;
  gap: 14px;
}

.game-action-button {
  min-width: 126px;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}

.game-action-button:disabled { cursor: wait; opacity: 0.62; }

.gravity-machine {
  position: relative;
  width: min(350px, 88vw);
  padding: 12px 18px 38px;
  border-radius: 28px 28px 22px 22px;
  background: linear-gradient(145deg, rgb(221 240 246 / 72%), rgb(255 255 255 / 86%));
  box-shadow: 0 18px 34px rgb(42 49 65 / 15%), inset 0 0 0 1px rgb(255 255 255 / 88%);
}

.gravity-drum {
  position: relative;
  height: clamp(150px, 24vw, 190px);
  overflow: hidden;
  border: 8px solid rgb(255 255 255 / 88%);
  border-radius: 44% 44% 42% 42% / 48% 48% 36% 36%;
  background:
    radial-gradient(circle at 30% 22%, rgb(255 255 255 / 84%), transparent 30%),
    linear-gradient(180deg, rgb(208 234 242 / 52%), rgb(244 238 220 / 42%));
  box-shadow: inset 0 -18px 34px rgb(55 91 102 / 12%), 0 8px 20px rgb(42 49 65 / 10%);
}

.gravity-ball {
  position: absolute;
  bottom: 8px;
  left: 10%;
  display: grid;
  width: clamp(23px, 5.5vw, 30px);
  aspect-ratio: 1;
  border: 2px solid rgb(255 255 255 / 88%);
  border-radius: 50%;
  box-shadow: inset -4px -5px 7px rgb(42 49 65 / 20%), 0 4px 8px rgb(42 49 65 / 18%);
  color: white;
  font-size: clamp(7px, 1.8vw, 10px);
  font-weight: 900;
  line-height: 1;
  place-items: center;
  transform: translateX(-50%);
}

.gravity-ball-red { background: linear-gradient(145deg, #d65e63, #94363b); }
.gravity-ball-blue { background: linear-gradient(145deg, #5d91cf, #2d5f9a); }

.gravity-ball:nth-child(8n + 1) { left: 9%; }
.gravity-ball:nth-child(8n + 2) { left: 21%; }
.gravity-ball:nth-child(8n + 3) { left: 33%; }
.gravity-ball:nth-child(8n + 4) { left: 45%; }
.gravity-ball:nth-child(8n + 5) { left: 57%; }
.gravity-ball:nth-child(8n + 6) { left: 69%; }
.gravity-ball:nth-child(8n + 7) { left: 81%; }
.gravity-ball:nth-child(8n) { left: 91%; }
.gravity-ball:nth-child(4n + 2) { bottom: 27px; }
.gravity-ball:nth-child(4n + 3) { bottom: 46px; }
.gravity-ball:nth-child(4n) { bottom: 65px; }
.gravity-ball:nth-child(9n + 1) { --ball-delay: -0.11s; }
.gravity-ball:nth-child(9n + 2) { --ball-delay: -0.22s; }
.gravity-ball:nth-child(9n + 3) { --ball-delay: -0.33s; }
.gravity-ball:nth-child(9n + 4) { --ball-delay: -0.44s; }
.gravity-ball:nth-child(9n + 5) { --ball-delay: -0.55s; }
.gravity-ball:nth-child(9n + 6) { --ball-delay: -0.66s; }
.gravity-ball:nth-child(9n + 7) { --ball-delay: -0.77s; }
.gravity-ball:nth-child(9n + 8) { --ball-delay: -0.88s; }
.gravity-ball:nth-child(9n) { --ball-delay: -0.99s; }

.gravity-machine.is-mixing .gravity-ball {
  animation: gravity-ball-bounce 0.82s cubic-bezier(.34, .05, .65, .95) var(--ball-delay) infinite alternate;
}

.gravity-chute {
  position: absolute;
  bottom: 7px;
  left: 50%;
  display: grid;
  min-width: 82px;
  min-height: 28px;
  padding-inline: 14px;
  border: 4px solid white;
  border-radius: 0 0 16px 16px;
  background: var(--ink);
  color: white;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.06em;
  place-items: center;
  transform: translateX(-50%);
}

@keyframes gravity-ball-bounce {
  0% { transform: translate(-50%, 0) rotate(-18deg); }
  36% { transform: translate(calc(-50% - 18px), -58px) rotate(85deg); }
  72% { transform: translate(calc(-50% + 22px), -104px) rotate(190deg); }
  100% { transform: translate(-50%, -128px) rotate(270deg); }
}

.dart-board {
  position: relative;
  width: min(224px, 72vw);
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 9px solid #29303b;
  border-radius: 50%;
  background: #f7ead7;
  box-shadow: 0 14px 30px rgb(42 49 65 / 18%);
  cursor: crosshair;
}

.dart-labels {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.dart-sector { stroke: rgb(255 255 255 / 55%); stroke-width: 0.28; }
.dart-sector-0 { fill: #a74448; }
.dart-sector-1 { fill: #f1c461; }
.dart-sector-2 { fill: #477568; }
.dart-sector-3 { fill: #dfe8f4; }

.dart-number {
  fill: white;
  paint-order: stroke;
  stroke: rgb(32 38 49 / 78%);
  stroke-width: 0.72;
  font-size: 3px;
  font-weight: 900;
  pointer-events: none;
}

.dart-guide {
  fill: none;
  stroke: rgb(255 255 255 / 46%);
  stroke-width: 0.7;
}

.dart-center {
  fill: #f8cf58;
  stroke: #a74448;
  stroke-width: 2.4;
}

.dart-hit {
  fill: #202631;
  stroke: white;
  stroke-width: 1.4;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 42%));
  pointer-events: none;
}

.game-action-hint { color: var(--muted); font-size: 9px; }

.egg-tray {
  display: grid;
  width: min(500px, 100%);
  grid-template-columns: repeat(6, minmax(54px, 1fr));
  gap: 9px;
}

.egg-choice {
  position: relative;
  display: grid;
  min-height: 82px;
  border: 1px solid rgb(216 170 86 / 42%);
  border-radius: 18px;
  background: linear-gradient(145deg, #fffaf0, #f8e6ae);
  color: #6a4a1e;
  cursor: pointer;
  place-items: center;
}

.egg-shell {
  display: grid;
  width: 38px;
  height: 48px;
  border: 1px solid rgb(158 106 29 / 24%);
  border-radius: 52% 52% 46% 46% / 62% 62% 38% 38%;
  background:
    radial-gradient(circle at 34% 24%, white 0 7%, transparent 8%),
    linear-gradient(145deg, #fff6a8 4%, #f5c44f 48%, #ce8522 100%);
  box-shadow: inset -7px -8px 13px rgb(126 73 12 / 15%), 0 7px 12px rgb(126 73 12 / 15%);
  color: #7f4214;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  place-items: center;
}

.egg-choice small { font-size: 8px; }
.egg-choice:hover { transform: translateY(-3px) rotate(-2deg); }
.egg-choice.is-selected {
  border-color: #d19a2b;
  box-shadow: 0 0 0 4px rgb(246 201 77 / 22%), 0 10px 22px rgb(142 91 18 / 18%);
  transform: translateY(-4px);
}

.egg-choice.is-selected .egg-shell { animation: egg-selected-glow 0.9s ease-in-out infinite alternate; }
.egg-choice.is-cracked { background: #fff8df; color: var(--red); transform: scale(1.08) rotate(-2deg); }
.egg-choice.is-cracked .egg-shell { background: #fff3c8; border-radius: 48% 44% 40% 46%; font-size: 15px; }
.egg-choice.is-perfect { box-shadow: 0 0 0 6px rgb(246 201 77 / 30%), 0 0 32px rgb(246 201 77 / 72%); }
.egg-choice.is-steady { box-shadow: 0 0 24px rgb(71 117 104 / 48%); }
.egg-choice.is-playful { animation: egg-playful-bounce 0.45s ease-in-out 2; }

.egg-score {
  color: #9b681d;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.egg-controls {
  display: grid;
  width: min(360px, 100%);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
}

.egg-power-meter {
  position: relative;
  height: 28px;
  overflow: hidden;
  border: 1px solid rgb(171 122 41 / 25%);
  border-radius: 999px;
  background: linear-gradient(90deg, #dfe8f4 0 24%, #fae8a8 24% 42%, #f2c54f 42% 68%, #fae8a8 68% 84%, #f0d6d5 84% 100%);
}

.egg-power-sweet {
  position: absolute;
  inset: 0;
  display: grid;
  color: rgb(102 67 16 / 72%);
  font-size: 8px;
  font-weight: 850;
  place-items: center;
}

.egg-power-marker {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 5px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 0 0 2px white, 0 2px 8px rgb(32 38 49 / 34%);
}

.egg-power-meter.is-charging .egg-power-marker { animation: egg-power-sweep 1.4s linear infinite alternate; }

.egg-hammer-button {
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: #704c22;
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-weight: 850;
}

.egg-hammer-button:disabled,
.egg-shuffle-button:disabled { cursor: not-allowed; opacity: 0.42; }

.egg-charge-hint {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}

.egg-tray.is-shuffling { animation: egg-tray-shuffle 0.5s ease-in-out; }

.egg-shuffle-button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgb(216 170 86 / 48%);
  border-radius: 999px;
  background: #fff7d8;
  color: #6a4a1e;
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
}

.egg-confetti {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 5px;
  height: 10px;
  border-radius: 2px;
  background: var(--red);
  pointer-events: none;
  animation: egg-confetti-burst 0.7s ease-out forwards;
}

.egg-confetti:nth-of-type(3n) { background: #f1c461; }
.egg-confetti:nth-of-type(3n + 1) { background: #477568; }

@keyframes egg-tray-shuffle {
  20% { transform: translateX(-8px) rotate(-1deg); }
  40% { transform: translateX(8px) rotate(1deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@keyframes egg-confetti-burst {
  to { opacity: 0; transform: translate(var(--confetti-x), var(--confetti-y)) rotate(160deg); }
}

.egg-confetti-1 { --confetti-x: 0; --confetti-y: -58px; }
.egg-confetti-2 { --confetti-x: 42px; --confetti-y: -42px; }
.egg-confetti-3 { --confetti-x: 58px; --confetti-y: 0; }
.egg-confetti-4 { --confetti-x: 42px; --confetti-y: 42px; }
.egg-confetti-5 { --confetti-x: 0; --confetti-y: 58px; }
.egg-confetti-6 { --confetti-x: -42px; --confetti-y: 42px; }
.egg-confetti-7 { --confetti-x: -58px; --confetti-y: 0; }
.egg-confetti-8 { --confetti-x: -42px; --confetti-y: -42px; }
.egg-confetti-delay-1 { animation-delay: 0.08s; }

@keyframes egg-selected-glow {
  to { filter: brightness(1.13) saturate(1.18); transform: scale(1.045); }
}

@keyframes egg-power-sweep {
  to { left: calc(100% - 5px); }
}

@keyframes egg-playful-bounce {
  50% { transform: translateY(-9px) rotate(4deg); }
}

.wheel-wrap {
  position: relative;
  padding-top: 12px;
}

.game-wheel {
  display: block;
  width: min(210px, 66vw);
  aspect-ratio: 1;
  border: 9px solid white;
  border-radius: 50%;
  box-shadow: 0 12px 28px rgb(42 49 65 / 20%), 0 0 0 2px rgb(42 49 65 / 18%);
}

.game-wheel::after {
  content: none;
}

.wheel-sector { stroke: rgb(255 255 255 / 52%); stroke-width: 0.24; }
.wheel-sector-0 { fill: #a74448; }
.wheel-sector-1 { fill: #f1c461; }
.wheel-sector-2 { fill: #477568; }
.wheel-sector-3 { fill: #dfe8f4; }

.wheel-number {
  z-index: 2;
  fill: white;
  paint-order: stroke;
  stroke: rgb(32 38 49 / 75%);
  stroke-width: 0.75;
  font-size: 3.25px;
  font-weight: 900;
  pointer-events: none;
}

.wheel-number-used {
  opacity: 0.28;
  text-decoration: line-through;
}

.wheel-hub {
  fill: var(--ink);
  stroke: white;
  stroke-width: 2.4;
}

.wheel-hub-text {
  fill: white;
  font-size: 6px;
  font-weight: 850;
  pointer-events: none;
}

.wheel-pointer {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  color: #202631;
  font-size: 28px;
  line-height: 1;
  transform: translateX(-50%);
}

.game-complete {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding-block: 28px;
}

.game-complete-title { color: var(--ink); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .gravity-machine.is-mixing .gravity-ball { animation: none; }
  .egg-tray.is-shuffling { animation-duration: 0.2s; }
  .egg-confetti { animation-duration: 0.3s; }
  .egg-power-meter.is-charging .egg-power-marker { animation: none; left: 55%; }
}

.history-controls {
  display: grid;
  margin-top: 24px;
  grid-template-columns: auto minmax(130px, 1fr) auto minmax(110px, 0.6fr) auto auto;
  align-items: center;
  gap: 8px;
}

.history-controls label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.history-controls input,
.history-controls select,
.history-controls button,
.history-pagination button,
.scanner-actions button,
.file-button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
}

.history-controls button,
.history-pagination button,
.scanner-actions button,
.file-button {
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.history-list {
  display: grid;
  margin-top: 18px;
  gap: 8px;
}

.history-row {
  display: grid;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / 72%);
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.history-meta strong,
.history-meta time {
  display: block;
}

.history-meta strong { font-size: 11px; }
.history-meta time { margin-top: 3px; color: var(--muted); font-size: 9px; }

.history-row .ball { width: 30px; font-size: 10px; }
.history-row button { border: 0; background: var(--blue-soft); color: var(--blue-deep); padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 9px; font-weight: 750; }

.history-pagination {
  display: flex;
  margin-top: 14px;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.history-pagination span { color: var(--muted); font-size: 10px; }

.statistics-block {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.statistics-block summary {
  padding: 18px 0 8px;
  color: var(--blue-deep);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.statistics-note,
.scanner-copy {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.statistics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.statistics-grid article {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / 68%);
}

.statistics-grid h3 { margin: 0 0 10px; font-size: 11px; }
.statistics-grid ol { margin: 0; padding: 0; list-style: none; }
.statistics-grid li { display: flex; padding: 5px 0; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 9px; }
.statistics-grid li:last-child { border-bottom: 0; }
.statistics-grid li span { color: var(--muted); }

.scanner-actions {
  display: flex;
  margin: 18px 0;
  flex-wrap: wrap;
  gap: 8px;
}

.file-button {
  display: inline-flex;
  align-items: center;
}

.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

#scanner-video {
  width: min(560px, 100%);
  max-height: 62vh;
  border-radius: 18px;
  background: #151820;
  object-fit: cover;
}

.scanner-result {
  min-height: 48px;
  padding: 14px;
  border-radius: 14px;
  background: var(--cream);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.memo-dialog {
  width: min(390px, calc(100% - 28px));
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px 28px 10px 28px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-align: center;
}

.memo-dialog::backdrop { background: rgb(31 35 45 / 54%); backdrop-filter: blur(5px); }
.memo-dialog h2 { margin: 0 0 16px; }
.memo-dialog #memo-qr { width: min(260px, 100%); margin: auto; }
.memo-dialog #memo-qr svg { display: block; width: 100%; height: auto; }
.memo-dialog #memo-text { font-weight: 800; font-variant-numeric: tabular-nums; }
.memo-dialog > strong { display: block; color: var(--red-deep); font-size: 10px; }
.dialog-close { position: absolute; top: 12px; right: 14px; width: 34px; aspect-ratio: 1; border: 0; border-radius: 50%; background: var(--cream); cursor: pointer; font-size: 20px; }

.generator-note {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.game-result-panel {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.game-result-list { margin-top: 11px; }

.responsible-note {
  display: flex;
  margin: 28px 0 70px;
  padding: 18px 20px;
  align-items: baseline;
  gap: 14px;
  border-left: 3px solid var(--gold);
  background: rgb(255 253 248 / 58%);
}

.responsible-note strong {
  flex: 0 0 auto;
  font-size: 11px;
}

.responsible-note p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

footer {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (min-width: 761px) and (max-width: 980px) {
  .number-row { flex-wrap: wrap; }
  .number-row .balls { flex: 1 1 390px; }
  .pick-rule { max-width: none; flex: 1 1 180px; }
  .number-row .row-actions { margin-left: auto; }
  .number-row-checked .check-badge { margin-left: auto; }
}

@media (max-width: 760px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 1080px);
  }

  .site-header {
    min-height: 68px;
  }

  .brand strong {
    display: none;
  }

  .site-header nav {
    max-width: calc(100% - 48px);
    gap: 9px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-header nav::-webkit-scrollbar { display: none; }

  .hero {
    padding-top: 46px;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .official-card {
    border-radius: 22px 22px 8px 22px;
  }

  .official-card p {
    margin-bottom: 14px;
  }

  .panel {
    padding: 20px 14px;
    border-radius: 24px 24px 8px 24px;
  }

  .number-row {
    padding: 11px 9px;
    gap: 5px;
    flex-wrap: wrap;
  }

  .number-row-index,
  .number-meta {
    display: none;
  }

  .number-row-checked {
    flex-wrap: wrap;
  }

  .number-row-checked .check-badge {
    display: flex;
    width: 100%;
    margin-top: 6px;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  .number-row-checked .check-badge span {
    margin: 0;
  }

  .pick-rule {
    width: 100%;
    max-width: none;
    flex: 1 1 100%;
    order: 3;
  }

  .number-row .row-actions { margin-left: auto; order: 4; }
  .number-row .check-badge { order: 5; }

  .balls {
    gap: 4px;
  }

  .ball-blue {
    margin-left: 2px;
  }

  .manual-entry form {
    grid-template-columns: minmax(0, 1fr) 68px;
  }

  .primary-button {
    grid-column: 1 / -1;
  }

  .generator-heading {
    align-items: end;
  }

  .game-grid,
  .statistics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .history-controls {
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .history-controls button {
    grid-column: span 2;
  }

  .history-row {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .history-row > button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .hero h1 {
    font-size: clamp(43px, 14vw, 60px);
  }

  .section-heading {
    align-items: start;
  }

  .generator-heading {
    display: grid;
  }

  .generator-controls {
    margin-top: 8px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .generator-controls button { grid-column: 1 / -1; }

  .number-inputs {
    grid-template-columns: repeat(3, minmax(44px, 1fr));
  }

  .number-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
    gap: 9px;
  }

  .number-row-checked {
    overflow-x: visible;
  }

  .number-row::-webkit-scrollbar {
    display: none;
  }

  .balls {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }

  .number-row .row-actions {
    position: static;
    width: 100%;
    padding-top: 7px;
    justify-content: flex-end;
    border-top: 1px solid rgb(42 49 65 / 8%);
    background: transparent;
  }

  .number-row .pick-rule {
    width: 100%;
    grid-column: 1 / -1;
    order: initial;
  }

  .game-grid {
    grid-template-columns: 1fr 1fr;
  }

  .game-grid button { min-height: 124px; }

  .game-stage { padding: 18px 14px; }

  .game-action { min-height: 170px; }

  .egg-tray { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }

  .egg-choice { min-height: 76px; }

  .egg-shell { width: 32px; height: 41px; }

  .egg-controls { grid-template-columns: minmax(0, 1fr) 88px; }

  .gravity-machine { width: min(100%, 330px); padding-inline: 10px; }
  .gravity-drum { height: 154px; }

  .history-row {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .history-row .balls { min-width: 244px; }

  .statistics-grid { grid-template-columns: 1fr; }

  .responsible-note {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 360px) {
  .site-header,
  main,
  footer { width: calc(100% - 16px); }

  .panel { padding-inline: 10px; }
  .number-row { padding-inline: 7px; }
  .ball { width: 28px; font-size: 10px; }
  .balls { gap: 3px; }
  .gravity-drum { height: 142px; }
  .gravity-ball { width: 22px; font-size: 7px; }
  .row-actions { gap: 3px; }
  .text-button,
  .delete-button,
  .save-generated-button { padding-inline: 7px; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .hero { padding-block: 28px; }
  .game-grid button { min-height: 96px; padding-block: 12px; }
  .game-grid span { font-size: 30px; }
  .game-action { min-height: 150px; }
  .login-view { padding-block: 12px; }
  .login-card { padding-block: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ambient-orbit span {
    animation: none;
  }
}
