:root {
  --green: #328b3d;
  --green-bright: #3ea74a;
  --green-dark: #24672d;
  --orange: #fbb402;
  --orange-dark: #865600;
  --ink: #172b1c;
  --muted: #58675c;
  --line: #dce8df;
  --surface: #f4f8f4;
  --radius: 12px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--surface);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
[hidden] { display: none !important; }
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--green-dark); text-underline-offset: 0.2em; }
::selection { color: var(--ink); background: #ffe8a0; }
:focus-visible { outline: 3px solid var(--orange-dark); outline-offset: 4px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 74px; padding: 16px max(16px, calc((100vw - 1120px) / 2)); background: #fff; border-bottom: 4px solid var(--green); }
.brand { display: block; line-height: 0; flex: 0 1 198px; min-width: 0; }
.brand img { display: block; max-width: 100%; height: auto; }
.back-link { font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
main, footer { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
main { padding-top: 24px; }
.preview-notice { margin: 0 0 18px; padding: 14px 16px; color: #664100; background: #fff1c6; border: 1px solid #d9af45; border-radius: var(--radius); font-size: 0.85rem; line-height: 1.6; }
.hero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 42px; padding: 36px; border-radius: var(--radius); color: #fff; background: linear-gradient(105deg, #287732, #328b3d 65%, #3ea74a); }
.hero h1 { margin: 0; font-size: 2.75rem; line-height: 1.12; letter-spacing: -0.025em; }
.hero h1 span { color: #ffcf4a; }
.hero-copy > p { margin: 18px 0; max-width: 45ch; line-height: 1.65; color: #fff; font-size: 0.95rem; }
.hero-terms { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.hero-terms li { padding: 7px 10px; border: 1px solid #94c39a; border-radius: 6px; font-size: 0.75rem; font-weight: 700; }
.results-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 44px; padding: 10px 16px; color: #302500; background: var(--orange); border-radius: 8px; font-weight: 700; text-decoration: none; }
.results-link:hover { background: #ffc735; }
.prize-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.prize-grid li { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 51px; padding: 9px 12px; color: var(--ink); background: #fff; border-radius: 8px; }
.prize-grid li:first-child { background: var(--orange); }
.prize-grid li:nth-child(2) { background: #ffe7a7; }
.prize-grid li:nth-child(3) { background: #ffefc7; }
.prize-grid li span { flex: 0 0 28px; display: grid; place-items: center; width: 28px; height: 28px; color: var(--green-dark); background: #e8f4e9; border-radius: 50%; font-size: 0.8rem; font-weight: 700; }
.prize-grid strong { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.ranking-shell { margin-top: 24px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
h2 { margin: 0 0 8px; font-size: 1.5rem; letter-spacing: -0.02em; }
.toolbar p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.toolbar-actions { display: flex; align-items: end; gap: 10px; }
.month-picker { display: grid; gap: 6px; font-size: 0.78rem; font-weight: 700; }
.month-picker select { min-height: 42px; padding: 9px 30px 9px 10px; color: var(--ink); background: #fff; border: 1px solid #a9beae; border-radius: 8px; }
.refresh-button { min-height: 42px; padding: 9px 13px; color: var(--green-dark); background: #eaf6ec; border: 1px solid #a9beae; border-radius: 8px; font-weight: 700; }
.refresh-button:hover { background: #d6edd9; }
.refresh-button:disabled { opacity: 0.6; cursor: wait; }
.tabs { display: flex; gap: 0; margin: 24px 0 18px; border-bottom: 2px solid var(--line); }
.tabs button { min-height: 46px; padding: 12px 22px; margin-bottom: -2px; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: transparent; font-weight: 700; transition: color 160ms ease, background 160ms ease; }
.tabs button:hover { background: #f0f7f1; color: var(--green-dark); }
.tabs button[aria-selected="true"] { border-bottom-color: var(--green); color: var(--green-dark); }
.table-head, .ranking-list li { display: grid; grid-template-columns: 68px minmax(0, 1fr) minmax(140px, 0.7fr) 126px; align-items: center; gap: 16px; }
.table-head { padding: 12px 16px; color: var(--muted); font-size: 0.75rem; font-weight: 700; background: #f4f8f4; border-radius: 8px; }
.table-head span:nth-child(n+3) { text-align: right; }
.ranking-list { margin: 4px 0 0; padding: 0; list-style: none; }
.ranking-list li { min-height: 72px; padding: 12px 16px; border-bottom: 1px solid #e7eee8; }
.ranking-list li:last-child { border-bottom: 0; }
.ranking-list li:first-child { background: #fffae8; }
.rank { width: 32px; height: 32px; display: grid; place-items: center; color: var(--green-dark); background: #e8f4e9; border-radius: 50%; font-size: 0.85rem; font-weight: 700; }
.ranking-list li:first-child .rank { color: #302500; background: var(--orange); }
.member { min-width: 0; display: grid; gap: 5px; }
.member strong, .member span { overflow-wrap: anywhere; }
.member strong { font-size: 0.9rem; }
.member span { color: var(--muted); font-size: 0.76rem; }
.amount, .prize { font-size: 0.9rem; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.prize { color: var(--green-dark); font-weight: 700; }
.prize small { display: none; }
.skeleton { height: 18px; border-radius: 4px; background: linear-gradient(100deg, #e7eee8 20%, #f8faf8 38%, #e7eee8 56%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }
.state-panel { padding: 42px 12px; text-align: center; }
.state-panel strong, .state-panel > span { display: block; }
.state-panel > span { max-width: 52ch; margin: 10px auto 20px; color: var(--muted); line-height: 1.6; font-size: 0.9rem; }
.state-panel button, .claim-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 10px 20px; border: 0; border-radius: 8px; color: #fff; background: var(--green-dark); font-weight: 700; text-decoration: none; }
.state-panel button:hover, .claim-button:hover { background: #194b20; }
.terms { margin: 42px 0; }
.term-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 18px 0 24px; }
.term-grid p { margin: 0; }
.term-grid strong, .term-grid span { display: block; }
.term-grid strong { font-size: 0.9rem; color: var(--green-dark); }
.term-grid span { margin-top: 8px; color: var(--muted); font-size: 0.85rem; line-height: 1.6; }
footer { display: flex; justify-content: space-between; gap: 16px; padding: 22px 0 32px; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); }
footer span:first-child { color: var(--green-dark); font-weight: 700; }
@media (max-width: 760px) {
  .site-header { min-height: 62px; padding: 12px 14px; }
  .brand { flex-basis: 154px; }
  .back-link { font-size: 0.72rem; }
  main, footer { width: calc(100% - 24px); }
  main { padding-top: 16px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 24px 18px; }
  .hero h1 { font-size: 2.125rem; }
  .hero-copy > p { font-size: 0.875rem; }
  .prize-grid { gap: 6px; }
  .prize-grid li { gap: 8px; min-height: 46px; padding: 8px; }
  .prize-grid strong { font-size: 0.95rem; }
  .prize-grid li span { flex-basis: 25px; width: 25px; height: 25px; }
  .ranking-shell { padding: 18px 12px; margin-top: 16px; }
  .toolbar { align-items: stretch; flex-direction: column; gap: 16px; }
  .toolbar-actions { width: 100%; }
  .month-picker { flex: 1; min-width: 0; }
  .month-picker select { width: 100%; min-width: 0; }
  .tabs button { flex: 1; padding-inline: 12px; }
  .table-head { display: none; }
  .ranking-list li { grid-template-columns: 36px minmax(0, 1fr) minmax(82px, 0.6fr); gap: 6px 8px; padding: 13px 4px; }
  .rank { grid-row: 1 / span 2; }
  .member { grid-column: 2; }
  .amount { grid-column: 2; text-align: left; font-size: 0.76rem; color: var(--muted); }
  .prize { grid-column: 3; grid-row: 1 / span 2; font-size: 0.88rem; }
  .prize small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 0.65rem; font-weight: 400; }
  .term-grid { grid-template-columns: 1fr; gap: 20px; }
  footer { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
