* { box-sizing: border-box; }
body, h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button, input { background: transparent; border: 0; }
summary { list-style: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#main { display: block; }
:root {
  color-scheme: light;
  --background: #f6f8fd;
  --surface: #fff;
  --surface-soft: #eff4ff;
  --line: #e1e7f1;
  --ink: #111c34;
  --muted: #50617c;
  --brand: #2563eb;
  --accent: #2058d2;
  --soft-blue: #eaf1ff;
  --shadow: 0 5px 24px #152c5809;
  --focus: #427af0;
  --ready: #126047;
  --ready-bg: #e5f7ee;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #0c1220;
  --surface: #131d30;
  --surface-soft: #101a2d;
  --line: #27364e;
  --ink: #edf3ff;
  --muted: #aab9d2;
  --accent: #9cbaff;
  --soft-blue: #1c3054;
  --shadow: 0 5px 24px #0003;
  --focus: #9cbaff;
  --ready: #86e4bd;
  --ready-bg: #19392f;
}

html { background: var(--background); }
body { min-height: 100vh; display: flex; flex-direction: column; margin: 0; background: var(--background); color: var(--ink); font-family: "Inter Variable", Inter, system-ui, sans-serif; line-height: 1.55; }
main { flex: 1; }
a, button, summary, input { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), summary { cursor: pointer; }
:where(a, button, summary, input, [tabindex]):focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
::selection { background: #a8c2ff; color: #111c34; }
.shell { width: min(1184px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 20; top: 12px; left: 12px; transform: translateY(-150%); padding: 10px 16px; background: var(--surface); border-radius: 8px; }
.skip-link:focus { transform: none; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.header-inner { display: flex; min-height: 74px; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; flex: none; font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: -.075em; white-space: nowrap; }
.brand-play { color: var(--accent); }
.brand-mark { margin-right: 10px; display: grid; grid-template-columns: repeat(2, 5px); gap: 3px; justify-content: center; align-content: center; width: 35px; height: 35px; border-radius: 10px; color: white; background: var(--brand); }
.brand-mark i { width: 5px; aspect-ratio: 1; border-radius: 1px; background: currentColor; }
.brand-mark i:last-child { opacity: .58; transform: rotate(24deg); }
.desktop-nav, .header-actions { display: flex; align-items: center; gap: 8px; }
.desktop-nav a, .mobile-nav nav a { padding: 8px 13px; color: var(--muted); font-size: .875rem; font-weight: 650; border-radius: 8px; white-space: nowrap; }
.desktop-nav a:hover, .mobile-nav nav a:hover { color: var(--ink); background: var(--surface-soft); }
.desktop-nav a[aria-current], .mobile-nav nav a[aria-current] { color: var(--accent); background: var(--soft-blue); }
.icon-button { display: inline-flex; min-width: 42px; min-height: 42px; align-items: center; justify-content: center; gap: 7px; padding-inline: 9px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
.icon-button:hover { background: var(--soft-blue); color: var(--accent); }
.icon-button.language { font-weight: 750; font-size: .78rem; }
.mobile-nav { display: none; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav nav { position: absolute; right: 16px; top: calc(100% - 2px); min-width: 184px; display: grid; padding: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.hero-shell { margin-top: 34px; }
.hero { min-height: 448px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; isolation: isolate; position: relative; overflow: hidden; color: #fff; background: radial-gradient(ellipse at 88% 30%, #214d9b, #122950 51%, #101d3a 82%); border: 1px solid #243d6d; border-radius: 26px; }
.hero-copy { padding: 56px 0 56px clamp(28px, 5vw, 66px); z-index: 1; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; color: #b8ceff; font-size: .71rem; font-weight: 750; letter-spacing: .13em; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.9rem, 5.15vw, 4.75rem); font-weight: 800; line-height: 1.015; letter-spacing: -.075em; }
.hero h1 em { color: #8db3ff; font-style: normal; }
.hero-intro { max-width: 415px; color: #c2d0eb; margin-top: 22px; font-size: clamp(.95rem, 1.5vw, 1.08rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 27px; }
.button { display: inline-flex; gap: 9px; min-height: 45px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; padding: 9px 15px; font-size: .875rem; line-height: 1.3; font-weight: 700; transition: background .18s, border-color .18s, transform .18s; }
.button:not(:disabled):active { transform: translateY(1px); }
.button:disabled { opacity: .55; }
.primary { background: var(--brand); color: white; }
.primary:not(:disabled):hover { background: #1d4ed8; }
.hero-secondary { border-color: #5471a4; background: #ffffff0a; color: white; }
.hero-secondary:hover { background: #ffffff16; }
.secondary, .chosen { background: var(--surface); color: var(--ink); border-color: var(--line); }
.secondary:hover, .chosen { color: var(--accent); background: var(--soft-blue); }
.compact { padding-inline: 10px; }
.hero-art { height: 100%; min-height: 360px; position: relative; overflow: visible; }
.hero-grid { position: absolute; inset: 0; opacity: .24; mask-image: radial-gradient(ellipse, #000 15%, transparent 74%); background-image: linear-gradient(#9fbaff55 1px, transparent 1px), linear-gradient(90deg, #9fbaff55 1px, transparent 1px); background-size: 34px 34px; }
.orbit { position: absolute; left: 47%; top: 50%; width: 74%; max-width: 370px; aspect-ratio: 1; border: 1px solid #8bafff4a; border-radius: 50%; transform: translate(-50%, -50%); }
.orbit-inner { width: 56%; max-width: 285px; border-style: dashed; }
.hero-tile { position: absolute; display: grid; place-items: center; width: clamp(52px, 8vw, 104px); aspect-ratio: 1; border: 1px solid #ffffff50; border-radius: 23%; box-shadow: 0 16px 34px #070e3470, inset 0 1px 1px #ffffff38; }
.hero-tile svg { width: 49%; height: 49%; }
.tile-gamepad { width: clamp(110px, 14vw, 190px); left: 44%; top: 48%; transform: translate(-50%, -50%) rotate(-12deg); background: linear-gradient(145deg, #6195ff, #294fc8 72%); color: #fff; z-index: 1; }
.tile-chess { left: 66%; top: 20%; transform: rotate(15deg); background: linear-gradient(145deg, #f4f6ff, #b1c9ff); color: #254cba; }
.tile-dice { top: 62%; left: 63%; transform: rotate(12deg); background: linear-gradient(150deg, #9e8cff, #5941bf); color: #f3eeff; z-index: 1; }
.tile-orbit { width: clamp(44px, 6vw, 78px); top: 63%; left: 14%; transform: rotate(-16deg); background: linear-gradient(145deg, #284e7a, #162947); color: #a6c9ff; }
.hero-star, .hero-plus, .hero-dot { position: absolute; color: #adcaff; }
.hero-star { top: 21%; left: 21%; width: 25px; }
.hero-plus { top: 48%; left: 80%; width: 18px; }
.hero-dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.dot-one { top: 17%; left: 51%; } .dot-two { top: 80%; left: 43%; }
.fact-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 40px; padding: 20px 12px; margin-top: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.fact-strip li { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 650; color: var(--muted); font-size: .82rem; }
.fact-strip svg, .panel-title svg:first-child { color: var(--accent); }
.section-space { margin-top: clamp(50px, 7vw, 88px); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px 25px; margin-bottom: 24px; }
.section-heading h2, .page-heading h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -.067em; font-weight: 800; }
.section-heading p, .page-heading > p:not(.category) { color: var(--muted); margin-top: 8px; }
.text-link { color: var(--accent); display: inline-flex; gap: 8px; align-items: center; font-weight: 750; font-size: .875rem; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.game-grid, .steps { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game-card { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s, border-color .2s; }
.game-card:hover { transform: translateY(-3px); border-color: var(--focus); }
.card-visual { position: relative; }
.game-art {
  position: relative;
  isolation: isolate;
  height: clamp(142px, 16vw, 193px);
  overflow: hidden;
  background: var(--banner-light);
}
.art-werewolf { --banner-light: #1a2c49; }
.art-half-circle { --banner-light: #eee7fa; }
.art-chess { --banner-light: #bcdcd6; }
.art-four-in-a-row { --banner-light: #e5b2bb; }
.art-impostor { --banner-light: #91a6b6; }
.art-badge { position: absolute; top: 12px; right: 12px; display: inline-flex; gap: 6px; align-items: center; border-radius: 99px; padding: 5px 9px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); font-size: .67rem; font-weight: 700; }
.art-badge i { width: 5px; height: 5px; border-radius: 99px; background: var(--accent); }
.card-content { flex: 1; display: flex; flex-direction: column; padding: 18px 19px 15px; }
.category { color: var(--accent); font-size: .73rem; font-weight: 750; }
.card-content h3 { font-size: 1.23rem; font-weight: 790; letter-spacing: -.04em; margin-top: 3px; }
.card-summary { color: var(--muted); font-size: .87rem; padding: 5px 0 14px; flex: 1; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; align-self: stretch; }
.card-bottom > span { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--muted); }
.card-link { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; color: var(--accent); background: var(--soft-blue); }
.card-link:hover { color: white; background: var(--brand); }
.how-section { background: var(--surface-soft); padding-block: clamp(42px, 6vw, 70px); border-top: 1px solid var(--line); }
.step { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.step-icon { width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none; margin-bottom: 12px; color: var(--accent); background: var(--soft-blue); border-radius: 11px; }
.step h3, .spectator h2 { font-weight: 760; font-size: 1.03rem; }
.step p, .spectator p { color: var(--muted); margin-top: 4px; font-size: .91rem; }
.site-footer { padding-block: 26px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: .84rem; }
.footer-inner .brand { color: var(--ink); font-size: 18px; }
.footer-inner .brand-mark { width: 27px; height: 27px; border-radius: 7px; }
.footer-inner p { margin-top: 8px; }
.footer-inner > a:hover { text-decoration: underline; text-underline-offset: 3px; }
.subpage { min-height: 55vh; padding-block: clamp(36px, 6vw, 70px); }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { font-size: clamp(2.4rem, 5.1vw, 4rem); }
.page-heading .pill, .page-heading .category { margin-bottom: 10px; }
.page-heading > p { max-width: 60ch; }
.back-link { margin-bottom: 18px; }
.detail-banner, .detail-grid, .room-grid, .profile-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 18px; }
.detail-banner { align-items: center; margin-bottom: 20px; }
.detail-banner .page-heading { margin: 0; }
.detail-banner .game-art { border-radius: 17px; min-height: 174px; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: clamp(15px, 2.6vw, 27px); box-shadow: var(--shadow); }
.panel-title { display: flex; gap: 8px; align-items: center; margin-bottom: 15px; font-size: 1.15rem; font-weight: 780; letter-spacing: -.025em; }
.panel-title small { color: var(--muted); margin-left: auto; font-size: .85rem; }
.panel p, .muted { color: var(--muted); }
.pill { background: var(--soft-blue); color: var(--accent); width: fit-content; display: inline-block; padding: 4px 8px; border-radius: 99px; font-size: .75rem; font-weight: 750; }
.panel .pill { color: var(--accent); }
.rules { padding-left: 22px; list-style: decimal; color: var(--muted); }
.rules li + li, .privacy-list li + li { margin-top: 11px; }
.rules li::marker { font-weight: 800; color: var(--accent); }
.game-status > p:not(.pill) { margin-top: 10px; }
.game-status .priority { color: var(--ink); font-weight: 700; }
.game-status dl { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 13px; }
.game-status dt { color: var(--muted); font-size: .86rem; }
.game-status dd { display: flex; align-items: center; gap: 8px; font-weight: 740; margin-top: 4px; }
.notice { display: flex; align-items: flex-start; gap: 10px; background: var(--soft-blue); color: var(--accent); border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; margin-bottom: 17px; font-size: .9rem; }
.notice svg { flex: none; margin-top: 1px; }
.room-grid, .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.room-code-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 17px; }
.room-code { width: 8.2ch; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; padding: 4px 9px; font: 750 1.08rem ui-monospace, monospace; letter-spacing: .075em; }
.copy-error { display: block; color: var(--muted); margin: -6px 0 12px; font-size: .85rem; }
.participant-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 8px 0; border-top: 1px solid var(--line); }
.participant-name { flex: 1; min-width: 58px; font-size: .88rem; font-weight: 700; }
.participant-name small { display: block; color: var(--muted); font-size: .72rem; }
.player-state { background: var(--surface-soft); color: var(--muted); border-radius: 99px; padding: 3px 8px; font-size: .73rem; font-weight: 700; }
.player-state.is-ready { background: var(--ready-bg); color: var(--ready); }
.avatar { display: inline-grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 50%; font-size: .8rem; font-weight: 780; }
.avatar-blue { background: #dce8ff; color: #23479b; } .avatar-purple { background: #efe4fd; color: #5e328a; } .avatar-teal { background: #dcf8ef; color: #18634d; } .avatar-amber { background: #ffedcf; color: #805315; }
.avatar-large { width: 76px; height: 76px; font-size: 1.8rem; }
.ready-button { margin-top: 10px; width: 100%; }
.chat-panel { display: flex; flex-direction: column; }
.chat-log { flex: 1; height: 248px; min-height: 218px; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.chat-message { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; font-size: .85rem; overflow-wrap: anywhere; }
.chat-message .avatar { width: 27px; height: 27px; font-size: .68rem; }
.chat-message p { padding-top: 2px; }
.chat-form { display: flex; gap: 8px; margin-top: 12px; }
.chat-form input { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; }
.chat-form input::placeholder { color: var(--muted); }
.chat-form button { min-width: 45px; }
.spectator { display: flex; align-items: flex-start; gap: 12px; margin-top: 17px; }
.spectator .step-icon { margin: 0; }
.profile-grid .spectator { grid-column: 1 / -1; margin-top: 0; }
.profile-card { display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center; padding-block: 27px; }
.profile-card .pill { margin-top: 5px; }
.profile-card h2 { font-size: 1.55rem; font-weight: 800; }
.preferences > p { margin-top: -6px; margin-bottom: 13px; font-size: .9rem; }
.preference-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 7px; border-top: 1px solid var(--line); padding-block: 9px; }
.preference-row h3 { font-weight: 700; font-size: .9rem; }
.language-options { display: flex; flex-wrap: wrap; gap: 6px; }
.privacy-list { list-style: disc; padding-left: 35px; color: var(--muted); }

@media (max-width: 900px) {
  .shell { width: calc(100% - 48px); }
  .desktop-nav { gap: 1px; }
  .desktop-nav a { padding-inline: 8px; }
  .profile-link { display: none; }
  .hero { min-height: 400px; }
  .hero-copy { padding-block: 42px; }
}
@media (max-width: 720px) {
  .shell { width: calc(100% - 36px); }
  .header-inner { min-height: 62px; gap: 6px; }
  .desktop-nav { display: none; }
  .mobile-nav { display: block; }
  .hero-shell { margin-top: 20px; }
  .hero { grid-template-columns: 1fr; border-radius: 20px; }
  .hero-copy { padding: 31px 24px 0; }
  .hero-art { min-height: 240px; width: min(100%, 425px); justify-self: center; }
  .orbit { max-width: 224px; }
  .orbit-inner { max-width: 164px; }
  .tile-gamepad { width: 120px; }
  .tile-chess, .tile-dice { width: 61px; }
  .tile-orbit { left: 20%; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .fact-strip { gap: 9px 17px; padding: 11px 8px; }
  .fact-strip li { font-size: .75rem; }
  .fact-strip svg { width: 15px; }
  .steps { gap: 10px; }
  .step { padding: 15px; }
  .detail-grid, .room-grid, .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .header-actions { gap: 5px; }
  .brand { font-size: 19px; }
  .brand-mark { width: 29px; height: 29px; margin-right: 6px; border-radius: 8px; }
  .icon-button { min-width: 36px; min-height: 41px; padding-inline: 7px; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.7rem); }
  .hero-copy { padding-inline: 17px; }
  .hero-intro { margin-top: 15px; }
  .hero-actions { margin-top: 17px; gap: 8px; }
  .hero-actions .button { min-height: 41px; font-size: .78rem; padding-inline: 10px; }
  .hero-art { min-height: 212px; }
  .tile-gamepad { width: 104px; }
  .tile-chess, .tile-dice { width: 54px; }
  .orbit { max-width: 188px; }
  .orbit-inner { max-width: 143px; }
  .section-heading { align-items: start; flex-direction: column; }
  .game-grid, .steps, .detail-banner { grid-template-columns: 1fr; }
  .game-art { height: 153px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.mark { display: inline-grid; place-items: center; flex: none; width: 1em; line-height: 1; text-align: center; font-family: system-ui, sans-serif; }
.hero-tile .mark { width: auto; font-size: clamp(1.7rem, 4vw, 3.25rem); }
.tile-gamepad .mark { font-size: clamp(2.4rem, 6vw, 4.5rem); }
.hero-star, .hero-plus { font-size: 1.6rem; }
.notice .mark, .panel-title .mark, .fact-strip .mark { color: var(--accent); }
.game-banner-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
:root[data-theme="dark"] .game-banner-image { filter: brightness(.86); }
.game-logo {
  position: absolute;
  left: 13px;
  bottom: 13px;
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px #090f2b26);
}
.detail-banner .game-logo { width: 48px; height: 48px; }
.live-panel { display: grid; align-content: start; gap: 12px; }
.live-panel + .live-panel { margin-top: 16px; }
.room-grid > .live-panel { margin-top: 0; }
.live-panel h2 { font-size: 1.18rem; }
.live-panel label, .live-form label { font-weight: 650; }
.live-form { display: grid; justify-items: start; gap: 8px; }
.live-form input, .live-form select, .live-panel > input {
  padding: 10px 12px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.live-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.live-actions [aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.live-status { color: var(--muted); font-size: .9rem; margin: 6px 0; }
.live-status:empty { display: none; }
.live-panel .participant-list small { display: block; font-weight: 400; color: var(--muted); }
.chat-log { flex: none; }
.copy-status { min-height: 1.4em; margin-bottom: 8px; font-size: .85rem; }
[hidden] { display: none !important; }
.role-panel { margin-top: 18px; }
.role-panel > p { margin-bottom: 17px; }
.role-groups { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
.role-groups h3 { color: var(--accent); font-size: .87rem; margin-bottom: 8px; }
.role-groups dl > div { border-top: 1px solid var(--line); padding: 9px 0; }
.role-groups dt { font-weight: 750; }
.role-groups dd { color: var(--muted); font-size: .9rem; }
@media (max-width: 640px) {
  .role-groups { grid-template-columns: 1fr; }
}
