:root {
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  color: #2b2038;
  background: #f9f5f4;
  --paper: #fffcf8;
  --ink: #2b2038;
  --ink-soft: #61566b;
  --accent: #4c2f73;
  --line: #ded3e5;
  --site-width: 1120px;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 100% 0%, #efe3fb 0, transparent 58rem), radial-gradient(ellipse at 0 0, #f7e9dc 0, transparent 44rem); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #61418a; outline-offset: 3px; }
a { color: var(--accent); text-underline-offset: 3px; }
button { font: inherit; }
.wrap { width: min(var(--site-width), 100% - clamp(24px, 6vw, 72px)); margin-inline: auto; }
.skip { position: absolute; top: 0; left: 12px; z-index: 3; padding: 12px; background: white; transform: translateY(-120%); }
.skip:focus { transform: translateY(0); }
.masthead { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 6px; min-height: 62px; border-bottom: 1px solid var(--line); }
.masthead > .wordmark { justify-self: start; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 760; color: var(--ink); text-decoration: none; }
.wordmark img { border-radius: 7px; flex: 0 0 auto; }
.header-actions { display: flex; justify-content: end; gap: clamp(4px, .8vw, 10px); }
.header-actions .button { white-space: nowrap; }
.header-rank-copy { display: grid; gap: 1px; line-height: 1.05; text-align: center; }
.header-rank-badge { font-size: .7rem; font-variant-numeric: tabular-nums; }
.open-link:hover { text-decoration: underline; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 44px; border: 1px solid #cdbed8; border-radius: 10px; background: var(--paper); color: var(--accent); padding: 6px 12px; text-decoration: none; font-size: .86rem; font-weight: 700; cursor: pointer; }
.button:hover { background: #efe5f7; }
.action-icon { flex: 0 0 auto; width: 18px; height: 18px; }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: #3e255f; }
.button.ranking-action, .button.header-rank-link { background: #126252; border-color: #126252; color: #fff; }
.button.ranking-action:hover, .button.header-rank-link:hover, .header-rank-link[aria-current="page"] { background: #0d5144; border-color: #0d5144; color: #fff; }
.ranking-action .action-icon, .header-rank-link .action-icon { color: #ffe3a0; }
.hero { padding-top: clamp(12px, 2.8vw, 28px); }
h1, h2, h3 { font-family: "Instrument Serif", Georgia, serif; line-height: 1.12; font-weight: 500; letter-spacing: -.035em; text-wrap: balance; }
h1 { margin: 0 0 5px; font-size: clamp(2rem, 4.6vw, 3.55rem); }
.hero h1 { font-size: clamp(2rem, 4.1vw, 3rem); }
.hero p { margin: 0 0 12px; }
p, figcaption { color: var(--ink-soft); line-height: 1.66; text-align: justify; text-align-last: start; overflow-wrap: anywhere; }
.game-shell { border: 1px solid var(--line); border-radius: 18px; background: #fffcf8; }
.frame-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.session-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; min-width: 0; }
.session-links a { padding-inline: 8px; border-color: transparent; }
.session-links a[aria-current] { background: #efe5f7; }
.game-shell iframe { display: block; width: 100%; height: auto; aspect-ratio: 16/9; border: 0; border-radius: 0 0 17px 17px; background: #f7f3f4; }
body:has(.game-shell.expanded) { overflow: hidden; }
.game-shell.expanded { position: fixed; inset: 0; z-index: 5; display: grid; grid-template-rows: auto minmax(0,1fr); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); border-radius: 0; }
.game-shell.expanded iframe { height: 100%; aspect-ratio: auto; border-radius: 0; }
.open-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; }
.site-scores { margin: 9px 0 0; color: var(--accent); font-size: .88rem; font-weight: 700; }
.score-links { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 10px; }
.score-links .site-scores { margin: 0; }
.rank-card { padding: clamp(12px,3vw,24px); border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
#leaderboard-sync:empty { display: none; }
.action-group { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-rows: 1fr; align-items: stretch; gap: 12px; width: min(100%, 25rem); margin-block: 18px; }
.action-group .button { min-width: 0; min-height: 48px; text-align: center; line-height: 1.2; }
.rank-actions { margin-bottom: 0; }
.rank-heading { margin-top: 30px !important; }
.rank-table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
.rank-table :is(th,td) { padding: 11px 8px; border-bottom: 1px solid var(--line); }
.rank-table :is(th,td):last-child { text-align: right; }
.rank-table tr[data-you] { background: #eee6f9; font-weight: 700; }
.mode-guide { padding-inline-start: 1.25rem; }
.mode-guide li { margin-block: 8px; line-height: 1.55; text-align: justify; text-align-last: start; }
.editorial { width: min(100%, 850px); margin-inline: auto; padding-top: 16px; }
.guide-content, .info { margin-block: clamp(26px, 5vw, 50px); }
.guide-content { scroll-margin-top: 15px; }
.guide-content + .guide-content { border-top: 1px solid var(--line); padding-top: 24px; }
.guide-content h2, .info h2 { font-size: clamp(1.8rem, 3.8vw, 2.7rem); margin: 0 0 12px; }
.guide-content h3 { font-size: 1.55rem; margin: 24px 0 8px; }
.guide-content p, .info p { margin: 0 0 16px; }
.guide-content figure { margin: 20px 0 24px; }
figure img { display: block; width: 100%; height: auto; border-radius: 13px; border: 1px solid var(--line); background: #eee4f4; }
figure.detail-figure img { max-width: 460px; }
figcaption { margin-top: 8px; font-size: .87rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { min-height: 44px; padding-block: 12px; font-weight: 650; cursor: pointer; }
footer { margin-top: 52px; border-top: 1px solid var(--line); background: #efe8f3; }
.footer-grid { padding: 34px 0 24px; display: grid; grid-template-columns: 1fr 2fr; gap: 38px; }
.footer-grid nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; }
.footer-grid h2 { font-family: inherit; font-weight: 700; font-size: .9rem; letter-spacing: normal; margin: 0 0 12px; }
.footer-grid p { margin: 0; }
.footer-grid nav a { display: flex; align-items: center; min-height: 44px; text-decoration: none; }
.footer-grid nav a:hover { text-decoration: underline; }
.copyright { border-top: 1px solid var(--line); padding: 15px 0; font-size: .86rem; color: var(--ink-soft); }
dialog { width: min(440px, calc(100% - 24px)); padding: 20px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #241b3b66; }
dialog h2 { margin-top: 0; }
.dialog-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
#site-link { width: 100%; min-height: 44px; margin-top: 10px; font: inherit; }
@media(max-width:900px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }
@media(max-width:760px) {
  .header-actions .header-guide { display: none; }
  .header-actions .header-play { min-width: 44px; padding-inline: 0; }
  .header-play > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media(max-width:520px) {
  .wrap { width: calc(100% - 20px); }
  .masthead { min-height: 50px; }
  .header-actions { gap: 3px; }
  .header-actions [data-install] { min-width: 44px; padding-inline: 0; }
  .header-actions [data-install] > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .masthead .header-rank-link { padding-inline: 6px; gap: 4px; font-size: .75rem; }
  .masthead .header-rank-link .action-icon { width: 16px; height: 16px; }
  .wordmark { font-size: .88rem; }
  .wordmark img { width: 24px; height: 24px; }
  .frame-tools { padding-inline: 4px; }
  .frame-tools .button { font-size: .77rem; padding-inline: 6px; }
  .frame-tools .action-icon { width: 14px; height: 14px; }
  .footer-grid nav { grid-template-columns: 1fr; gap: 20px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .masthead { min-height: 49px; }
  .hero { padding-top: 8px; }
  .hero h1 { font-size: clamp(1.9rem, 4.2vw, 2.25rem); }
  .hero p { margin-bottom: 6px; }
  .game-shell:not(.expanded) { width: min(100%, max(300px, calc((100svh - 158px) * 16 / 9))); margin-inline: auto; }
}
