:root {
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color-scheme: light;
  --day-bg: url("./assets/theme-day.png");
  --night-bg: url("./assets/theme-night.png");
  --ink: #2d342b;
  --muted: #687263;
  --panel: rgba(255, 253, 241, 0.84);
  --panel-strong: rgba(255, 255, 248, 0.94);
  --panel-soft: rgba(246, 250, 237, 0.78);
  --line: rgba(116, 147, 94, 0.34);
  --accent: #78a866;
  --accent-deep: #4f925f;
  --accent-soft: #e8f2dc;
  --secondary: #a7b49e;
  --shadow: 0 26px 64px rgba(80, 103, 63, 0.18);
  --soft-shadow: 0 12px 32px rgba(80, 103, 63, 0.14);
  --grid: #cdd8ca;
  --note: #e9a61c;
  --wrong: #f45c78;
  --right: #5f9b70;
  --blue: #318de6;
  --orange: #f9a24d;
  --red: #fb6a55;
  --yellow: #f9dc6f;
  --modal-bg: #26365d;
}

body.theme-night {
  color-scheme: dark;
  --ink: #f5efff;
  --muted: #d6cdee;
  --panel: rgba(35, 26, 88, 0.72);
  --panel-strong: rgba(46, 37, 112, 0.9);
  --panel-soft: rgba(61, 49, 130, 0.72);
  --line: rgba(184, 164, 255, 0.38);
  --accent: #b9a1ff;
  --accent-deep: #7968df;
  --accent-soft: rgba(135, 113, 228, 0.28);
  --secondary: #6b63a9;
  --shadow: 0 32px 76px rgba(7, 4, 34, 0.44);
  --soft-shadow: 0 16px 38px rgba(7, 4, 34, 0.3);
  --grid: rgba(174, 197, 240, 0.45);
  --modal-bg: #181640;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: #eff6e8;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid rgba(255, 203, 88, 0.9);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  isolation: isolate;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--day-bg);
  background-size: cover;
  background-position: center;
}

body.theme-night .app-shell::before {
  background-image: var(--night-bg);
}

.app-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

body.theme-night .app-shell::after {
  background: rgba(8, 4, 37, 0.2);
}

.theme-switch {
  position: fixed;
  right: clamp(18px, 3vw, 52px);
  top: clamp(16px, 2.2vw, 34px);
  z-index: 30;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

.theme-switch button {
  min-width: 64px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.theme-switch button.is-active {
  background: var(--accent);
  color: #fff;
}

body.theme-night .theme-switch button.is-active {
  color: #fff7c8;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: clamp(52px, 5vw, 86px) clamp(20px, 4vw, 132px) clamp(76px, 6vw, 104px);
}

.screen.is-active {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.trophy-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

body.theme-night .trophy-icon {
  color: #f4d776;
  filter: drop-shadow(0 0 10px rgba(244, 215, 118, 0.28));
}

.button-icon,
.tool-icon,
.status-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tool-icon {
  width: 34px;
  height: 34px;
  color: var(--accent);
}

body.theme-night .tool-icon,
body.theme-night .status-icon,
body.theme-night .button-icon {
  color: #f4d776;
  filter: drop-shadow(0 0 10px rgba(244, 215, 118, 0.18));
}

.home-header,
.game-header,
.sub-header {
  display: grid;
  gap: 28px;
  align-items: start;
}

.home-header {
  grid-template-columns: minmax(430px, 1fr) minmax(360px, 580px);
}

.brand-block {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 82px;
  height: 82px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  background: rgba(72, 138, 202, 0.92);
  color: #fff;
  box-shadow: var(--soft-shadow);
  overflow: hidden;
  flex: 0 0 auto;
}

body.theme-night .brand-mark {
  background: rgba(70, 85, 195, 0.86);
}

.brand-mark span {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.64);
  font-size: 20px;
  line-height: 1;
}

.brand-copy {
  min-width: 0;
}

.eyebrow {
  margin: 4px 0 4px;
  color: var(--accent-deep);
  font-size: 18px;
  font-weight: 700;
}

h1,
.hero-title h2,
.list-panel h2 {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 3vw, 45px);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.42);
}

