:root {
  color-scheme: light;
  --ink: #24231f;
  --ink-soft: #57534b;
  --muted: #746e63;
  --canvas: #292824;
  --paper: #f3eee3;
  --paper-bright: #fbf8f1;
  --paper-deep: #ded5c4;
  --line: #bdb3a2;
  --rust: #963f31;
  --rust-dark: #6f2d25;
  --green: #424b3f;
  --green-deep: #30372f;
  --red-card: #a44b42;
  --blue-card: #4c7180;
  --gold-card: #b68835;
  --shadow: rgba(20, 18, 14, .24);
  --display: "FZLanTingHeiS-DB1-GBK", "Microsoft YaHei", "PingFang SC", sans-serif;
  --body: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --serif: "STKaiti", "KaiTi", "Songti SC", serif;
  --number: "Courier New", "Lucida Console", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--canvas);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.055), transparent 28%),
    radial-gradient(circle at 84% 78%, rgba(150,63,49,.1), transparent 34%),
    repeating-linear-gradient(7deg, transparent 0 6px, rgba(255,255,255,.012) 6px 7px);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(150,63,49,.32); outline-offset: 2px; }

.eyebrow {
  margin: 0;
  color: var(--rust);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.entry-shell {
  display: grid;
  min-height: 100vh;
  padding: clamp(18px, 4vw, 52px);
  place-items: center;
}

.entry-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  width: min(1180px, 100%);
  min-height: 720px;
  overflow: hidden;
  border: 1px solid #8d8578;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(0,0,0,.36), 0 3px 0 #171612;
}

.entry-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: .16;
  background-image:
    repeating-radial-gradient(circle at 0 0, transparent 0 3px, rgba(25,22,18,.12) 3px 4px),
    repeating-linear-gradient(96deg, transparent 0 19px, rgba(255,255,255,.2) 19px 20px);
  mix-blend-mode: multiply;
}

.entry-hero {
  position: relative;
  display: flex;
  min-height: 720px;
  flex-direction: column;
  padding: 44px clamp(34px, 5vw, 70px) 36px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(255,255,255,.2), transparent 40%),
    #d9d1c2;
}

.entry-hero::before {
  content: "";
  position: absolute;
  width: 390px;
  height: 390px;
  right: -160px;
  top: -160px;
  border: 1px solid rgba(36,35,31,.13);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(36,35,31,.025), 0 0 0 76px rgba(36,35,31,.018);
}

.hero-brand, .game-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-seal {
  display: grid;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--rust-dark);
  color: #fff8ec;
  background: var(--rust);
  font: 800 23px/1 var(--serif);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.13);
  transform: rotate(-2deg);
}

.hero-brand div { display: grid; gap: 3px; }
.hero-brand b { font: 900 18px/1 var(--display); letter-spacing: .08em; }
.hero-brand small { color: var(--muted); font: 700 8px/1 var(--number); letter-spacing: .2em; }

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 480px;
  margin-top: clamp(76px, 11vh, 118px);
}

.hero-copy h1 {
  margin: 14px 0 22px;
  font: 950 clamp(55px, 6vw, 82px)/.98 var(--display);
  letter-spacing: -.07em;
}

.hero-copy h1 em {
  color: var(--rust);
  font-style: normal;
  font-family: var(--serif);
  font-weight: 900;
}

.hero-copy > p:last-child {
  max-width: 390px;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.8;
}

.hero-cards {
  position: absolute;
  right: clamp(22px, 4vw, 55px);
  bottom: 68px;
  z-index: 2;
  width: 280px;
  height: 205px;
  pointer-events: none;
}

.hero-card {
  --card-accent: var(--red-card);
  position: absolute;
  display: grid;
  width: 122px;
  height: 177px;
  padding: 13px;
  align-content: space-between;
  border: 2px solid var(--ink);
  border-top: 12px solid var(--card-accent);
  border-radius: 5px;
  background: #f5edda;
  box-shadow: 7px 9px 0 rgba(36,35,31,.28);
}

.hero-card i { color: var(--card-accent); font: 900 19px/1 var(--serif); }
.hero-card b { font: 900 33px/1 var(--number); letter-spacing: -.09em; }
.hero-card small { justify-self: end; padding: 3px 7px; color: white; background: var(--card-accent); font-size: 9px; font-weight: 900; }
.card-red { --card-accent: var(--red-card); left: 0; top: 22px; transform: rotate(-10deg); }
.card-blue { --card-accent: var(--blue-card); left: 80px; top: 3px; transform: rotate(1deg); }
.card-gold { --card-accent: var(--gold-card); right: 0; top: 24px; transform: rotate(11deg); }

.hero-note {
  position: relative;
  z-index: 2;
  display: flex;
  margin-top: auto;
  gap: 24px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.hero-note span { display: flex; align-items: center; gap: 8px; }
.hero-note span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--rust); }

.entry-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 58px clamp(34px, 5vw, 74px);
  background: rgba(251,248,241,.72);
}

.entry-card::before {
  content: "加入 / JOIN";
  position: absolute;
  top: 25px;
  right: 29px;
  color: rgba(36,35,31,.2);
  font: 800 9px/1 var(--number);
  letter-spacing: .18em;
}

.entry-heading h2 {
  max-width: 390px;
  margin: 10px 0 11px;
  font: 950 31px/1.25 var(--display);
  letter-spacing: -.04em;
}

.entry-heading > p:last-child { margin: 0; color: var(--muted); font-family: var(--serif); font-weight: 700; }
.entry-form { display: grid; gap: 22px; margin-top: 38px; }

.auth-panel { margin-top: 32px; }
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}
.auth-tabs button {
  padding: 11px 8px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}
