:root {
  color-scheme:dark;
  --bg:#101310;
  --panel:#191d18;
  --line:#343c31;
  --text:#f1f3e9;
  --muted:#a7b09f;
  --accent:#c5f277;
  --ink:#17210c;
  font-family:Inter,"Segoe UI",Arial,sans-serif;
  font-synthesis:none;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

a {
  color:inherit;
  text-decoration:none;
}

button {
  font:inherit;
  cursor:pointer;
}

button:disabled {
  opacity:.5;
  cursor:default;
}

button,a {
  -webkit-tap-highlight-color:transparent;
}

button:focus-visible,a:focus-visible {
  outline:3px solid var(--accent);
  outline-offset:5px;
}

h1,h2,h3,p {
  margin:0;
}

h1,h2,h3 {
  font-weight:600;
  letter-spacing:-.045em;
}

button {
  color:inherit;
}

::selection {
  background:var(--accent);
  color:var(--ink);
}

.accent,.brand-period {
  color:var(--accent);
}

.site-header {
  border-bottom:1px solid var(--line);
}

.header-inner {
  max-width:1280px;
  margin:auto;
  min-height:76px;
  padding:0 48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}

.brand {
  font-size:32px;
  font-weight:750;
  letter-spacing:-1.6px;
  display:inline-flex;
  align-items:center;
}

.brand-mark {
  width:10px;
  height:10px;
  background:var(--accent);
  margin-right:12px;
  box-shadow:0 0 0 4px #c5f27712;
}

.brand-period {
  margin-left:1px;
}

nav {
  display:flex;
  align-items:center;
  gap:36px;
}

.nav-link {
  padding:12px 0;
  background:none;
  border:0;
  color:var(--muted);
  font-size:14px;
  font-weight:500;
}

.nav-link:hover,.nav-link.current {
  color:var(--text);
}

.nav-link.current {
  box-shadow:0 2px 0 var(--accent);
}

.nav-link span {
  color:var(--accent);
  margin-left:7px;
}

.library,.player {
  width:100%;
  max-width:1280px;
  margin:0 auto;
  padding:30px 48px 0;
  flex:1;
}

.collection-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:24px;
  margin-bottom:24px;
}

.eyebrow {
  font:11px/1.4 Consolas,"Courier New",monospace;
  letter-spacing:2px;
  color:var(--muted);
  margin-bottom:14px;
}

h1 {
  font-size:clamp(30px,3.4vw,42px);
  line-height:1.15;
}

.intro {
  color:var(--muted);
  font-size:16px;
  line-height:1.6;
  margin-top:10px;
}

.collection-count {
  font:12px Consolas,"Courier New",monospace;
  color:var(--muted);
  letter-spacing:1px;
  white-space:nowrap;
  border:1px solid var(--line);
  padding:11px 15px;
  border-radius:4px;
}

.collection-bar {
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:26px;
  gap:15px;
}

.collection-tab {
  font-size:14px;
  font-weight:600;
  padding:0 0 16px;
  border-bottom:2px solid var(--accent);
  margin-bottom:-1px;
}

.collection-tab span {
  font:11px Consolas,monospace;
  background:#2b3424;
  color:var(--accent);
  padding:3px 6px;
  border-radius:3px;
  margin-left:8px;
}

.keyboard-note {
  font-size:12px;
  color:var(--muted);
  padding-bottom:16px;
}

.keyboard-note span {
  margin-left:8px;
}

.game-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:26px;
}

.game-card {
  border:1px solid var(--line);
  border-radius:10px;
  overflow:hidden;
  background:var(--panel);
  transition:border-color .18s,transform .18s;
}

.game-card:hover {
  border-color:#76876b;
  transform:translateY(-3px);
}

.card-image-link {
  display:block;
  background:#050605;
  position:relative;
  border-bottom:1px solid var(--line);
}

.card-image-link img {
  width:100%;
  height:190px;
  object-fit:contain;
  display:block;
  padding:14px 34px;
}

.image-index {
  position:absolute;
  top:17px;
  left:18px;
  color:#a4b094;
  font:10px Consolas,monospace;
  letter-spacing:1px;
}