body.theme-night h1,
body.theme-night .hero-title h2,
body.theme-night .list-panel h2 {
  color: #efe6ff;
  text-shadow: 0 0 24px rgba(133, 200, 255, 0.42);
}

.daily-line {
  width: min(620px, 100%);
  margin-top: 14px;
}

.daily-line p {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 8px 18px 8px 20px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 0 18px 18px 0;
  background: linear-gradient(90deg, rgba(255, 255, 248, 0.76), rgba(255, 255, 248, 0.34));
  color: var(--muted);
  font-size: clamp(15px, 1.05vw, 18px);
  font-weight: 600;
  line-height: 1.45;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

body.theme-night .daily-line p {
  background: linear-gradient(90deg, rgba(45, 36, 112, 0.76), rgba(45, 36, 112, 0.34));
  color: #efe6ff;
  border-left-color: #c7b7ff;
  text-shadow: 0 0 14px rgba(139, 204, 255, 0.28);
}

.daily-line.compact {
  width: min(520px, 100%);
  margin-top: 0;
}

.daily-line.compact p {
  min-height: 44px;
  padding-right: 16px;
  font-size: clamp(14px, 0.95vw, 16px);
}

.progress-board {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
}

.progress-title,
.progress-row {
  display: grid;
  grid-template-columns: 88px 32px 1fr 86px;
  gap: 12px;
  align-items: center;
}

.progress-title {
  grid-template-columns: 1fr;
  justify-items: end;
  padding-left: 0;
  color: var(--muted);
  font-size: 12px;
}

.progress-row strong {
  font-size: 17px;
  font-weight: 500;
}

.progress-trophy {
  justify-self: center;
}

.progress-row .bar {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(119, 127, 113, 0.28);
}

body.theme-night .progress-row .bar {
  background: rgba(255, 255, 255, 0.18);
}

.progress-row .bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.progress-row em {
  font-style: normal;
  font-size: 16px;
}

.hero-panel {
  width: min(1440px, 100%);
  margin: clamp(24px, 4vw, 54px) auto 0;
  padding: clamp(22px, 3vw, 42px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

body.theme-night .hero-panel {
  box-shadow: 0 34px 90px rgba(9, 4, 45, 0.52), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.hero-title {
  max-width: 760px;
  margin: 0 auto 24px;
  text-align: center;
}

.small-rule {
  display: block;
  width: 122px;
  height: 2px;
  margin: 0 auto 12px;
  background: var(--accent);
  opacity: 0.62;
}

.hero-title h2 {
  font-size: clamp(32px, 4.1vw, 64px);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: clamp(18px, 2.5vw, 34px);
}

.mode-card {
  min-height: clamp(330px, 24vw, 390px);
  padding: clamp(28px, 2.3vw, 38px) clamp(20px, 2vw, 30px);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 248, 0.98), var(--panel-strong));
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 20px 42px rgba(80, 103, 63, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.56);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.mode-card::before {
  content: none;
}

.mode-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  pointer-events: none;
  opacity: 0.52;
}

body.theme-night .mode-card {
  background: linear-gradient(180deg, rgba(61, 49, 130, 0.96), var(--panel-strong));
  box-shadow: 0 22px 46px rgba(7, 4, 34, 0.26), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.mode-card.is-locked {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.72;
}

.mode-card.is-locked::after {
  border-style: dashed;
}

.mode-card.is-locked:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: 0 20px 42px rgba(80, 103, 63, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.56);
}

body.theme-night .mode-card.is-locked:hover {
  box-shadow: 0 22px 46px rgba(7, 4, 34, 0.26), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.mode-card.is-locked .primary-action,
.mode-card.is-locked .secondary-action {
  cursor: not-allowed;
  opacity: 0.52;
}

.mode-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--soft-shadow);
}

.mode-card:active,
.mode-card.is-pressed {
  transform: translateY(-1px) scale(0.985);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(80, 103, 63, 0.2), inset 0 0 0 2px rgba(120, 168, 102, 0.24);
}

.mode-number {
  display: none;
}

.mode-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 20px;
  color: var(--accent);
  text-align: center;
  font-size: clamp(31px, 2.8vw, 44px);
  font-weight: 500;
  line-height: 1.08;
}