.auth-tabs button.active { border-bottom-color: var(--rust); color: var(--ink); }
.auth-form { display: grid; gap: 20px; padding-top: 24px; }
.auth-form h3 { margin: 0; font: 900 20px/1.25 var(--display); }
.auth-form > p:not(.form-error) { margin: -12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.auth-submit { margin-top: 4px; }

.account-panel {
  margin-top: 28px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255,255,255,.25);
  box-shadow: 3px 3px 0 rgba(36,35,31,.08);
}
.account-panel header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.account-panel h3 { margin: 5px 0 0; font: 900 19px/1 var(--number); }
.account-actions { display: flex; gap: 12px; }
.account-panel header button {
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}
.account-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 15px; background: var(--line); }
.account-stats span { display: grid; gap: 5px; padding: 12px 7px; text-align: center; background: var(--paper-bright); }
.account-stats b { color: var(--rust-dark); font: 900 21px/1 var(--number); }
.account-stats small { color: var(--muted); font-size: 8px; font-weight: 800; line-height: 1.3; }
.recent-matches { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.recent-matches > div { display: flex; align-items: center; justify-content: space-between; }
.recent-matches > div > p { margin: 0; }
.recent-matches > div > small { color: var(--rust-dark); font-weight: 900; }
.recent-matches ol { display: grid; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.recent-matches li { display: grid; grid-template-columns: 43px 1fr auto; gap: 9px; align-items: center; padding: 9px 10px; border: 1px solid #d7cfc1; background: rgba(255,255,255,.3); font-size: 10px; }
.recent-matches li > b { font-size: 11px; }
.recent-matches li > span { color: var(--ink-soft); }
.recent-matches li > time { color: var(--muted); font: 700 9px/1.2 var(--number); }
.recent-matches li.win > b { color: var(--green); }
.recent-matches li.loss > b, .recent-matches li.afk > b { color: var(--rust-dark); }
.recent-matches li.empty { display: block; color: var(--muted); text-align: center; }

.line-field { display: grid; gap: 6px; }
.line-field > span, .count-row > span { color: var(--ink-soft); font-size: 11px; font-weight: 900; letter-spacing: .08em; }

.line-field input {
  width: 100%;
  height: 45px;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid #8f887c;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 17px;
  font-weight: 800;
  transition: border-color 140ms ease;
}

.line-field input::placeholder { color: #aca497; font-weight: 500; }
.line-field input:focus { border-color: var(--rust); outline: 0; }

fieldset { display: grid; gap: 13px; margin: 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); }
legend { padding: 0 10px 0 0; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; }
.mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-option { position: relative; }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }

.mode-option > span {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 72px;
  padding: 14px 34px 13px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255,255,255,.2);
  transition: border-color 130ms ease, box-shadow 130ms ease, transform 130ms ease;
}

.mode-option b { font-size: 14px; }
.mode-option small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.mode-option i { position: absolute; right: 11px; bottom: 11px; display: none; color: var(--rust); font-style: normal; font-weight: 950; }
.mode-option input:checked + span { border-color: var(--rust); box-shadow: inset 0 0 0 1px var(--rust), 3px 3px 0 rgba(150,63,49,.12); transform: translate(-1px,-1px); }
.mode-option input:checked + span i { display: block; }

.count-row { display: flex; align-items: center; justify-content: space-between; }
.count-row select {
  min-width: 108px;
  height: 38px;
  padding: 0 30px 0 12px;
  border: 1px solid #968e81;
  border-radius: 3px;
  color: var(--ink);
  background: var(--paper-bright);
  font-size: 12px;
  font-weight: 800;
}

.field-help { margin: -4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.join-button, .solid-action, .outline-action, .copy-code {
  border: 0;
  border-radius: 3px;
  font-weight: 900;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.join-button {
  display: flex;
  width: 100%;
  height: 53px;
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  color: #fffaf1;
  background: var(--ink);
  box-shadow: 4px 5px 0 #8c8376;
}

.join-button b { font: 900 22px/1 var(--number); }
.join-button:hover:not(:disabled), .solid-action:hover:not(:disabled), .copy-code:hover:not(:disabled) { filter: brightness(1.08); transform: translate(-1px,-1px); }
.join-button:active:not(:disabled), .solid-action:active:not(:disabled), .copy-code:active:not(:disabled) { box-shadow: 1px 1px 0 #8c8376; transform: translate(2px,3px); }

.text-button {
  width: max-content;
  margin: 20px auto 0;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

.form-error, .notice { color: var(--rust-dark); font-size: 11px; font-weight: 800; }
.form-error { margin: -12px 0 0; }

.rules-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 42px;
  overflow: auto;
  border: 1px solid var(--ink);
  border-radius: 5px;
  color: var(--ink);
  background: var(--paper-bright);
  box-shadow: 10px 12px 0 rgba(0,0,0,.32);
}

.rules-dialog::backdrop { background: rgba(22,21,18,.72); backdrop-filter: blur(3px); }
.rules-dialog h2 { max-width: 540px; margin: 10px 0 28px; font: 950 29px/1.3 var(--display); }
.dialog-close { position: absolute; top: 13px; right: 16px; width: 34px; height: 34px; border: 0; color: var(--ink); background: transparent; font-size: 28px; }
.rule-grid { display: grid; gap: 13px; }
.rule-grid article { display: grid; grid-template-columns: 31px 1fr; gap: 13px; align-items: start; padding-bottom: 13px; border-bottom: 1px solid #d3cbbc; }
.rule-grid article > span { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid var(--rust); border-radius: 50%; color: var(--rust); font: 900 12px/1 var(--number); }
.rule-grid b { font-size: 13px; }
.rule-grid p { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.rules-tip { margin: 21px 0 0; padding: 13px 15px; border-left: 3px solid var(--rust); color: var(--ink-soft); background: #eee6d7; font-family: var(--serif); font-size: 12px; font-weight: 700; line-height: 1.6; }

.account-dialog {
  position: relative;
  width: min(470px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 34px;
  overflow: auto;
  border: 1px solid var(--ink);
  border-radius: 5px;
  color: var(--ink);
  background: var(--paper-bright);
  box-shadow: 10px 12px 0 rgba(0,0,0,.32);
}
.account-dialog::backdrop { background: rgba(22,21,18,.72); backdrop-filter: blur(3px); }
.account-dialog h2 { margin: 9px 0 10px; font: 950 27px/1.25 var(--display); }
.account-dialog > p:not(.eyebrow) { color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.account-dialog code { display: block; margin: 22px 0; padding: 16px 12px; overflow-wrap: anywhere; border: 1px dashed var(--rust); color: var(--rust-dark); background: #eee6d7; text-align: center; font: 900 16px/1.5 var(--number); letter-spacing: .06em; user-select: all; }

/* Game */
.game-mode { background-attachment: fixed; }
.game-shell { width: min(1320px, calc(100% - 28px)); margin: 0 auto; padding: 20px 0 42px; }

.game-header {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 22px;
  padding: 16px 18px;
  border: 1px solid #5d5a52;
  border-bottom-color: #14130f;
  border-radius: 5px 5px 0 0;
  color: #f7f1e7;
  background: #33322e;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

.game-brand .brand-seal { width: 39px; height: 39px; font-size: 20px; }
.game-brand div { display: grid; gap: 1px; }
.game-brand p { margin: 0; color: #aaa498; font: 700 7px/1 var(--number); letter-spacing: .18em; }
.game-brand h1 { margin: 0; font: 950 20px/1.2 var(--display); letter-spacing: .08em; }

.room-chip { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 1px 7px; padding: 7px 11px; border: 1px solid #777168; border-radius: 3px; }
.room-chip small { color: #aaa498; font-size: 8px; }
.room-chip b { font: 900 18px/1 var(--number); letter-spacing: .08em; }
.room-chip span { grid-column: 1 / -1; color: #c9c2b6; font-size: 8px; }
.identity { display: grid; gap: 2px; padding-left: 18px; border-left: 1px solid #666159; text-align: right; }
.identity b { font-size: 12px; }
.identity small { color: #aaa498; font-size: 8px; }
.game-header nav { display: flex; gap: 7px; }
.game-header nav button { padding: 7px 9px; border: 1px solid #6e6961; border-radius: 2px; color: #d5cec2; background: transparent; font-size: 9px; font-weight: 800; }
.game-header nav button:hover { color: white; border-color: #aaa298; }

.room-strip {
  display: flex;
  min-height: 34px;
  padding: 8px 16px;
  align-items: center;
  gap: 13px;
  border: 1px solid #b6ad9d;
  border-top: 0;
  color: #686156;
  background: #ddd5c7;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .035em;
}
.room-strip i { width: 3px; height: 3px; border-radius: 50%; background: var(--rust); }
.notice { margin: 10px 0; padding: 10px 13px; border-left: 3px solid var(--rust); background: #f3ded8; }

.paper-panel, .ffa-scoreboard, .team-scoreboard, .players-section {
  border: 1px solid #a89f90;
  border-radius: 4px;
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(5deg, transparent 0 8px, rgba(36,35,31,.012) 8px 9px),
    radial-gradient(circle at 12% 14%, rgba(255,255,255,.5), transparent 32%);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.waiting-panel { display: grid; grid-template-columns: 180px 1fr auto; align-items: center; gap: 26px; margin-top: 14px; padding: 30px; }
.waiting-copy h2 { margin: 5px 0; font: 950 41px/1 var(--number); }
.waiting-copy h2 span { color: var(--muted); font-size: 21px; }
.waiting-copy p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.seat-list { display: flex; flex-wrap: wrap; gap: 8px; }
.seat-list span { min-width: 74px; padding: 9px 11px; border: 1px dashed #aaa090; color: #8f877b; font-size: 9px; text-align: center; }
.seat-list span.filled { border-style: solid; border-color: #69635a; color: var(--ink); background: #e7dfd1; font-weight: 900; }
.copy-code { padding: 12px 15px; color: white; background: var(--rust); box-shadow: 3px 4px 0 #6e2b22; font-size: 10px; }

.ffa-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  margin-top: 14px;
  padding: 18px 22px;
}
.ffa-scoreboard > div:first-child { display: grid; gap: 3px; }
.ffa-scoreboard span { color: var(--muted); font-size: 9px; font-weight: 800; }
.ffa-scoreboard > div:first-child strong { font-size: 15px; }
.ffa-scoreboard small { color: #8b8377; font-family: var(--serif); font-size: 10px; }
.scoreboard-stats { display: flex; gap: 8px; }
.scoreboard-stats > span { display: grid; min-width: 62px; padding: 7px 10px; border-left: 1px solid var(--line); text-align: right; }
.scoreboard-stats b { color: var(--ink); font: 900 20px/1 var(--number); }
.scoreboard-stats small { font-family: var(--body); font-size: 8px; }

.team-scoreboard { display: grid; grid-template-columns: 1fr 1fr 120px; gap: 1px; margin-top: 14px; overflow: hidden; }
.team-score { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; padding: 20px 22px; }
.team-score + .team-score { border-left: 1px solid var(--line); }
.team-score > div:first-child { display: grid; }
.team-score > div:first-child span { color: var(--muted); font-size: 9px; }
.team-score > div:first-child strong { font: 900 28px/1 var(--number); }
.team-score > div:first-child small { color: var(--muted); font-size: 8px; }
.team-score .color-totals { align-self: center; }
.team-score p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 8px; }
.round-meter { display: grid; padding: 14px; place-content: center; border-left: 1px solid var(--line); text-align: center; }
.round-meter span, .round-meter small, .round-meter em { color: var(--muted); font-size: 8px; font-style: normal; }
.round-meter strong { margin: 3px 0; font: 900 26px/1 var(--number); }
.round-meter em { margin-top: 5px; }

.game-table {
  position: relative;
  margin-top: 14px;
  padding: 20px;
  overflow: hidden;
  border: 9px solid #655442;
  border-radius: 8px;
  color: #f8f2e8;
  background-color: var(--green);
  background-image:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.055), transparent 42%),
    repeating-linear-gradient(9deg, transparent 0 5px, rgba(0,0,0,.018) 5px 6px);
  box-shadow: inset 0 0 50px rgba(0,0,0,.25), 0 13px 30px rgba(0,0,0,.28), inset 0 0 0 1px #98816c;
}

.game-table::before { content: ""; position: absolute; inset: 8px; border: 1px dashed rgba(255,255,255,.16); border-radius: 3px; pointer-events: none; }
.table-topline { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; color: #c4c8be; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.turn-timer { display: flex; align-items: baseline; gap: 5px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.25); border-radius: 3px; background: rgba(0,0,0,.12); }
.turn-timer b { color: #f1d092; font: 900 25px/1 var(--number); }
.turn-timer small { font-size: 8px; }
.turn-timer i { margin-left: 5px; color: white; font-style: normal; }
.turn-timer.urgent { border-color: #dc978b; background: #6f3029; animation: pulse-timer .6s ease-in-out infinite alternate; }

.table-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(310px, .95fr);
  min-height: 345px;
  align-items: center;
  gap: clamp(24px, 5vw, 70px);
  padding: 18px clamp(16px, 5vw, 65px) 6px;
}

.card-spread { display: flex; min-height: 260px; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 24px); }
.card-spread.single-gift .play-card { transform: rotate(-2deg) scale(1.06); }

.play-card {
  --card-accent: var(--red-card);
  position: relative;
  display: grid;
  width: clamp(128px, 13vw, 160px);
  aspect-ratio: .69;
  padding: 15px;
  align-content: space-between;
  overflow: visible;
  border: 2px solid #27251f;
  border-top: 13px solid var(--card-accent);
  border-radius: 6px;
  color: var(--ink);
  background-color: #f6eedc;
  background-image: repeating-linear-gradient(96deg, transparent 0 8px, rgba(37,35,30,.025) 8px 9px);
  box-shadow: 7px 9px 0 rgba(18,24,19,.4);
  transform: rotate(-1deg);
  animation: card-in 320ms ease both;
}
.play-card:nth-child(2) { transform: translateY(-7px) rotate(.6deg); animation-delay: 60ms; }
.play-card:nth-child(3) { transform: rotate(1.5deg); animation-delay: 120ms; }
.play-card.color-red, .mini-card.color-red { --card-accent: var(--red-card); }
.play-card.color-blue, .mini-card.color-blue { --card-accent: var(--blue-card); }
.play-card.color-gold, .mini-card.color-gold { --card-accent: var(--gold-card); }
.card-suit { color: var(--card-accent); font: 950 19px/1 var(--serif); }
.play-card > strong { align-self: center; justify-self: center; font: 950 clamp(30px, 3vw, 42px)/1 var(--number); letter-spacing: -.1em; }
.play-card > small { justify-self: end; color: var(--muted); font-size: 8px; font-weight: 800; }
.play-card.is-selectable { margin-bottom: 49px; }

.card-roles { position: absolute; display: grid; grid-template-columns: repeat(3, 1fr); width: calc(100% + 4px); left: -2px; bottom: -45px; gap: 3px; }
.card-roles button { min-height: 32px; padding: 6px 2px; border: 1px solid rgba(255,255,255,.24); border-radius: 2px; color: rgba(255,255,255,.64); background: rgba(24,28,24,.55); font-size: 8px; font-weight: 800; }
.card-roles button.selected { color: var(--ink); background: #f0dfb8; border-color: #f0dfb8; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.card-roles .role-gift.selected { color: white; background: var(--rust); border-color: var(--rust); }
.card-roles .role-bury.selected { color: white; background: #292824; border-color: #292824; }

.card-backs { position: relative; }
.card-back {
  position: relative;
  display: grid;
  width: clamp(128px, 13vw, 160px);
  aspect-ratio: .69;
  padding: 13px;
  place-content: center;
  border: 2px solid #f2e7d2;
  border-radius: 6px;
  color: #f1e3ca;
  background-color: #72352d;
  background-image:
    linear-gradient(45deg, transparent 46%, rgba(242,231,210,.16) 46% 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(242,231,210,.12) 46% 54%, transparent 54%);
  background-size: 20px 20px;
  box-shadow: 7px 9px 0 rgba(18,24,19,.38);
  transform: translateY(calc((var(--i) - 2) * 5px)) rotate(calc((var(--i) - 2) * 3deg));
}
.card-back::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(255,255,255,.35); border-radius: 2px; }
.card-back i { font: 900 24px/1 var(--serif); font-style: normal; }
.card-back b { font: 900 24px/1 var(--serif); }

.table-actions { min-width: 0; }
.turn-copy, .arrange-controls, .gift-response { display: grid; gap: 13px; }
.table-actions h2 { margin: 0; color: white; font: 950 clamp(23px, 3vw, 35px)/1.2 var(--display); letter-spacing: -.04em; }
.table-actions p:not(.eyebrow) { max-width: 430px; margin: 0; color: #c7cdc3; font-family: var(--serif); font-size: 13px; font-weight: 700; line-height: 1.65; }
.table-actions .eyebrow { color: #e9c985; }
.solid-action { min-height: 46px; padding: 0 19px; color: #fff9ef; background: var(--rust); box-shadow: 4px 5px 0 rgba(18,20,17,.42); }
.draw-action { width: min(220px, 100%); margin-top: 6px; }
.gift-target { display: flex; align-items: center; gap: 10px; }
.gift-target > span { color: #cbd0c7; font-size: 10px; font-weight: 800; }
.gift-target select { min-width: 190px; height: 42px; padding: 0 28px 0 11px; border: 1px solid rgba(255,255,255,.35); border-radius: 3px; color: white; background: #343b33; font-size: 11px; font-weight: 800; }
.arrange-controls .solid-action { width: min(220px, 100%); }

.response-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 5px; }
.response-actions button { display: grid; min-height: 68px; padding: 10px; place-content: center; gap: 4px; text-align: center; }
.response-actions b { font-size: 12px; }
.response-actions small { font-size: 8px; }
.outline-action { border: 1px solid rgba(255,255,255,.4); color: white; background: rgba(0,0,0,.1); }
.outline-action:hover:not(:disabled) { border-color: white; background: rgba(255,255,255,.08); }
.outline-action.immunity { border-style: dashed; }

.players-section { margin-top: 14px; padding: 25px 22px 30px; }
.section-heading { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font: 950 20px/1.2 var(--display); }
.players-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 14px; }

.player-board {
  position: relative;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid #aaa091;
  border-radius: 3px;
  background-color: #f8f3e9;
  background-image: repeating-linear-gradient(to bottom, transparent 0 27px, rgba(77,113,128,.045) 27px 28px);
  box-shadow: 3px 4px 0 rgba(83,73,60,.18);
  transform: rotate(-.15deg);
}
.player-board:nth-child(3n + 2) { transform: translateY(2px) rotate(.2deg); }
.player-board:nth-child(3n) { transform: translateY(-1px) rotate(-.25deg); }
.player-board.me { border: 2px solid var(--rust-dark); box-shadow: 4px 5px 0 rgba(111,45,37,.45); transform: translateY(-2px) rotate(0); }
.player-board.me::before { content: "我的牌"; position: absolute; top: -9px; right: 10px; padding: 3px 7px; color: white; background: var(--rust); font-size: 8px; font-weight: 900; transform: rotate(2deg); }
.player-board.is-kicked { opacity: .46; filter: grayscale(.8); }
.player-board header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; }
.avatar { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--ink); border-radius: 50%; color: var(--paper-bright); background: var(--green); font-family: var(--serif); font-size: 17px; font-weight: 900; }
.player-board header > div { display: grid; min-width: 0; }
.player-board header b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.player-board header small { color: var(--muted); font-size: 8px; }
.status { padding-bottom: 2px; border-bottom: 1px solid currentColor; font-size: 8px; font-style: normal; font-weight: 900; }
.status.active { color: var(--rust); }
.status.warning { color: #a2582f; }
.status.kicked { color: #7b7770; }
.status.settled { color: var(--green); }
.status.waiting, .status.ready { color: var(--muted); }
.status.reconnecting { color: #b26a32; }
.status.offline { color: var(--rust-dark); }

.player-resources { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.player-resources > span { display: flex; padding: 7px 9px; align-items: baseline; justify-content: space-between; border: 1px solid #c0b6a6; border-radius: 2px; background: #ebe3d5; }
.player-resources i { color: var(--muted); font-size: 8px; font-style: normal; }
.player-resources b { font: 900 13px/1 var(--number); }
.owned-cards { display: flex; min-height: 43px; flex-wrap: wrap; align-items: center; gap: 5px; }
.owned-cards > p { margin: 0; color: #a0988b; font-family: var(--serif); font-size: 10px; }

.mini-card {
  --card-accent: var(--red-card);
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 4px;
  padding: 5px 6px 5px 5px;
  border: 1px solid #37342d;
  border-left: 5px solid var(--card-accent);
  border-radius: 2px;
  background: #f7efde;
  box-shadow: 1px 2px 0 #6d675d;
}
.mini-card i { color: var(--card-accent); font: 900 8px/1 var(--serif); font-style: normal; }
.mini-card b { font: 900 11px/1 var(--number); letter-spacing: -.05em; }

.color-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.color-totals > span { display: flex; min-width: 0; padding: 5px 7px; align-items: baseline; justify-content: space-between; border-bottom: 2px solid currentColor; color: var(--ink-soft); background: rgba(222,213,196,.48); }
.color-totals i { font-family: var(--serif); font-size: 8px; font-style: normal; font-weight: 900; }
.color-totals b { color: var(--ink); font: 900 11px/1 var(--number); }
.color-totals .total-red { color: var(--red-card); }
.color-totals .total-blue { color: var(--blue-card); }
.color-totals .total-gold { color: var(--gold-card); }
.color-totals.compact { min-width: 150px; }
.color-totals.compact > span { padding: 3px 5px; background: transparent; }
.color-totals.compact i { font-size: 7px; }
.color-totals.compact b { font-size: 9px; }

.player-board footer { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 6px; padding-top: 9px; border-top: 1px solid #c6bcac; }
.player-board footer span { display: grid; color: var(--muted); font-size: 7px; }
.player-board footer span b { color: var(--ink-soft); font: 900 11px/1.4 var(--number); }
.player-board footer > strong { color: var(--rust-dark); font: 950 25px/1 var(--number); }

.result-panel { margin-top: 14px; padding: 30px; }
.result-panel > h2 { margin: 7px 0; font: 950 32px/1.2 var(--display); }
.result-panel > p:not(.eyebrow) { margin: 0 0 20px; color: var(--muted); font-family: var(--serif); font-size: 11px; }
.result-panel > h3 { margin: 26px 0 10px; font: 900 16px/1.2 var(--display); }
.ranking-list { display: grid; gap: 7px; }
.ranking-list > header { display: grid; grid-template-columns: 32px minmax(180px, 1fr) auto 64px; gap: 13px; padding: 0 12px 4px; color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.ranking-list > header > strong { text-align: right; }
.ranking-list article { display: grid; grid-template-columns: 32px minmax(180px, 1fr) auto 64px; align-items: center; gap: 13px; padding: 10px 12px; border: 1px solid #c2b8a8; background: rgba(255,255,255,.28); }
.ranking-list article.ineligible { opacity: .58; }
.ranking-list article > span { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font: 900 10px/1 var(--number); }
.ranking-list article > div { display: grid; grid-template-columns: 100px minmax(150px, 240px); align-items: center; gap: 12px; }
.ranking-list article > div > b { font-size: 11px; }
.ranking-list article > div > b small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 700; }
.ranking-list article > p { margin: 0; color: var(--muted); font-size: 9px; }
.ranking-list article > strong { display: grid; gap: 2px; color: var(--rust-dark); font: 950 22px/1 var(--number); text-align: right; }
.ranking-list article > strong small { color: var(--muted); font: 700 7px/1 var(--sans); letter-spacing: .08em; }

.history-panel { display: grid; grid-template-columns: 170px 1fr; gap: 28px; margin-top: 14px; padding: 27px; }
.history-panel h2 { margin: 7px 0 0; font: 950 22px/1.2 var(--display); }
.history-panel ol { max-height: 210px; margin: 0; padding: 0 0 0 18px; overflow: auto; color: var(--muted); }
.history-panel li { padding: 5px 7px; font-family: var(--serif); font-size: 10px; font-weight: 700; line-height: 1.5; }
.history-panel li.latest { color: var(--ink); background: #e5dccd; }
.site-footer { padding: 20px 0 0; color: #938d83; font: 700 8px/1 var(--number); letter-spacing: .12em; text-align: center; }

.expelled-card { width: min(520px, 100%); padding: 44px; text-align: center; }
.expelled-card .brand-seal { margin: 0 auto 20px; }
.expelled-card h1 { margin: 8px 0; font: 950 31px/1.2 var(--display); }
.expelled-card > p:not(.eyebrow) { color: var(--muted); font-size: 12px; line-height: 1.7; }
.expelled-card .join-button { margin-top: 22px; }
.expelled-card a.join-button { text-decoration: none; }

.endgame-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 22px;
  place-items: center;
  background: rgba(35, 32, 27, .7);
  backdrop-filter: blur(6px);
}
.endgame-dialog {
  width: min(900px, 100%);
  max-height: min(900px, calc(100vh - 30px));
  padding: 38px;
  overflow: auto;
  border: 2px solid var(--ink);
  box-shadow: 9px 11px 0 rgba(0, 0, 0, .27);
  text-align: center;
}
.endgame-dialog .brand-seal { margin: 0 auto 17px; }
.endgame-dialog h2 { margin: 8px 0 12px; font: 950 30px/1.2 var(--display); }
.endgame-dialog > p:not(.eyebrow) { margin: 0 auto 22px; color: var(--muted); font: 700 11px/1.7 var(--serif); }
.endgame-scoreboard { margin: 22px 0 26px; text-align: left; }
.endgame-scoreboard > h3 { margin: 18px 0 9px; font: 900 13px/1.2 var(--display); }
.rematch-title { margin: 22px 0 8px; font: 900 18px/1.2 var(--display); }
.rematch-progress { display: flex; margin-bottom: 18px; padding: 11px 13px; align-items: center; justify-content: space-between; border: 1px solid #b8ad9c; background: #e9e0d1; font-size: 10px; }
.rematch-progress b { color: var(--rust-dark); font: 900 12px/1 var(--number); }
.endgame-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; }
.endgame-actions button { min-height: 52px; }
.dissolve-action { color: #7c302a; border-color: #7c302a; }

@media (max-width: 440px) {
  .endgame-dialog { padding: 30px 21px; }
  .endgame-dialog h2 { font-size: 25px; }
  .endgame-actions { grid-template-columns: 1fr; }
}

@keyframes card-in { from { opacity: 0; transform: translateY(17px) rotate(-4deg); } }
@keyframes pulse-timer { to { transform: scale(1.03) rotate(.5deg); } }

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

@media (max-width: 1020px) {
  .entry-stage { grid-template-columns: 1fr; width: min(720px, 100%); }
  .entry-hero { min-height: 500px; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-copy { margin-top: 58px; }
  .hero-copy h1 { font-size: 61px; }
  .hero-cards { right: 45px; bottom: 54px; transform: scale(.86); transform-origin: right bottom; }
  .hero-note { max-width: 52%; flex-wrap: wrap; }
  .entry-card { min-height: 650px; }
  .game-header { grid-template-columns: 1fr auto auto; }
  .identity { display: none; }
  .table-stage { grid-template-columns: 1fr; gap: 24px; padding-bottom: 20px; }
  .table-actions { max-width: 620px; justify-self: center; text-align: center; }
  .turn-copy, .arrange-controls, .gift-response { justify-items: center; }
  .game-table { padding-bottom: 25px; }
  .team-scoreboard { grid-template-columns: 1fr 1fr; }
  .round-meter { grid-column: 1 / -1; grid-template-columns: repeat(4, auto); align-items: baseline; justify-content: center; gap: 10px; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 720px) {
  .entry-shell { padding: 0; place-items: stretch; }
  .entry-stage { min-height: 100vh; border: 0; border-radius: 0; }
  .entry-hero { min-height: 450px; padding: 28px 24px; }
  .hero-copy { margin-top: 50px; }
  .hero-copy h1 { margin-bottom: 14px; font-size: clamp(44px, 13vw, 60px); }
  .hero-copy > p:last-child { max-width: 60%; font-size: 13px; }
  .hero-cards { right: 0; bottom: 25px; transform: scale(.67); }
  .hero-note { gap: 10px; max-width: 62%; font-size: 8px; }
  .entry-card { min-height: 620px; padding: 48px 24px; }
  .rules-dialog { padding: 37px 22px 25px; }
  .rules-dialog h2 { font-size: 23px; }
  .account-dialog { padding: 34px 21px 24px; }
  .account-dialog h2 { font-size: 23px; }
  .account-actions { gap: 8px; }
  .game-shell { width: calc(100% - 14px); padding-top: 7px; }
  .game-header { grid-template-columns: 1fr auto; gap: 9px; padding: 11px; }
  .room-chip { grid-row: 2; grid-column: 1 / -1; display: flex; align-items: baseline; }
  .room-chip span { margin-left: auto; }
  .game-header nav { grid-column: 2; grid-row: 1; }
  .game-header nav button { padding: 6px; }
  .room-strip { overflow: auto; white-space: nowrap; }
  .ffa-scoreboard { grid-template-columns: 1fr; }
  .scoreboard-stats { justify-content: stretch; }
  .scoreboard-stats > span { flex: 1; text-align: left; }
  .team-scoreboard { grid-template-columns: 1fr; }
  .team-score + .team-score { border-top: 1px solid var(--line); border-left: 0; }
  .round-meter { grid-column: auto; }
  .game-table { padding: 13px; border-width: 7px; }
  .table-stage { min-height: 480px; padding-inline: 0; }
  .card-spread { min-height: 235px; gap: 7px; }
  .play-card, .card-back { width: clamp(91px, 27vw, 132px); }
  .play-card { padding: 9px; border-top-width: 9px; }
  .card-suit { font-size: 15px; }
  .play-card > strong { font-size: clamp(25px, 8vw, 34px); }
  .play-card.is-selectable { margin-bottom: 52px; }
  .card-roles { bottom: -48px; }
  .card-roles button { min-height: 36px; padding: 3px 1px; font-size: 7px; }
  .response-actions { grid-template-columns: 1fr; width: 100%; }
  .response-actions button { min-height: 52px; }
  .players-section { padding: 21px 12px; }
  .players-grid { grid-template-columns: 1fr; }
  .history-panel { grid-template-columns: 1fr; gap: 12px; padding: 20px; }
  .ranking-list > header { grid-template-columns: 27px 1fr auto; }
  .ranking-list > header > span:nth-of-type(2) { display: none; }
  .ranking-list article { grid-template-columns: 27px 1fr auto; }
  .ranking-list article > div { grid-template-columns: 1fr; gap: 5px; }
  .ranking-list article > p { display: none; }
}

@media (max-width: 440px) {
  .entry-hero { min-height: 420px; }
  .hero-copy > p:last-child { max-width: 78%; }
  .hero-cards { right: -44px; bottom: 19px; transform: scale(.52); }
  .hero-note span:nth-child(2) { display: none; }
  .mode-picker { grid-template-columns: 1fr; }
  .account-stats { grid-template-columns: 1fr 1fr; }
  .entry-card { min-height: 690px; }
  .game-brand p { display: none; }
  .game-brand h1 { font-size: 17px; }
  .game-header nav button { font-size: 9px; }
  .table-topline > span { display: none; }
  .turn-timer { margin-left: auto; }
  .card-spread { gap: 5px; }
  .play-card, .card-back { width: clamp(86px, 28vw, 108px); }
  .card-roles { gap: 1px; }
  .gift-target { width: 100%; justify-content: center; }
  .gift-target select { min-width: 0; max-width: 220px; flex: 1; }
  .arrange-controls .solid-action, .draw-action { width: 100%; }
  .section-heading { display: grid; gap: 5px; }
}
/* The advisory is plain HTML so it remains readable before game JavaScript runs. */
.health-advisory {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-content: center;
  gap: 22px;
  padding: 36px;
  color: #f7f3eb;
  text-align: center;
  background: #161615;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.health-advisory[hidden] {
  display: none;
}

.health-advisory.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.health-advisory p,
.health-advisory small {
  margin: 0;
  color: #beb29d;
  font-size: 12px;
  letter-spacing: 0.24em;
}

.health-advisory h1 {
  display: grid;
  gap: 8px;
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: clamp(17px, 4.4vw, 23px);
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.04em;
}

.health-advisory h1 span {
  display: block;
}

/* Guided onboarding, solo practice and responsible-play notice */
.practice-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(38, 37, 33, 0.2);
  border-radius: 18px;
  background: rgba(255, 252, 244, 0.72);
  box-shadow: 0 10px 28px rgba(61, 54, 40, 0.08);
}
.practice-entry div { display: grid; gap: 4px; }
.practice-entry b { color: #24231f; font-size: 15px; }
.practice-entry small { color: #68645b; line-height: 1.45; }
.practice-entry button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #34322d;
  border-radius: 999px;
  color: #f8f3e8;
  background: #34322d;
  box-shadow: 0 6px 14px rgba(31, 29, 25, 0.16);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.practice-entry button:hover { transform: translateY(-1px); background: #171713; }
.practice-entry button:disabled { opacity: 0.6; cursor: wait; }

.anti-gambling-notice {
  margin: 18px 0 0;
  padding: 11px 14px;
  border: 1px solid rgba(145, 63, 51, 0.22);
  border-radius: 12px;
  color: #5e3c36;
  background: rgba(176, 82, 67, 0.07);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}
.anti-gambling-notice b { margin-right: 6px; color: #923f33; }
.anti-gambling-rule { border-left-color: #913f33; color: #6d322a; }
.game-gambling-notice {
  margin: 12px auto 0;
  padding: 7px 14px;
  border: 1px solid rgba(145, 63, 51, .22);
  border-radius: 999px;
  color: #793d33;
  background: rgba(247, 239, 226, .92);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
  text-align: center;
}
.health-gambling {
  color: #e0cbb0;
  font-size: clamp(13px, 3.5vw, 16px);
  letter-spacing: .08em;
}

.tutorial-dialog {
  width: min(680px, calc(100vw - 30px));
  max-height: min(760px, calc(100vh - 30px));
  padding: 32px;
  overflow: auto;
  border: 1px solid rgba(42, 39, 33, 0.25);
  border-radius: 28px;
  color: #27251f;
  background: #f6f0e4;
  box-shadow: 0 28px 90px rgba(23, 21, 18, 0.34);
}
.tutorial-dialog::backdrop { background: rgba(27, 25, 21, 0.62); backdrop-filter: blur(5px); }
.tutorial-progress { height: 5px; margin: 2px 48px 25px 0; overflow: hidden; border-radius: 99px; background: rgba(42, 39, 33, 0.13); }
.tutorial-progress i { display: block; width: 20%; height: 100%; border-radius: inherit; background: #b05243; transition: width 220ms ease; }
.tutorial-scene { min-height: 380px; padding-top: 10px; }
.tutorial-scene h2 { max-width: 520px; margin: 8px 0 12px; font-family: "Arial Rounded MT Bold", "Microsoft YaHei", sans-serif; font-size: clamp(28px, 5vw, 42px); line-height: 1.12; letter-spacing: -0.04em; }
.tutorial-scene > p:not(.tutorial-badge) { max-width: 570px; color: #5f5a50; font-size: 16px; line-height: 1.75; }
.tutorial-badge { margin: 0; color: #a34739; font-weight: 850; letter-spacing: 0.12em; }
.tutorial-cards { display: flex; justify-content: center; gap: 14px; margin: 28px 0; }
.tutorial-card { display: grid; place-items: center; width: 112px; aspect-ratio: .72; border: 1px solid rgba(40, 37, 31, .18); border-radius: 15px; color: #282720; background: #eee8db; box-shadow: 0 14px 24px rgba(43, 39, 33, .13); transform: rotate(-2deg); }
.tutorial-card:nth-child(2) { transform: translateY(-7px) rotate(1deg); }
.tutorial-card:nth-child(3) { transform: rotate(3deg); }
.tutorial-card.color-red { border-top: 7px solid #a94d43; }
.tutorial-card.color-blue { border-top: 7px solid #3f6873; }
.tutorial-card.color-gold { border-top: 7px solid #a47a31; }
.tutorial-card i { font-style: normal; font-size: 13px; font-weight: 800; }
.tutorial-card b { font-family: Consolas, "Courier New", monospace; font-size: 30px; }
.tutorial-choices, .tutorial-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0; }
.tutorial-choices span, .tutorial-totals span { padding: 14px; border: 1px solid rgba(43, 40, 34, .18); border-radius: 14px; color: #423f37; background: rgba(255, 253, 248, .66); text-align: center; font-weight: 750; }
.tutorial-totals .answer { grid-column: 1 / -1; color: #f8f1e5; background: #35332e; }
.tutorial-scene aside { padding: 12px 15px; border-left: 4px solid #b05243; color: #4c493f; background: rgba(176, 82, 67, .08); line-height: 1.55; }
.tutorial-dialog > footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid rgba(43, 40, 34, .14); }
.tutorial-dialog > footer button { min-width: 120px; }
.status.bot { color: #5f5545; background: #e8dfcf; }

.report-dialog select,
.report-dialog textarea {
  width: 100%;
  padding: .55rem 0;
  border: 0;
  border-bottom: 1px solid rgba(38, 37, 33, .28);
  outline: 0;
  color: #262521;
  background: transparent;
  font: inherit;
  resize: vertical;
}
.report-dialog select:focus,
.report-dialog textarea:focus { border-color: #262521; }

@media (max-width: 560px) {
  .practice-entry { align-items: stretch; flex-direction: column; }
  .practice-entry button { justify-content: center; width: 100%; }
  .tutorial-dialog { padding: 24px 20px; border-radius: 22px; }
  .tutorial-scene { min-height: 410px; }
  .tutorial-cards { gap: 8px; }
  .tutorial-card { width: min(29vw, 98px); }
  .tutorial-choices, .tutorial-totals { grid-template-columns: 1fr; }
  .tutorial-totals .answer { grid-column: auto; }
}

/* Security administration */
.admin-body { min-height: 100vh; color: #292721; background: #e9e3d7; }
.admin-shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 70px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.admin-header a { color: inherit; font-weight: 800; text-decoration: none; }
.admin-login { width: min(520px, 100%); margin: 8vh auto 0; padding: clamp(24px, 5vw, 46px); }
.admin-login h2, .admin-tools h2, .admin-section h2 { margin: 5px 0 12px; }
.admin-summary { display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)) auto auto; gap: 12px; margin-bottom: 18px; }
.admin-summary article, .admin-summary button { min-height: 82px; padding: 15px 18px; border: 1px solid rgba(42, 39, 33, .16); border-radius: 16px; background: rgba(250, 247, 239, .72); }
.admin-summary article { display: flex; flex-direction: column; }
.admin-summary article b { font: 800 30px/1 Consolas, monospace; }
.admin-summary article span { margin-top: 8px; color: #686258; }
.admin-summary button { color: inherit; font: inherit; font-weight: 800; cursor: pointer; }
.admin-tools { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.admin-tools > form { padding: 24px; }
.admin-tools .solid-action, .admin-tools .outline-action { width: 100%; margin-top: 12px; }
.admin-section { margin-top: 28px; }
.admin-section > header { padding-bottom: 12px; border-bottom: 1px solid rgba(42, 39, 33, .16); }
.moderation-list { display: grid; gap: 12px; margin-top: 14px; }
.moderation-card { padding: 18px; border: 1px solid rgba(42, 39, 33, .16); border-radius: 16px; background: rgba(250, 247, 239, .75); }
.moderation-card.resolved { opacity: .62; }
.moderation-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.moderation-card header small { color: #736d62; font-weight: 600; }
.moderation-card time, .moderation-card > small { color: #736d62; font-size: 12px; }
.moderation-card footer { display: flex; gap: 8px; margin-top: 14px; }
.moderation-card footer button { padding: 8px 12px; border: 1px solid rgba(42, 39, 33, .2); border-radius: 9px; color: inherit; background: transparent; font: inherit; font-weight: 750; cursor: pointer; }
.admin-empty { padding: 32px; border: 1px dashed rgba(42, 39, 33, .22); border-radius: 16px; color: #736d62; text-align: center; }
.admin-body .notice.error { background: #8a3d35; }

@media (max-width: 720px) {
  .admin-summary { grid-template-columns: 1fr 1fr; }
  .admin-tools { grid-template-columns: 1fr; }
  .moderation-card header { align-items: flex-start; flex-direction: column; gap: 4px; }
}