.image-play {
  position:absolute;
  bottom:18px;
  right:18px;
  width:36px;
  height:36px;
  border-radius:50%;
  border:1px solid #555e4d;
  background:#151b12d9;
  display:grid;
  place-items:center;
  color:var(--accent);
  font-size:12px;
  padding-left:2px;
}

.card-content {
  padding:22px;
}

.card-meta {
  font:11px Consolas,monospace;
  letter-spacing:1.2px;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:12px;
  display:flex;
  justify-content:space-between;
  gap:12px;
}

.card-content h2 {
  font-size:29px;
  line-height:1.2;
}

.card-description {
  font-size:14px;
  color:var(--muted);
  line-height:1.65;
  margin-top:11px;
  max-width:390px;
  min-height:47px;
}

.card-tags {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:15px 0 20px;
  font-size:11px;
  color:#bdc5b6;
}

.card-tags span+span:before {
  content:"·";
  color:#67725f;
  margin-right:8px;
}

.card-actions {
  display:flex;
  gap:12px;
}

.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:44px;
  border:1px solid var(--accent);
  border-radius:5px;
  padding:11px 21px;
  background:var(--accent);
  color:var(--ink);
  font-weight:650;
  font-size:13px;
  transition:background .15s;
}

.button:hover {
  background:#d6ffa0;
}

.button.secondary {
  background:transparent;
  border-color:#4d5845;
  color:var(--text);
}

.button.secondary:hover {
  background:#283022;
}

.card-actions .button:first-child {
  flex:1;
  justify-content:space-between;
}

.card-actions .secondary {
  flex:0 0 auto;
}

.library-note {
  display:flex;
  align-items:center;
  gap:20px;
  padding:29px 0;
  margin-top:23px;
  border-bottom:1px solid var(--line);
}

.note-symbol {
  font-size:29px;
  color:var(--accent);
}

.library-note strong {
  font-size:14px;
  font-weight:550;
}

.library-note p {
  color:var(--muted);
  font-size:13px;
  margin-top:6px;
  line-height:1.5;
}

.note-detail {
  margin-left:auto;
  color:#9aa68f;
  font:10px Consolas,monospace;
  letter-spacing:1.3px;
  text-align:right;
}

.site-footer {
  display:flex;
  justify-content:space-between;
  gap:20px;
  padding:29px 48px 34px;
  margin:0 auto;
  width:100%;
  max-width:1280px;
  color:var(--muted);
  font-size:11px;
  line-height:1.6;
}

.footer-divider {
  margin:0 12px;
  color:#64735a;
}

.site-footer>a:hover {
  color:var(--accent);
}

.skip-link {
  position:absolute;
  top:8px;
  left:8px;
  transform:translateY(-150%);
  z-index:10;
  background:var(--accent);
  padding:12px;
  color:var(--ink);
}

.skip-link:focus {
  transform:none;
}

.loading-text {
  color:var(--muted);
  padding:40px 24px;
  line-height:1.6;
}

.player {
  padding-top:30px;
}

.player-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  margin-bottom:23px;
}

.player h1 {
  font-size:32px;
}

.player .eyebrow {
  margin-bottom:7px;
}

.player-actions {
  display:flex;
  gap:10px;
  flex-shrink:0;
}

.game-stage {
  background:#000;
  border:1px solid var(--line);
  border-radius:8px;
  overflow:hidden;
  height:min(68vh,740px);
  height:min(68dvh,740px);
  min-height:190px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.game-stage iframe {
  width:100%;
  height:100%;
  border:0;
  display:block;
  background:#000;
}

.game-stage iframe:fullscreen {
  width:100vw;
  height:100vh;
  border-radius:0;
  background:#000;
}

.player-caption {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  padding:17px 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.8;
}

.player-caption>span {
  white-space:nowrap;
}

.caption-divider {
  padding:0 10px;
}

kbd {
  display:inline-block;
  padding:2px 7px;
  border:1px solid #4a5442;
  border-bottom-width:2px;
  border-radius:4px;
  font:11px/1.4 Consolas,monospace;
  background:#242b20;
  color:#e0e6d8;
  white-space:nowrap;
}

.mobile-note {
  display:none;
  font-size:12px;
  color:var(--muted);
  line-height:1.6;
  margin-bottom:15px;
}

.player-message {
  color:var(--muted);
  font-size:13px;
  margin-bottom:10px;
}

.player-message:empty {
  display:none;
}

dialog {
  border:1px solid #59674d;
  border-radius:12px;
  width:calc(100% - 32px);
  max-width:520px;
  padding:28px;
  background:var(--panel);
  color:var(--text);
  box-shadow:0 24px 100px #0009;
  max-height:calc(100dvh - 32px);
  overflow:auto;
}

dialog::backdrop {
  background:#060a06cc;
  backdrop-filter:blur(4px);
}

.dialog-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:15px;
}