.card-trophy {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 4px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.56), 0 10px 22px rgba(80, 103, 63, 0.12);
}

.card-trophy .trophy-icon {
  width: 30px;
  height: 30px;
  color: currentColor;
}

body.theme-night .card-trophy {
  background: rgba(135, 113, 228, 0.22);
  color: #f4d776;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 22px rgba(244, 215, 118, 0.12);
}

.unlock-note {
  position: relative;
  z-index: 1;
  min-height: 28px;
  margin: 0 0 clamp(18px, 1.6vw, 28px);
  color: var(--muted);
  text-align: center;
  font-size: clamp(12px, 0.78vw, 14px);
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
}

body.theme-night .unlock-note {
  color: #efe6ff;
}

.primary-action,
.secondary-action,
.back-button,
.pause-button,
.filter,
.pill,
.gold-action,
.light-action {
  border: 0;
  border-radius: 999px;
}

.primary-action,
.secondary-action {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
  font-size: 19px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 18px rgba(75, 129, 77, 0.24);
  position: relative;
  z-index: 1;
}

.primary-action {
  background: var(--accent-deep);
}

body.theme-night .primary-action {
  background: #6d61cf;
  box-shadow: 0 0 20px rgba(116, 178, 255, 0.24);
}

.secondary-action {
  margin-top: 14px;
  background: rgba(120, 128, 120, 0.66);
}

body.theme-night .secondary-action {
  background: rgba(122, 114, 168, 0.68);
}

.primary-action small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.stats-strip {
  width: min(1320px, 100%);
  margin: clamp(28px, 4vw, 54px) auto 0;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  display: grid;
  grid-template-columns: 110px repeat(9, minmax(72px, 1fr));
  gap: 12px;
  align-items: center;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
}

.stats-strip strong {
  font-size: 20px;
  font-weight: 600;
}

.stat-item {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.stat-item span {
  min-width: 44px;
  min-height: 31px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border-bottom: 3px double var(--line);
  font-size: 17px;
  font-weight: 700;
}

.stat-item small {
  color: var(--muted);
  font-size: 16px;
  white-space: nowrap;
}

.site-footer {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 24;
  transform: translateX(-50%);
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 248, 0.84);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
}

.site-footer a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.site-footer a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

body.theme-night .site-footer {
  background: rgba(35, 26, 88, 0.78);
}

body.theme-night .site-footer a:hover {
  color: #fff7c8;
}

.sub-header {
  grid-template-columns: 360px 1fr;
}

.sub-left,
.game-left-head {
  display: grid;
  gap: 18px;
}

.back-button {
  width: 150px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(79, 90, 79, 0.68);
  color: #fff;
  font-size: 22px;
  box-shadow: var(--soft-shadow);
}

body.theme-night .back-button {
  background: rgba(55, 45, 119, 0.86);
}

