:root {
  color-scheme: light;
  --paper: #e8f0ef;
  --paper-deep: #d8e6e3;
  --ink: #173238;
  --muted: #60777a;
  --line: #b8cbc8;
  --white: #fbfdfc;
  --signal: #e14f36;
  --signal-dark: #a92f20;
  --moss: #1f6b5d;
  --lime: #bedb79;
  --shadow: 0 20px 60px rgba(23, 50, 56, 0.12);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 50, 56, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 50, 56, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

button, input { font: inherit; }
button { color: inherit; }

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}

a { color: var(--moss); }

.page-shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }

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

.header-actions { display: flex; align-items: center; gap: 24px; }
.account-button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-weight: 650;
}
.account-button:hover { background: var(--ink); color: white; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.brand svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.brand svg circle:nth-child(2) { fill: var(--signal); stroke: var(--signal); }

.text-button {
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 64px;
  align-items: center;
  min-height: 480px;
  padding: 70px 0 56px;
}

.day-label { margin: 0 0 18px; color: var(--moss); font-weight: 650; }

.hero h1 {
  max-width: 710px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.hero-copy > p:last-child {
  max-width: 590px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 1.16rem;
  line-height: 1.6;
}

.radar { position: relative; aspect-ratio: 1; width: min(100%, 390px); justify-self: end; }
.radar-ring, .radar-axis, .radar-dot, .radar-center { position: absolute; display: block; }
.radar-ring { inset: 0; border: 1px solid var(--line); border-radius: 50%; }
.radar-ring--middle { inset: 18%; }
.radar-ring--inner { inset: 36%; }
.radar-axis--x { left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.radar-axis--y { top: 0; bottom: 0; left: 50%; border-left: 1px solid var(--line); }
.radar-center { width: 20px; height: 20px; left: calc(50% - 10px); top: calc(50% - 10px); border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 8px rgba(225, 79, 54, 0.12); }
.radar-dot { width: 13px; height: 13px; left: 10%; top: 76%; border: 3px solid var(--moss); border-radius: 50%; background: var(--paper); transition: left 500ms cubic-bezier(.2,.8,.2,1), top 500ms cubic-bezier(.2,.8,.2,1); }

.game-panel {
  padding: clamp(24px, 5vw, 54px);
  border-radius: 34px 34px 8px 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.game-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.game-heading h2 { margin: 0 0 6px; font-size: 1.6rem; letter-spacing: -0.03em; }
.game-heading p { margin: 0; color: var(--muted); }

.guess-control { display: grid; grid-template-columns: 1fr auto; border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; background: white; }
.guess-control:focus-within { box-shadow: 0 0 0 5px rgba(31, 107, 93, 0.13); }
.guess-control input { min-width: 0; padding: 19px 20px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1.12rem; }
.guess-control input::placeholder { color: #829496; }
.guess-control button { min-width: 130px; border: 0; background: var(--ink); color: white; cursor: pointer; font-weight: 700; }
.guess-control button:hover { background: var(--moss); }
.guess-control button:disabled { cursor: wait; opacity: 0.6; }
.form-message { min-height: 1.5em; margin: 10px 2px 0; color: var(--signal-dark); }

.result-spotlight { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 20px 0 14px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.result-spotlight div { display: flex; flex-direction: column; gap: 3px; }
.result-spotlight span { color: var(--muted); font-size: 0.9rem; }
.result-spotlight strong { font-size: 1.35rem; }
.result-spotlight b { font-family: Georgia, serif; font-size: 2.2rem; font-weight: 400; }

.attempt-list { display: grid; gap: 9px; margin: 24px 0 0; padding: 0; list-style: none; }
.attempt {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  padding: 11px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.attempt::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--score); background: color-mix(in srgb, var(--lime) 64%, transparent); }
.attempt > * { position: relative; }
.attempt-rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.attempt-word { font-weight: 700; }
.attempt-score { font-variant-numeric: tabular-nums; }
.attempt--solved { border-color: var(--signal); }
.attempt--solved::before { background: rgba(225, 79, 54, 0.18); }

.empty-state { display: flex; align-items: center; gap: 14px; margin-top: 24px; padding: 22px 4px 4px; color: var(--muted); }
.empty-state span { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 8px rgba(190, 219, 121, 0.24); }
.empty-state p { margin: 0; }

.secondary-info { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0 72px; }
.previous-card, .stats-card { min-height: 112px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 8px 8px 22px 22px; background: rgba(251, 253, 252, 0.55); text-align: left; }
.previous-card { cursor: pointer; }
.previous-card:hover { background: var(--white); }
.previous-card span, .stats-card span { display: block; margin-bottom: 8px; color: var(--muted); }
.previous-card strong, .stats-card strong { font-size: 1.15rem; }

footer { display: flex; justify-content: space-between; gap: 28px; padding: 28px 0 44px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
footer p { margin: 0; }
.legal-links { display: flex; gap: 18px; }
.legal-links a { color: inherit; }

dialog { width: min(720px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: var(--white); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(23, 50, 56, 0.55); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; }
.dialog-head button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--paper); cursor: pointer; font-size: 1.6rem; }
.rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 32px 28px 38px; }
.rules-grid b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: white; }
.rules-grid h3 { margin: 18px 0 8px; }
.rules-grid p { margin: 0; color: var(--muted); line-height: 1.5; }

.dialog-kicker { margin: 0 0 4px; color: var(--moss); font-size: 0.85rem; font-weight: 700; }
.account-dialog { width: min(620px, calc(100% - 24px)); max-height: min(880px, calc(100vh - 32px)); }
.account-body { padding: 28px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 26px; padding: 4px; border-radius: 12px; background: var(--paper); }
.auth-tabs button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.auth-tabs button.is-active { background: var(--white); box-shadow: 0 4px 14px rgba(23, 50, 56, 0.1); font-weight: 700; }
.account-body form:not(.admin-form) { display: grid; gap: 9px; }
.account-body label { margin-top: 8px; color: var(--muted); font-size: 0.9rem; font-weight: 650; }
.account-body input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
.field-hint { margin: 0 0 8px; color: var(--muted); font-size: 0.85rem; }
.registration-consents { display: grid; gap: 12px; margin: 8px 0 10px; }
.check-label { display: grid !important; grid-template-columns: 22px 1fr; gap: 9px; align-items: start; margin: 0 !important; color: var(--ink) !important; font-weight: 400 !important; line-height: 1.45; }
.check-label input { width: 18px !important; min-height: 18px !important; margin: 2px 0 0; }
.primary-button { min-height: 50px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--ink); color: white; cursor: pointer; font-weight: 750; }
.primary-button:hover { background: var(--moss); }
.primary-button:disabled { cursor: wait; opacity: 0.6; }
.profile-identity { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.profile-identity span, .profile-score span { color: var(--muted); font-size: 0.88rem; }
.profile-identity strong { font-size: 1.15rem; }
.profile-score { display: flex; align-items: end; justify-content: space-between; padding: 20px; border-radius: 14px; background: var(--paper); }
.profile-score strong { font-family: Georgia, serif; font-size: 2.4rem; font-weight: 400; }
.history-section { margin-top: 28px; }
.history-section h3 { margin: 0 0 12px; }
.history-list { display: grid; gap: 8px; }
.history-list > p { color: var(--muted); }
.history-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.history-row span { color: var(--muted); font-size: 0.88rem; }
.history-row b:last-child { color: var(--moss); }
.admin-section { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--line); }
.admin-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.admin-heading span { color: var(--signal-dark); font-size: 0.82rem; font-weight: 700; }
.admin-heading h3 { margin: 4px 0 0; font-size: 1.35rem; }
.admin-heading > b { padding: 5px 9px; border-radius: 999px; background: rgba(225, 79, 54, 0.12); color: var(--signal-dark); font-size: 0.8rem; }
.admin-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.admin-form .primary-button, .admin-form .form-message { grid-column: 1 / -1; }
.admin-rounds { display: grid; gap: 7px; margin-top: 18px; }
.admin-round { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.admin-round span { color: var(--muted); font-size: 0.84rem; }
.logout-button { width: 100%; min-height: 46px; margin-top: 28px; border: 1px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; }
.logout-button:hover { border-color: var(--signal); color: var(--signal-dark); }
.privacy-tools { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line); }
.privacy-tools h3 { margin: 0 0 8px; }
.privacy-tools > p { margin: 0 0 16px; color: var(--muted); line-height: 1.5; }
.privacy-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.privacy-actions button, .danger-button { min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: transparent; cursor: pointer; }
.danger-button { border-color: var(--signal); color: var(--signal-dark); }
.delete-account-form { display: grid; gap: 8px; margin-top: 18px; padding: 18px; border-radius: 12px; background: rgba(225, 79, 54, 0.08); }
.delete-account-form .danger-button { margin-top: 8px; background: var(--signal); color: white; font-weight: 700; }

.legal-page { width: min(820px, calc(100% - 40px)); margin: 0 auto; }
.legal-header { display: flex; justify-content: space-between; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--line); }
.legal-header a { color: inherit; }
.legal-copy { padding: 58px 0 80px; }
.legal-copy h1 { margin: 0 0 16px; font-family: Georgia, serif; font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 400; letter-spacing: -0.05em; }
.legal-copy .lead { margin-bottom: 44px; color: var(--muted); font-size: 1.14rem; line-height: 1.6; }
.legal-copy h2 { margin: 42px 0 12px; font-size: 1.35rem; }
.legal-copy h3 { margin: 28px 0 8px; }
.legal-copy p, .legal-copy li { line-height: 1.65; }
.legal-copy table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.legal-copy th, .legal-copy td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-copy code { padding: 2px 5px; border-radius: 4px; background: var(--paper-deep); }
.legal-note { padding: 18px 20px; border-left: 4px solid var(--moss); background: rgba(251, 253, 252, 0.6); }

.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; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 24px, 620px); }
  .site-header { padding: 20px 0; }
  .header-actions { gap: 12px; }
  .header-actions .text-button { display: none; }
  .hero { grid-template-columns: 1fr; gap: 36px; min-height: auto; padding: 56px 0 44px; }
  .hero h1 { font-size: clamp(3.2rem, 16vw, 5.4rem); }
  .radar { width: min(72vw, 320px); justify-self: center; }
  .game-panel { padding: 24px 18px; border-radius: 24px 24px 6px 6px; }
  .game-heading { align-items: start; }
  .guess-control { grid-template-columns: 1fr; }
  .guess-control button { min-height: 54px; }
  .secondary-info { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: 1fr; }
  .admin-form { grid-template-columns: 1fr; }
  .admin-form .primary-button, .admin-form .form-message { grid-column: auto; }
  .history-row { grid-template-columns: 1fr auto; }
  .history-row span { grid-column: 1 / -1; }
  footer { flex-direction: column; gap: 10px; }
  .legal-links { flex-direction: column; gap: 8px; }
  .legal-copy table, .legal-copy tbody, .legal-copy tr, .legal-copy th, .legal-copy td { display: block; }
  .legal-copy th { padding-bottom: 2px; border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