.dialog-top .eyebrow {
  margin:0;
}

.icon-button {
  width:38px;
  height:38px;
  border:1px solid var(--line);
  border-radius:50%;
  background:transparent;
  font-size:25px;
  line-height:1;
}

.icon-button:hover {
  background:#303929;
}

dialog h2 {
  font-size:30px;
  margin-bottom:18px;
}

dialog p {
  font-size:14px;
  line-height:1.65;
  color:var(--muted);
}

.controls-list {
  margin:8px 0 21px;
}

.control-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border-bottom:1px solid var(--line);
  padding:12px 0;
  font-size:13px;
}

.control-row dd {
  display:flex;
  gap:5px;
  margin:0;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.control-row dt {
  max-width:57%;
  line-height:1.5;
}

.dialog-actions {
  margin-top:24px;
  display:flex;
  gap:12px;
}

.dialog-actions .button {
  flex:1;
}

.about-copy p+p {
  margin-top:14px;
}

.error-panel {
  grid-column:1/-1;
  padding:32px;
  border:1px solid var(--line);
  border-radius:8px;
}

.error-panel h2 {
  font-size:24px;
  margin-bottom:12px;
}

.error-panel p {
  line-height:1.6;
  margin-bottom:22px;
  color:var(--muted);
}

@media(min-width:1500px) {
  .card-image-link img {
    height:260px;
  }
}

@media(max-width:800px) {
  .header-inner {
    padding:0 24px;
    min-height:80px;
  }
  nav {
    gap:23px;
  }
  .library,.player {
    padding-left:24px;
    padding-right:24px;
  }
  .library {
    padding-top:37px;
  }
  .collection-heading {
    margin-bottom:30px;
  }
  .collection-count {
    display:none;
  }
  .game-grid {
    gap:18px;
  }
  .card-content {
    padding:20px;
  }
  .card-image-link img {
    height:210px;
    padding:10px 22px;
  }
  .card-meta {
    font-size:10px;
    letter-spacing:.6px;
  }
  .card-content h2 {
    font-size:25px;
  }
  .card-description {
    min-height:70px;
  }
  .card-actions {
    gap:8px;
  }
  .card-actions .button {
    padding-left:13px;
    padding-right:13px;
  }
  .note-detail {
    display:none;
  }
  .site-footer {
    padding-left:24px;
    padding-right:24px;
  }
  .player-caption {
    align-items:flex-start;
    flex-direction:column;
    gap:6px;
  }
  .player h1 {
    font-size:27px;
  }
  .game-stage {
    height:60dvh;
  }
}

@media(max-width:560px) {
  .header-inner {
    padding:0 20px;
    min-height:74px;
  }
  .brand {
    font-size:28px;
  }
  .brand-mark {
    width:8px;
    height:8px;
    margin-right:9px;
  }
  .nav-link {
    font-size:12px;
  }
  nav {
    gap:19px;
  }
  body[data-page="library"] nav .current {
    display:none;
  }
  .library,.player {
    padding-left:20px;
    padding-right:20px;
  }
  .library {
    padding-top:30px;
  }
  h1 {
    font-size:33px;
    max-width:330px;
  }
  .eyebrow {
    font-size:10px;
  }
  .intro {
    font-size:14px;
  }
  .keyboard-note {
    font-size:11px;
  }
  .game-grid {
    grid-template-columns:1fr;
    gap:23px;
  }
  .card-image-link img {
    height:248px;
  }
  .card-content {
    padding:23px;
  }
  .card-content h2 {
    font-size:28px;
  }
  .card-meta {
    font-size:11px;
  }
  .card-description {
    min-height:0;
  }
  .library-note {
    margin-top:10px;
    gap:14px;
  }
  .site-footer {
    padding:24px 20px;
    flex-direction:column;
    gap:8px;
  }
  .player-heading {
    align-items:flex-start;
    flex-direction:column;
    gap:17px;
  }
  .player-actions {
    width:100%;
  }
  .player-actions .button {
    flex:1;
  }
  .mobile-note {
    display:block;
  }
  .game-stage {
    height:auto;
    aspect-ratio:4/3;
    min-height:0;
  }
  .player-caption {
    font-size:11px;
  }
  .player-message {
    font-size:12px;
  }
  dialog {
    padding:22px;
  }
  .control-row {
    font-size:12px;
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important;
    scroll-behavior:auto!important;
  }
  .game-card:hover {
    transform:none;
  }
}

.fullscreen-exit {
  display:none;
}

.game-stage:fullscreen {
  position:relative;
  width:100vw;
  height:100vh;
  max-height:none;
  min-height:0;
  border:0;
  border-radius:0;
  aspect-ratio:auto;
}

.game-stage:fullscreen .fullscreen-exit {
  display:inline-flex;
  position:absolute;
  top:12px;
  right:12px;
  z-index:2;
  background:#192016e8;
}


/* Larger game images within a shorter card: metadata moves onto the image. */
.card-image-link img {height:260px;padding:25px 8px 5px;}
.card-image-link .card-meta {position:absolute;left:15px;right:15px;top:13px;margin:0;font-size:10px;}
.image-index {display:none;}
.image-play {width:32px;height:32px;bottom:12px;right:12px;}
.card-content {padding:16px;}
.card-content h2 {font-size:25px;}
.card-description {font-size:13px;line-height:1.45;margin-top:7px;min-height:38px;max-width:none;}
.card-actions {margin-top:13px;gap:8px;}
.card-actions .button {min-height:42px;padding:9px 15px;}
.card-actions .scores-button {padding:8px;width:44px;font-size:24px;color:var(--accent);}
.recent-section {margin:32px 0 5px;}
.section-heading {display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:18px;}
.section-heading h2 {font-size:25px;}
.section-heading .eyebrow {margin-bottom:6px;}
.text-link,.text-button {color:var(--accent);font-size:13px;line-height:1.5;}
.text-link:hover,.text-button:hover {text-decoration:underline;}
.text-button {border:0;background:none;padding:10px 0;cursor:pointer;}
.empty-recent {padding:23px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);font-size:14px;color:var(--muted);line-height:1.6;}
.recent-entry {display:flex;gap:18px;align-items:center;padding:16px 0;border-top:1px solid var(--line);}
.recent-entry:hover {background:#ffffff04;}
.record-badge {font:10px Consolas,monospace;letter-spacing:1px;color:var(--accent);min-width:100px;}
.recent-details {display:flex;flex-direction:column;gap:4px;}
.recent-details strong {font:15px Consolas,monospace;letter-spacing:1px;}
.recent-details span,.recent-time {font-size:11px;color:var(--muted);}
.recent-score {margin-left:auto;font:20px Consolas,monospace;}
.board-tabs {border-bottom:1px solid var(--line);gap:25px;margin-bottom:24px;}
.board-tab {padding:13px 0;color:var(--muted);font-size:14px;}
.board-tab.current {color:var(--accent);border-bottom:2px solid var(--accent);}
.scoreboard {border:1px solid var(--line);border-radius:10px;background:var(--panel);max-width:850px;margin:0 auto;overflow:hidden;}
.scoreboard-heading {display:flex;align-items:center;justify-content:space-between;gap:15px;padding:25px 30px;}
.scoreboard-heading h2 {font-size:30px;}
.scoreboard-heading .eyebrow {margin-bottom:8px;}
.score-table {width:100%;border-collapse:collapse;font-family:Consolas,monospace;}
.score-table th {text-transform:uppercase;font-size:11px;letter-spacing:1.5px;color:var(--muted);text-align:left;padding:13px 30px;background:#11160f;}
.score-table td {padding:13px 30px;border-top:1px solid #30362b;font-size:18px;}
.score-table td:first-child {width:100px;color:var(--muted);}
.score-table th:last-child,.score-value {text-align:right;}
.player-name {letter-spacing:2px;}
.first-place .player-name,.first-place .score-value {color:var(--accent);}
.open-place {color:#5c6854;}
.empty-score-note,.board-footnote {font-size:12px;color:var(--muted);line-height:1.7;padding:20px 30px;}
.board-footnote {max-width:850px;margin:auto;padding-left:0;}
.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;}
.account-main {flex:1;display:grid;grid-template-columns:1fr 1fr;gap:60px;align-items:start;max-width:1050px;width:100%;padding:75px 40px;margin:auto;}
.account-intro {padding-top:30px;}
.account-intro h1 {font-size:48px;max-width:400px;}
.account-panel {padding:30px;border:1px solid var(--line);background:var(--panel);border-radius:10px;}
.account-panel h2 {font-size:25px;margin-bottom:18px;}
.account-panel label {display:block;font-size:13px;margin:19px 0 8px;}
.account-panel form>label:first-child {margin-top:0;}
.account-panel input {display:block;width:100%;background:#10160e;color:var(--text);border:1px solid #59674f;border-radius:5px;min-height:46px;padding:11px 13px;font-family:inherit;font-size:16px;}
.account-panel input:focus {outline:2px solid var(--accent);outline-offset:2px;}
.field-note,.account-help {font-size:12px;color:var(--muted);line-height:1.6;margin-top:8px;}
.form-message {font-size:13px;line-height:1.6;margin:17px 0;color:var(--accent);}
.form-message:empty {margin:16px 0;}
#login-form>.button {width:100%;}
.signup-toggle {text-align:left;margin-top:12px;}
.account-help {border-top:1px solid var(--line);padding-top:18px;margin-top:10px;}
.profile-grid {display:grid;grid-template-columns:1fr 1fr;gap:26px;margin-top:32px;align-items:start;}
.profile-main {padding-bottom:24px;}
#profile-form #logout {margin-left:22px;}
#owner-tools .intro {font-size:14px;margin-bottom:25px;}
.invite-list {font-size:12px;color:var(--muted);margin-top:16px;}
.invite-item {display:flex;justify-content:space-between;gap:10px;align-items:center;border-top:1px solid var(--line);padding:8px 0;}
#invitation-link {font-size:12px;}
.muted {color:var(--muted);}
.winning-score {font:48px Consolas,monospace!important;color:var(--accent)!important;padding:16px 0;}
[hidden] {display:none!important;}
@media(max-width:850px) {
 .header-inner {gap:15px;} nav {gap:17px;} .nav-link {font-size:12px;}
 .card-image-link img {height:245px;}
 .account-main {gap:30px;padding:45px 24px;}
 .account-intro h1 {font-size:37px;}
 .profile-grid {grid-template-columns:1fr;}
}
@media(max-width:560px) {
 .header-inner {flex-wrap:wrap;padding-top:15px;padding-bottom:15px;gap:12px;}
 .site-header nav {gap:17px;flex-wrap:wrap;}
 .card-image-link img {height:265px;}
 .card-content {padding:16px;}
 .card-description {min-height:0;}
 .recent-entry {gap:10px;flex-wrap:wrap;}
 .record-badge {font-size:9px;min-width:90px;}
 .recent-time {display:none;}
 .recent-score {font-size:17px;}
 .section-heading {align-items:flex-end;}
 .text-link {font-size:12px;}
 .account-main {display:block;padding:30px 20px;}
 .account-intro {padding:0 0 27px;}
 .account-intro h1 {font-size:36px;}
 .account-panel {padding:23px;}
 .account-intro .intro {font-size:14px;}
 .scoreboard-heading {padding:20px 16px;flex-wrap:wrap;}
 .score-table td,.score-table th {padding:12px 14px;font-size:14px;}
 .score-table th {font-size:10px;}
 .score-table td:first-child {width:60px;}
 .player-name {letter-spacing:1px;}
 .player-actions {flex-wrap:wrap;}
 .player-actions .button {padding:10px;font-size:12px;}
 .board-tabs {gap:20px;}
}