.zodiac-filters {
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.filter,
.pill {
  min-width: 112px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 22px;
  box-shadow: var(--soft-shadow);
}

.filter.is-active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.list-panel {
  width: min(1440px, 100%);
  margin: 42px auto 0;
  padding: clamp(24px, 3vw, 42px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.list-panel h2 {
  margin-bottom: 28px;
  text-align: center;
  font-size: clamp(32px, 3vw, 54px);
}

.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(128px, 1fr));
  gap: 28px;
}

.zodiac-card {
  min-height: 304px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  display: grid;
  position: relative;
  overflow: hidden;
  box-shadow: var(--soft-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.zodiac-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.zodiac-card img {
  width: 100%;
  height: 100%;
  min-height: 282px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center 58%;
  filter: saturate(0.86) brightness(1.07);
}

body.theme-night .zodiac-card img {
  filter: saturate(1.08) brightness(0.96);
}

.zodiac-card.is-locked img {
  opacity: 0.42;
}

.zodiac-lock {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 92px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  color: #fff;
  background: rgba(79, 146, 95, 0.86);
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 10px 24px rgba(32, 48, 28, 0.26);
  backdrop-filter: blur(8px);
}

body.theme-night .zodiac-lock {
  color: #fff7c8;
  background: rgba(111, 94, 220, 0.9);
  box-shadow: 0 0 24px rgba(185, 161, 255, 0.28);
}

.zodiac-name {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #596354;
  font-size: 16px;
}

body.theme-night .zodiac-name {
  background: rgba(39, 30, 92, 0.84);
  color: #fff;
}

.zodiac-detail-header {
  grid-template-columns: minmax(300px, 520px) repeat(3, max-content);
  justify-content: space-between;
  align-items: center;
}

.constellation-panel {
  margin: 46px auto 0;
  width: min(1397px, 100%);
  text-align: center;
}

.constellation-art {
  width: 100%;
  aspect-ratio: 21 / 9;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: clamp(20px, 3vw, 44px);
  overflow: hidden;
  position: relative;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.constellation-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.06) brightness(1.02);
}

.constellation-locks {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
}

.lock-tile {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: clamp(14px, 1.5vw, 24px);
  cursor: pointer;
  transition: opacity 0.16s ease, transform 0.16s ease, filter 0.16s ease;
}

.lock-icon {
  width: clamp(26px, 3vw, 46px);
  height: clamp(26px, 3vw, 46px);
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
}

.lock-tile:hover {
  filter: brightness(1.08);
  transform: scale(0.985);
}

.lock-tile.simple {
  background: rgba(249, 220, 111, 0.9);
}

.lock-tile.normal {
  background: rgba(251, 106, 85, 0.9);
}

.lock-tile.master {
  background: rgba(49, 141, 230, 0.9);
}

.lock-tile.done {
  pointer-events: none;
  opacity: 0;
}

.zodiac-detail-actions {
  display: grid;
  justify-content: center;
  align-items: center;
  margin: 18px auto 12px;
}

.zodiac-lock-legend {
  display: grid;
  gap: 8px;
  text-align: left;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
}

.zodiac-lock-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
}

.legend-color.simple {
  background: var(--yellow);
}

.legend-color.normal {
  background: var(--red);
}

.legend-color.master {
  background: var(--blue);
}

.game-header {
  grid-template-columns: 300px minmax(560px, 1fr) 190px;
  align-items: start;
}

.game-status {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
}

.game-status span {
  color: var(--muted);
  font-size: 18px;
}

.game-status strong,
.status-metric {
  color: var(--accent);
  font-size: 26px;
  font-weight: 600;
}

.mistake-line,
.timer-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.mistake-line i {
  font-style: normal;
  color: #ffc928;
  font-size: 26px;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.timer-line b {
  color: var(--accent);
  font-size: 24px;
  font-weight: 600;
}

.pause-button {
  width: auto;
  min-width: 92px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 18px;
}

body.theme-night .pause-button {
  color: #fff;
}

.mode-badge {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  color: var(--accent);
  box-shadow: var(--soft-shadow);
}

.mode-badge span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 15px;
}

.mode-badge strong {
  display: block;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.game-layout {
  display: grid;
  grid-template-columns: 210px minmax(460px, 540px) minmax(260px, 340px);
  justify-content: center;
  gap: 28px;
  margin-top: 28px;
  width: 100%;
  min-width: 0;
}

.tool-column {
  display: grid;
  gap: 16px;
  align-content: center;
}

.tool-card {
  min-height: 82px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--ink);
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
}

.tool-card strong {
  display: block;
  margin-bottom: 0;
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}

.tool-card.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.board-wrap {
  display: grid;
  gap: 14px;
  width: min-content;
  max-width: 100%;
  box-sizing: border-box;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(520px, 76vw);
  aspect-ratio: 1;
  border: 3px solid rgba(36, 42, 36, 0.82);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
}

body.theme-night .sudoku-board {
  border-color: rgba(229, 220, 255, 0.76);
  background: rgba(17, 18, 54, 0.9);
}

.cell {
  border: 1px solid var(--grid);
  background: rgba(255, 255, 255, 0.74);
  color: #29302c;
  display: grid;
  place-items: center;
  font-size: clamp(24px, 3vw, 46px);
  line-height: 1;
  position: relative;
}

body.theme-night .cell {
  background: rgba(32, 34, 78, 0.7);
  color: #f3efff;
}

.cell:nth-child(3n) {
  border-right-color: rgba(36, 42, 36, 0.82);
  border-right-width: 3px;
}

.cell:nth-child(9n) {
  border-right-width: 1px;
  border-right-color: var(--grid);
}

.cell:nth-child(n + 19):nth-child(-n + 27),
.cell:nth-child(n + 46):nth-child(-n + 54) {
  border-bottom-color: rgba(36, 42, 36, 0.82);
  border-bottom-width: 3px;
}

body.theme-night .cell:nth-child(3n),
body.theme-night .cell:nth-child(n + 19):nth-child(-n + 27),
body.theme-night .cell:nth-child(n + 46):nth-child(-n + 54) {
  border-color: rgba(229, 220, 255, 0.76);
}

.cell.is-given {
  font-weight: 600;
}

.cell.is-selected {
  background: rgba(206, 232, 255, 0.9);
  outline: 3px solid rgba(89, 151, 220, 0.68);
  z-index: 1;
}

body.theme-night .cell.is-selected {
  background: rgba(70, 91, 168, 0.92);
}

.cell.is-peer {
  background: rgba(232, 242, 220, 0.9);
}

body.theme-night .cell.is-peer {
  background: rgba(58, 54, 112, 0.88);
}

.cell.is-same {
  background: rgba(215, 238, 219, 0.96);
}

body.theme-night .cell.is-same {
  background: rgba(79, 67, 144, 0.96);
}

.cell.is-right {
  color: var(--right);
}

.cell.is-wrong {
  color: var(--wrong);
}

.cell.is-note {
  color: var(--note);
}

body.theme-night .cell.is-right {
  color: #72c78a;
}

body.theme-night .cell.is-wrong {
  color: #ff5f7f;
}

body.theme-night .cell.is-note {
  color: #ffd84f;
}

.number-pad {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 7px;
}

.num-key {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  color: var(--accent);
  display: grid;
  justify-items: center;
  align-content: center;
  box-shadow: var(--soft-shadow);
}

.num-key strong {
  font-size: clamp(28px, 3vw, 46px);
  font-weight: 500;
  line-height: 1;
}

.num-key small {
  color: var(--muted);
  font-size: 16px;
}

.num-key:disabled {
  opacity: 0.38;
}

.rules-card {
  min-height: 330px;
  align-self: center;
  box-sizing: border-box;
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
}

.rules-card strong {
  display: block;
  margin-bottom: 20px;
  color: var(--accent);
  text-align: center;
  font-size: 22px;
  font-weight: 700;
}

.rules-card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.rules-card p:first-of-type {
  color: var(--ink);
}

.rule-prefix {
  margin-right: 6px;
  color: var(--ink);
  font-weight: 700;
}

.sample {
  display: inline-block;
  min-width: 32px;
  font-size: 40px;
  line-height: 1;
  vertical-align: middle;
}

.sample-note {
  color: var(--note);
}

.sample-wrong {
  color: var(--wrong);
}

.sample-right {
  color: var(--right);
}

body.theme-night .sample-note {
  color: #ffd84f;
}

body.theme-night .sample-wrong {
  color: #ff5f7f;
}

body.theme-night .sample-right {
  color: #72c78a;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(8px);
}

body.theme-night .modal {
  background: rgba(9, 4, 37, 0.62);
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  width: min(720px, 92vw);
  min-height: 560px;
  padding: 72px 54px 44px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 28px;
  background: var(--modal-bg);
  color: #fff;
  text-align: center;
  box-shadow: 0 30px 90px rgba(15, 14, 42, 0.44);
}

.modal-close {
  position: absolute;
  right: -26px;
  top: -26px;
  width: 68px;
  height: 68px;
  border: 5px solid #111;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 44px;
  line-height: 1;
}

.win-pill {
  width: min(460px, 84%);
  margin: 0 auto 30px;
  padding: 28px 20px 34px;
  border-radius: 999px;
  background: #f9514e;
  color: #ffe26f;
  font-size: clamp(54px, 7vw, 88px);
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 16px 0 #bf2e44;
}

.modal-panel h2 {
  margin: 0 0 24px;
  font-size: 44px;
  font-weight: 700;
}

.modal-panel p {
  max-width: 560px;
  margin: 0 auto 32px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 24px;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  gap: 18px;
  justify-content: center;
}

.gold-action,
.light-action {
  min-width: 138px;
  min-height: 62px;
  padding: 0 22px;
  font-size: 24px;
  font-weight: 700;
}

.gold-action {
  background: #f0bc31;
  color: #46320c;
}

.light-action {
  background: #fff;
  color: #242a32;
}

@media (max-width: 1250px) {
  .home-header,
  .game-header,
  .game-layout,
  .sub-header,
  .zodiac-detail-header {
    grid-template-columns: 1fr;
  }

  .mode-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .game-layout {
    justify-items: center;
  }

  .game-status {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .tool-column {
    grid-template-columns: repeat(4, 1fr);
    width: min(900px, 100%);
  }

  .rules-card {
    width: min(680px, 100%);
  }

  .zodiac-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .screen {
    padding: 76px 14px 86px;
  }

  .theme-switch {
    right: 14px;
    top: 12px;
  }

  .brand-block {
    gap: 14px;
  }

  .brand-mark {
    width: 62px;
    height: 62px;
  }

  .brand-mark span {
    font-size: 15px;
  }

  .daily-line p,
  .daily-line.compact p {
    min-width: min(100%, 310px);
    font-size: 15px;
  }

  .progress-title,
  .progress-row {
    grid-template-columns: 78px 28px 1fr 74px;
  }

  .progress-title {
    grid-template-columns: 1fr;
    justify-items: end;
    padding-left: 0;
  }

  .mode-grid,
  .zodiac-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .hero-panel,
  .list-panel {
    padding: 20px;
    border-radius: 22px;
  }

  .mode-card {
    min-height: 300px;
    padding: 24px 20px;
  }

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

  .stats-strip strong {
    grid-column: 1 / -1;
  }

  .site-footer {
    bottom: 10px;
    max-width: calc(100vw - 28px);
    padding: 7px 14px;
  }

  .site-footer a {
    font-size: 12px;
  }

  .zodiac-filters {
    justify-content: flex-start;
  }

  .filter,
  .pill {
    font-size: 18px;
  }

  .tool-column {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .number-pad {
    grid-template-columns: repeat(3, 1fr);
  }

  .sudoku-board {
    width: min(calc(100vw - 56px), 560px);
  }

  .board-wrap,
  .rules-card {
    width: 100%;
  }

  .rules-card {
    max-width: calc(100vw - 28px);
    min-height: 0;
    padding: 22px 18px;
    font-size: 15px;
  }

  .rules-card strong {
    font-size: 19px;
  }

  .sample {
    min-width: 26px;
    font-size: 32px;
  }

  .constellation-art {
    min-height: 0;
  }

  .zodiac-detail-actions {
    gap: 14px;
  }

  .zodiac-lock-legend {
    width: 100%;
    max-width: 320px;
    font-size: 14px;
  }

  .modal-close {
    right: 8px;
    top: 8px;
    width: 54px;
    height: 54px;
    font-size: 34px;
  }

  .modal-panel {
    padding: 74px 20px 34px;
  }

  .modal-panel p {
    font-size: 20px;
  }
}
