:root {
  color-scheme: light;
  --paper: #f6f1e7;
  --paper-deep: #ede5d6;
  --ink: #3d3b32;
  --muted: #767166;
  --moss: #5f7359;
  --moss-dark: #485b45;
  --clay: #b46f50;
  --line: rgba(76, 70, 57, 0.19);
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", STSong, Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 12% 3%, rgba(180, 111, 80, 0.09), transparent 28rem),
    radial-gradient(circle at 95% 16%, rgba(95, 115, 89, 0.10), transparent 29rem),
    var(--paper);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

button { font: inherit; }

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

.intro { max-width: 760px; margin: 0 auto 36px; text-align: center; }

.eyebrow {
  margin-bottom: 28px;
  color: #666760;
  font-family: var(--serif);
  font-size: clamp(1.08rem, 2.25vw, 1.55rem);
  letter-spacing: 0.035em;
}

.home-link {
  display: inline-block;
  padding: 4px 2px;
  color: inherit;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.home-link:hover,
.home-link:focus-visible {
  color: var(--moss-dark);
  text-decoration-color: currentColor;
}

.home-link:focus-visible {
  border-radius: 3px;
  outline: 2px solid rgba(72, 91, 69, 0.32);
  outline-offset: 3px;
}

h1 {
  margin: 0;
  color: var(--moss-dark);
  font-family: var(--serif);
  font-size: clamp(2.15rem, 5vw, 4rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.18;
}

.intro-copy {
  margin: 18px auto 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.8;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding: 14px 2px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.progress { margin: 0; color: var(--muted); font-size: 0.9rem; }
.progress strong { color: var(--clay); font-family: var(--serif); font-size: 1.18rem; font-weight: 600; }
.actions { display: flex; gap: 8px; }

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--moss-dark);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.text-button:hover { background: rgba(95, 115, 89, 0.09); }
.text-button[aria-pressed="true"] { color: #f8f5ec; background: var(--moss-dark); }
.text-button[aria-pressed="true"]:hover { background: #394b38; }
.text-button:focus-visible, .close-button:focus-visible, .done-button:focus-visible, .skip-button:focus-visible, .blind-card:focus-visible {
  outline: 3px solid rgba(95, 115, 89, 0.34);
  outline-offset: 3px;
}

.text-button svg, .close-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-button rect, .text-button circle { fill: none; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 15px;
  perspective: 900px;
}

.blind-card {
  position: relative;
  aspect-ratio: 4 / 4.7;
  min-height: 132px;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255,255,255,.25), transparent 48%),
    #eae1d1;
  border: 1px solid rgba(91, 82, 64, 0.22);
  border-radius: 16px;
  box-shadow: 0 5px 18px rgba(76, 60, 41, 0.06);
  cursor: pointer;
  transform: translateY(0) rotate(0);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.blind-card::before,
.blind-card::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(95, 115, 89, 0.18);
  border-radius: 50%;
}

.blind-card::before { width: 74%; height: 74%; left: -38%; bottom: -42%; }
.blind-card::after { width: 52%; height: 52%; right: -27%; top: -31%; }
.blind-card:nth-child(3n + 2) { background-color: #e5e7d9; }
.blind-card:nth-child(3n) { background-color: #eee0d8; }

.blind-card:hover {
  z-index: 1;
  border-color: rgba(72, 91, 69, 0.42);
  box-shadow: 0 12px 26px rgba(76, 60, 41, 0.11);
  transform: translateY(-5px) rotate(-0.4deg);
}

.card-number {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--serif);
  font-size: clamp(2rem, 3.3vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.card-number::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  margin-top: 3.35em;
  border-radius: 50%;
  background: var(--moss);
  opacity: 0.55;
}

.blind-card.opened {
  color: #f7f4eb;
  background: var(--moss);
  border-color: var(--moss-dark);
  box-shadow: none;
}

.blind-card.opened::before, .blind-card.opened::after { border-color: rgba(255,255,255,.17); }
.blind-card.opened .card-number::after { background: #f7f4eb; opacity: 0.76; }

.opened-mark {
  position: absolute;
  right: 11px;
  top: 10px;
  z-index: 2;
  display: none;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  font-size: 0.72rem;
}

.blind-card.opened .opened-mark { display: grid; }

.site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 12px 12px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.9;
}

.closing-note { margin: 0; text-align: center; }

.about-project {
  margin-top: 56px;
  padding: 42px 46px 38px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.about-project h2 {
  margin: 0 0 28px;
  color: var(--moss-dark);
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 600;
}

.about-project p { margin: 0 0 16px; }
.about-project .author-signoff { margin: 26px 0 0; text-align: right; }

.copyright-note {
  margin-top: 30px;
  padding-top: 24px;
  text-align: center;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.7;
}

.copyright-note p { margin: 3px 0; }

dialog {
  width: min(620px, calc(100% - 28px));
  max-width: none;
  padding: 0;
  overflow: visible;
  color: var(--ink);
  background: transparent;
  border: 0;
}

dialog::backdrop { background: rgba(40, 43, 35, 0.62); backdrop-filter: blur(5px); }
dialog[open] { animation: dialog-in 260ms ease-out; }

.dialog-card {
  position: relative;
  min-height: 430px;
  padding: 62px 58px 54px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% -10%, rgba(255,255,255,.72), transparent 54%),
    #f4eddf;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(30, 32, 27, 0.32);
}

.dialog-card::before, .dialog-card::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(95,115,89,.15);
  border-radius: 50%;
}
.dialog-card::before { left: -170px; top: -90px; }
.dialog-card::after { right: -160px; bottom: -115px; }

.close-button {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--muted);
  background: rgba(255,255,255,.28);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.close-button:hover { color: var(--ink); background: rgba(255,255,255,.62); }

.dialog-ornament { width: 90px; height: 52px; margin-bottom: 24px; color: var(--moss); opacity: .75; }
.dialog-ornament svg { width: 100%; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.dialog-label { margin: 0 0 22px; color: var(--clay); font-size: 0.82rem; letter-spacing: 0.17em; }

.dialog-question {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 4.5vw, 2.15rem);
  line-height: 1.65;
  text-wrap: balance;
}

.dialog-question.long-question {
  font-size: clamp(1.35rem, 3.8vw, 1.85rem);
  line-height: 1.58;
}

.dialog-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
}

.done-button {
  position: relative;
  min-height: 48px;
  padding: 11px 24px;
  color: #f8f5ec;
  background: var(--moss-dark);
  border: 1px solid var(--moss-dark);
  border-radius: 999px;
  cursor: pointer;
}
.done-button:hover { background: #394b38; }

.skip-button {
  min-height: 40px;
  padding: 7px 18px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.skip-button:hover { color: var(--ink); background: rgba(95, 115, 89, 0.08); }
.skip-button[hidden] { display: none; }

.dialog-credit {
  position: relative;
  z-index: 1;
  margin: 30px 0 -16px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.035em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  padding: 10px 16px;
  color: #fff;
  background: rgba(61,59,50,.92);
  border-radius: 999px;
  font-size: .88rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(.97) rotateX(5deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotateX(0); }
}

@media (min-width: 861px) {
  html.roundtable-active .page-shell { padding-top: 24px; }
  html.roundtable-active .intro { margin-bottom: 18px; }
  html.roundtable-active .eyebrow { margin-bottom: 12px; font-size: 1.05rem; }
  html.roundtable-active h1 { font-size: 2.7rem; }
  html.roundtable-active .intro-copy { margin-top: 7px; font-size: 1rem; }
  html.roundtable-active .toolbar { margin-top: 16px; padding-block: 8px; }

  .card-grid.roundtable {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 9px;
  }

  .card-grid.roundtable .blind-card {
    min-height: 0;
    aspect-ratio: 1 / 1.06;
    border-radius: 12px;
  }

  .card-grid.roundtable .card-number { font-size: clamp(1.65rem, 2.5vw, 2.3rem); }
  .card-grid.roundtable .card-number::after { width: 4px; height: 4px; }
  .card-grid.roundtable .opened-mark { right: 7px; top: 7px; width: 18px; height: 18px; font-size: 0.62rem; }
}

@media (max-width: 860px) {
  .roundtable-button { display: none; }
  .card-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
  .page-shell { padding-top: 46px; }
}

@media (max-width: 600px) {
  .page-shell { width: min(100% - 24px, 480px); padding-top: 32px; }
  .intro { margin-bottom: 24px; }
  .eyebrow { margin-bottom: 19px; }
  .intro-copy { max-width: 310px; }
  .toolbar { display: block; margin-top: 27px; }
  .progress { margin: 0 0 4px 7px; text-align: left; }
  .actions { justify-content: space-between; gap: 0; }
  .text-button { padding: 8px 7px; font-size: .84rem; }
  .text-button svg { width: 16px; height: 16px; }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .blind-card { min-height: 112px; border-radius: 13px; }
  .card-number { font-size: clamp(2rem, 11vw, 2.8rem); }
  dialog { max-height: calc(100dvh - 20px); }
  .dialog-card { min-height: 0; height: auto; max-height: calc(100dvh - 28px); padding: 50px 26px 34px; overflow-y: auto; scrollbar-width: none; border-radius: 20px; }
  .dialog-card::-webkit-scrollbar { display: none; }
  .dialog-question { font-size: clamp(1.48rem, 7vw, 1.9rem); line-height: 1.62; }
  .dialog-question.long-question { font-size: clamp(1.23rem, 5.8vw, 1.55rem); line-height: 1.55; }
  .dialog-actions { margin-top: 30px; gap: 8px; }
  .dialog-credit { margin-top: 25px; font-size: 0.7rem; }
  .site-footer { padding-inline: 0; }
  .about-project { margin-top: 42px; padding: 30px 24px 26px; border-radius: 16px; }
  .about-project h2 { margin-bottom: 22px; }
  .copyright-note { padding-inline: 12px; }
}

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