:root {
  color-scheme: light;
  --black: #090c0a;
  --forest-black: #101814;
  --ivory: #f5ecd8;
  --paper: #fffaf0;
  --sand: #ead7b0;
  --line: #b8ad98;
  --muted: #625e55;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ivory); color: var(--black); font: 16px/1.55 Arial, Helvetica, sans-serif; }
body.is-chinese { font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", Arial, sans-serif; }
a { color: inherit; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  padding: 20px max(24px, calc((100% - 1160px) / 2));
  border-bottom: 1px solid #4c514e;
  background: var(--forest-black);
  color: var(--ivory);
}
.site-header a, .link-button { color: var(--ivory); text-decoration: none; }
.brand { font-size: 17px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.brand span { margin-right: 5px; font-size: 25px; }
nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
nav > a, nav .link-button { padding: 8px 12px; border: 1px solid transparent; }
nav > a:hover, nav .link-button:hover { border-color: var(--sand); }
.user-greeting { margin: 0 6px; color: #d2c8b4; font-size: 14px; }
.inline { display: inline; }
.link-button { background: transparent; font: inherit; cursor: pointer; }

.container { width: min(1160px, calc(100% - 32px)); min-height: 62vh; margin: 38px auto 72px; }
.hero {
  position: relative;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 6vw, 72px);
  border: 1px solid #465048;
  background: var(--forest-black);
  color: var(--paper);
}
.hero > .eyebrow { padding-right: 170px; }
.language-toggle {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 150px;
  height: 48px;
  padding: 0;
  overflow: hidden;
  border-color: var(--sand);
  background: var(--ivory);
  color: var(--black);
  font-size: 14px;
}
.language-toggle:hover { background: #fff8e8; }
.language-toggle::after {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 1px;
  background: #8f8778;
  content: "";
  transform: translateX(-.5px);
  transition: background .2s ease;
}
.language-toggle-label {
  position: absolute;
  top: 50%;
  left: 17px;
  transform: translateY(-50%);
  font-weight: 800;
  letter-spacing: .02em;
}
.language-toggle-piece {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translate(0, -52%);
  font: 30px/1 Georgia, "Times New Roman", serif;
  transition: transform .42s cubic-bezier(.16, 1, .3, 1), color .2s ease;
}
.language-toggle.is-chinese { background: var(--black); color: var(--paper); }
.language-toggle.is-chinese:hover { background: #29302c; }
.language-toggle.is-chinese::after { background: #777d79; }
.language-toggle.is-chinese .language-toggle-label { right: 13px; left: auto; }
.language-toggle.is-chinese .language-toggle-piece { transform: translate(-104px, -52%); color: white; }
.hero h1 { max-width: 970px; margin: 80px auto; text-align: center; font-size: clamp(48px, 9vw, 112px); font-weight: 300; letter-spacing: -.045em; line-height: .88; }
.is-chinese .hero h1 {
  max-width: 920px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "PingFang SC", serif;
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1.12;
}
.is-chinese .hero h1 span + span { margin-top: .16em; }
.is-chinese .hero-footer p { line-height: 1.8; }
.hero .eyebrow { color: var(--sand); }
.hero-footer { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding-top: 28px; border-top: 1px solid #858d88; }
.hero-footer p { max-width: 570px; margin: 0; color: #e6e0d4; font-size: 18px; }

h1, h2 { margin-top: 0; font-weight: 500; letter-spacing: -.025em; line-height: 1.08; }
h1 { margin-bottom: 18px; font-size: clamp(40px, 6vw, 70px); }
h2 { margin-bottom: 12px; font-size: clamp(27px, 3vw, 39px); }
.eyebrow { margin: 0 0 12px; color: #77613d; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.lede { max-width: 680px; color: var(--muted); font-size: 19px; }
.page-heading, .section-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin: 72px 0 28px; }
.page-heading { margin-top: 0; padding: 48px 0 28px; border-bottom: 1px solid var(--line); }
.page-heading > div { max-width: 760px; }
.section-heading h2 { margin: 0; font-size: clamp(36px, 5vw, 58px); }

.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.event-list { display: grid; gap: 12px; }
.event-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 220px 42px; align-items: center; gap: 28px; min-height: 172px; padding: 24px 28px; border: 1px solid var(--line); background: var(--paper); }
.event-row-date { display: flex; flex-direction: column; align-items: center; padding-right: 22px; border-right: 1px solid #d2c7b3; text-transform: uppercase; }
.event-row-date span, .event-row-date small { font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.event-row-date strong { font-size: 48px; font-weight: 400; line-height: 1; }
.event-row-main h2 { margin: 18px 0 8px; font-size: clamp(25px, 3vw, 36px); }
.event-row-main h2 a { text-decoration: none; }
.event-row-main .card-topline { justify-content: flex-start; color: var(--muted); font-size: 13px; }
.event-row-location { margin: 0; color: var(--muted); }
.event-row-times { margin: 0; }
.event-row-times div { grid-template-columns: 58px 1fr; padding: 8px 0; }
.row-arrow { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--black); text-decoration: none; font-size: 22px; }
.row-arrow:hover { background: var(--black); color: var(--paper); }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.pagination > :last-child { justify-self: end; }
.page-link { font-weight: 800; text-decoration: none; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 72px; }
.panel, .event-card { padding: 30px; border: 1px solid var(--line); background: var(--paper); }
.panel.inverse { border-color: #37423c; background: var(--forest-black); color: var(--paper); }
.panel.inverse .eyebrow { color: var(--sand); }
.panel.inverse p { color: #ded8cc; }
.event-card { min-height: 260px; display: flex; flex-direction: column; transition: transform .2s ease, background .2s ease; }
.event-card:hover { transform: translateY(-3px); background: #fffdf7; }
.event-card h2 { margin-top: 34px; font-size: 30px; }
.event-card h2 a { text-decoration: none; }
.event-card > p:not(.event-date) { color: var(--muted); }
.card-topline { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.event-date { margin: 0; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.status { display: inline-block; padding: 4px 9px; border: 1px solid #77766e; background: transparent; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.event-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; border-top: 1px solid #d2c7b3; font-size: 14px; }

.calendar-shell { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, .75fr); border: 1px solid var(--black); background: var(--paper); }
.calendar-panel { padding: clamp(22px, 4vw, 42px); }
.calendar-toolbar { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 14px; margin-bottom: 28px; }
.calendar-toolbar h3 { margin: 0; text-align: center; font-size: 25px; font-weight: 500; }
.calendar-nav { width: 46px; height: 42px; padding: 0; background: transparent; color: var(--black); font-size: 20px; }
.calendar-nav:disabled { border-color: #cfc9bc; background: #e7e3da; color: #a19d94; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.calendar-weekdays { margin-bottom: 7px; text-align: center; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.calendar-day, .calendar-blank { min-height: 66px; }
.calendar-day { position: relative; padding: 8px; border: 1px solid #cec6b7; background: var(--paper); color: var(--black); text-align: left; font-size: 14px; }
.calendar-day:hover:not(:disabled) { border-color: var(--black); background: var(--sand); }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px var(--black); }
.calendar-day.has-events { border-color: #215a37; background: #2f7d4c; color: white; }
.calendar-day.has-events:hover { background: #24643c; }
.calendar-day.is-selected { box-shadow: inset 0 0 0 3px var(--black); }
.calendar-day.is-past { border-color: #ddd8ce; background: #ddd9d0; color: #9a968d; opacity: 1; }
.calendar-count { position: absolute; right: 6px; bottom: 5px; font-size: 10px; font-weight: 800; }
.calendar-key { display: flex; gap: 20px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.key-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 1px solid #aaa; }
.event-dot { border-color: #215a37; background: #2f7d4c; }
.past-dot { background: #ddd9d0; }
.calendar-selection { padding: clamp(26px, 4vw, 44px); border-left: 1px solid var(--black); background: var(--forest-black); color: var(--paper); }
.calendar-selection .eyebrow { color: var(--sand); }
.calendar-selection h3 { margin: 0 0 12px; font-size: 29px; line-height: 1.1; }
.calendar-selection > p:not(.eyebrow) { color: #d8d1c5; }
.calendar-event { padding: 18px 0; border-top: 1px solid #5c645f; }
.calendar-event:first-of-type { margin-top: 24px; }
.calendar-event a { font-size: 19px; font-weight: 800; text-decoration: none; }
.calendar-event p { margin: 5px 0 0; color: #d8d1c5; font-size: 13px; }

.narrow { max-width: 680px; margin: 0 auto; }
.event-detail { max-width: 820px; margin: 0 auto; padding: clamp(28px, 6vw, 64px); }
.description { max-width: 680px; color: var(--muted); font-size: 19px; }
dl { margin: 34px 0 0; }
dl div { display: grid; grid-template-columns: 130px 1fr; padding: 15px 0; border-top: 1px solid #d2c7b3; }
dt { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
dd { margin: 0; }

label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; letter-spacing: .03em; }
input, textarea, select { width: 100%; padding: 12px 13px; border: 1px solid #918978; border-radius: 0; outline: none; background: #fffdf8; color: var(--black); font: inherit; }
input:focus, textarea:focus, select:focus { border-color: var(--black); box-shadow: 0 0 0 2px rgba(9, 12, 10, .12); }
input[type="checkbox"] { width: auto; margin-right: 8px; }
input[type="date"] { width: calc(58% - 5px); }
input[type="date"] + select { width: calc(42% - 5px); margin-left: 6px; }
.helptext { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.errorlist, .api-errors { color: #8d221b; }
.api-errors:not(:empty) { margin-bottom: 18px; padding: 12px; border: 1px solid #a75a50; background: #fff0eb; }

button, .button { display: inline-block; padding: 11px 18px; border: 1px solid var(--black); border-radius: 0; background: var(--black); color: var(--paper); text-decoration: none; font: 700 14px Arial, sans-serif; cursor: pointer; }
button:hover, .button:hover { background: #29302c; }
button.secondary, .button.secondary { background: transparent; color: var(--black); }
.button.ivory { border-color: var(--sand); background: var(--sand); color: var(--black); }
.button.ivory:hover { background: var(--paper); }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 12px; margin-top: 28px; }
.api-feedback { min-height: 24px; font-weight: 700; }
.results-system, .photo-section { margin-top: 52px; padding-top: 40px; border-top: 1px solid #d2c7b3; }
.results-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; }
.results-controls { display: grid; grid-template-columns: 180px 220px; gap: 10px; }
.results-controls label { margin: 0; }
.table-scroll { overflow-x: auto; margin-top: 24px; }
.ranking-table { width: 100%; border-collapse: collapse; background: #fffdf8; }
.ranking-table th, .ranking-table td { padding: 12px 14px; border: 1px solid #d2c7b3; text-align: center; }
.ranking-table thead th { background: var(--forest-black); color: var(--paper); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.ranking-table tbody th { text-align: left; }
.subheading { margin: 36px 0 6px; font-size: 24px; }
.result-key { margin-top: 0; color: var(--muted); font-size: 12px; }
.game-list { border-top: 1px solid #d2c7b3; }
.game-row { display: grid; grid-template-columns: 86px 1fr 64px 1fr; align-items: center; gap: 16px; padding: 14px 8px; border-bottom: 1px solid #d2c7b3; }
.game-row strong:first-of-type { text-align: right; }
.round-label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.game-score { padding: 5px; border: 1px solid var(--black); text-align: center; font-weight: 800; }
.filter-empty { padding: 14px; border: 1px solid #d2c7b3; color: var(--muted); }
.owner-tool { margin-top: 28px; border: 1px solid var(--line); background: #fffdf8; }
.owner-tool summary { padding: 14px 18px; font-weight: 800; cursor: pointer; }
.owner-tool form { padding: 4px 18px 20px; }
.saved-setups { margin: 28px 0 34px; padding: 20px; border: 1px solid var(--line); background: var(--ivory); }
.saved-setups-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; }
.saved-setups-heading h2 { margin: 0; font-size: 23px; }
.saved-setups-heading span { color: var(--muted); font-size: 12px; font-weight: 800; }
.setup-grid { display: grid; gap: 8px; margin-top: 16px; }
.setup-card { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px; border: 1px solid #c9bda7; background: var(--paper); }
.setup-card.is-selected { box-shadow: inset 4px 0 0 #2f7d4c; }
.setup-card > div:first-child { display: flex; flex-direction: column; }
.setup-card span { color: var(--muted); font-size: 12px; }
.setup-actions { display: flex; align-items: center; gap: 8px; }
.setup-actions form { margin: 0; }
.setup-actions .button { padding: 7px 10px; font-size: 12px; }
.text-button { padding: 7px 5px; border: 0; background: transparent; color: #842b22; font-size: 12px; }
.text-button:hover { background: transparent; text-decoration: underline; }
.empty-setup { margin: 0; color: var(--muted); }
.template-offer > p { color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.event-photo { margin: 0; border: 1px solid #d2c7b3; background: #fffdf8; }
.event-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.event-photo figcaption { padding: 10px 12px; color: var(--muted); font-size: 13px; }
.attendee-section { margin-top: 44px; padding-top: 34px; border-top: 1px solid #d2c7b3; }
.attendee-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0; list-style: none; }
.attendee-list li { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #d2c7b3; background: #fffdf8; }
.attendee-list .empty-player-list { grid-column: 1 / -1; color: var(--muted); }
.player-mark { font-size: 19px; }
.privacy-note { color: var(--muted); font-size: 12px; }

.message { margin-bottom: 18px; padding: 13px 16px; border: 1px solid #6a756e; background: var(--paper); }
.message.error { border-color: #9a3e34; }
.site-footer { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 44px max(24px, calc((100% - 1160px) / 2)); border-top: 1px solid #4c514e; background: var(--forest-black); color: var(--paper); }
.site-footer p { margin: 7px 0 0; color: #d5cdbf; }
.site-footer a { color: var(--paper); }
.footer-links { font-size: 13px; }
.footer-links a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

.privacy-summary {
  margin: 24px 0;
  padding: 20px;
  border-left: 4px solid #2f7d4c;
  background: #f3ead8;
}
.privacy-summary p { margin: 0 0 10px; }
.privacy-summary p:last-child { margin-bottom: 0; }

.password-field { margin: 1em 0; }
.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 74px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-width: 56px;
  padding: 6px 9px;
  transform: translateY(-50%);
  border-color: #777064;
  background: var(--paper);
  color: var(--black);
  font-size: 12px;
}
.password-toggle:hover { background: var(--sand); }
.password-strength { margin-top: 10px; padding: 14px; border: 1px solid #d2c7b3; background: #fffdf8; }
.strength-heading { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
.strength-heading strong { text-transform: uppercase; letter-spacing: .06em; }
.strength-track { height: 5px; margin: 9px 0 12px; overflow: hidden; background: #ded8cc; }
.strength-track span { display: block; width: 0; height: 100%; background: #9a3e34; transition: width .2s ease, background .2s ease; }
.password-strength[data-level="2"] .strength-track span { background: #b47618; }
.password-strength[data-level="3"] .strength-track span { background: #5d7d3c; }
.password-strength[data-level="4"] .strength-track span { background: #2f7d4c; }
.password-rules { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.password-rules li::before { display: inline-block; width: 18px; content: "•"; }
.password-rules li.is-valid { color: #22643a; }
.password-rules li.is-valid::before { content: "✓"; }
.password-rules li.is-invalid { color: #842b22; }
.password-rules li.is-invalid::before { content: "×"; }
.password-match { margin: 8px 0 0; font-size: 12px; font-weight: 700; }
.password-match.is-neutral { color: var(--muted); }
.password-match.is-valid { color: #22643a; }
.password-match.is-valid::before { margin-right: 6px; content: "✓"; }
.password-match.is-invalid { color: #842b22; }
.password-match.is-invalid::before { margin-right: 6px; content: "×"; }
.terms-consent { display: grid; grid-template-columns: auto 1fr; align-items: start; margin: 24px 0; padding: 15px; border: 1px solid #c9bda7; background: #f8f0df; }
.terms-consent input { margin-top: 4px; }
.terms-consent label { margin: 0; font-weight: 600; letter-spacing: 0; }
.terms-consent a { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.terms-consent .errorlist { grid-column: 1 / -1; }

.settings-heading { margin-bottom: 24px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-card h2 { font-size: 30px; }
.settings-card > p:not(.eyebrow), .legal-page > p { color: var(--muted); }
.request-list { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.request-list li, .request-item { padding: 16px; border: 1px solid #d2c7b3; background: #fffdf8; }
.request-list li span, .request-item span { display: block; color: var(--muted); font-size: 12px; }
.request-list li strong { display: inline-block; margin-top: 3px; }
.request-list li p, .request-item p { margin-bottom: 0; }
.owner-requests { margin-top: 24px; }
.request-item { display: grid; grid-template-columns: minmax(150px, .4fr) 1fr auto; align-items: start; gap: 20px; }
.request-item p { margin-top: 0; }
.danger-zone { margin-top: 48px; padding: 28px; border: 1px solid #9d4b42; background: #fff5ef; }
.danger-zone h2 { margin-bottom: 8px; }
.danger-zone details { margin-top: 18px; }
.danger-zone summary { font-weight: 800; cursor: pointer; }
.danger-zone form { max-width: 560px; margin-top: 20px; }
.danger-button { border-color: #812b24; background: #812b24; }
.danger-button:hover { background: #641f1a; }
.privacy-gate { padding-bottom: 4px; }

.dashboard-hero { display: flex; justify-content: space-between; align-items: end; gap: 28px; padding: clamp(30px, 5vw, 58px); background: var(--forest-black); color: var(--paper); }
.dashboard-hero h1 { margin-bottom: 12px; }
.dashboard-hero .lede { margin-bottom: 0; color: #ded8cc; }
.dashboard-section { margin-top: 48px; }
.section-heading.compact { margin: 0 0 18px; }
.verification-banner { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 24px; border: 1px solid #b38d38; background: #fff4cf; }
.verification-banner p { margin: 3px 0 0; }
.player-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.player-card { display: grid; grid-template-columns: 54px 1fr; gap: 16px; padding: 20px; border: 1px solid var(--line); background: var(--paper); }
.player-avatar { display: grid; width: 54px; height: 54px; place-items: center; background: var(--forest-black); color: var(--sand); font-size: 22px; }
.player-card h3 { margin: 1px 0 3px; font-size: 23px; }
.player-card span, .player-card p { color: var(--muted); font-size: 12px; }
.player-card p { margin: 0; }
.card-actions { grid-column: 2; display: flex; align-items: center; gap: 12px; }
.card-actions form { margin: 0; }
.booking-list, .dashboard-event-list { border-top: 1px solid var(--line); }
.booking-list article, .dashboard-event-list article { display: grid; grid-template-columns: 1.2fr 1fr auto; align-items: center; gap: 24px; padding: 18px 12px; border-bottom: 1px solid var(--line); }
.booking-list article > div, .dashboard-event-list article > div { display: flex; flex-direction: column; }
.booking-list span, .dashboard-event-list span { color: var(--muted); font-size: 13px; }
.booking-list a, .dashboard-event-list a { font-weight: 800; }
.muted-list { opacity: .82; }
.event-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.event-notes > div { padding: 18px; border: 1px solid #d2c7b3; background: #fffdf8; }
.event-notes h3 { margin: 0 0 5px; }
.event-notes p { margin: 0; color: var(--muted); }
.event-utility-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.registration-player-form, .verification-callout { margin-top: 20px; padding: 20px; border: 1px solid #c8baa1; background: #f8f0df; }
.registration-player-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 14px; }
.registration-player-form p { margin: 0; }
.verification-callout { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.verification-callout form { margin: 0; }
.game-row.has-admin { grid-template-columns: 86px 1fr 64px 1fr auto; }
.game-admin { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.game-admin form { margin: 0; }
.inline-admin-form { display: flex; align-items: end; gap: 8px; }
.inline-admin-form select { min-width: 230px; }
.roster-table td { text-align: left; }
.roster-table small { color: var(--muted); }
.roster-table form { margin: 0; }
.email-panel { margin-top: 22px; }
.email-panel form { max-width: 720px; }
.faq-page h2 { margin-top: 28px; }

.legal-page { max-width: 820px; margin: 0 auto; padding: clamp(28px, 5vw, 60px); border: 1px solid var(--line); background: var(--paper); }
.legal-page h2 { margin: 38px 0 8px; padding-top: 22px; border-top: 1px solid #d2c7b3; font-size: 25px; }
.legal-page .lede { color: var(--black); }
.legal-page a { text-underline-offset: 3px; }

/* Refined motion layer: deliberately progressive and dependency-free. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(16, 24, 20, .88);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  transition: padding .3s ease, background .3s ease, box-shadow .3s ease;
}
.site-header.is-scrolled {
  padding-top: 13px;
  padding-bottom: 13px;
  background: rgba(9, 12, 10, .94);
  box-shadow: 0 14px 38px rgba(9, 12, 10, .18);
}
.brand span { display: inline-block; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.brand:hover span { transform: rotate(-12deg) translateY(-2px); }
nav > a, nav .link-button { transition: border-color .2s ease, background .2s ease, color .2s ease; }
nav > a:hover, nav .link-button:hover { background: rgba(234, 215, 176, .08); }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  --spot-x: 50%;
  --spot-y: 45%;
}
.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle 340px at var(--spot-x) var(--spot-y), rgba(234, 215, 176, .16), transparent 68%),
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
  content: "";
  transition: opacity .35s ease;
}
.hero::after {
  position: absolute;
  z-index: -1;
  right: -120px;
  bottom: -210px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(234, 215, 176, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(234, 215, 176, .025), 0 0 0 110px rgba(234, 215, 176, .018);
  content: "";
}
.hero h1 span {
  display: block;
  opacity: 0;
  transform: translateY(55px);
  animation: hero-line-in .9s cubic-bezier(.16, 1, .3, 1) forwards;
}
.hero h1 span:nth-child(2) { animation-delay: .12s; }
.hero .eyebrow, .hero-footer {
  opacity: 0;
  animation: hero-detail-in .7s ease .34s forwards;
}
.hero-footer { animation-delay: .42s; }

.motion-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.16, 1, .3, 1), transform .7s cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.motion-reveal.is-revealed { opacity: 1; transform: translateY(0); }

.event-row, .event-card, .setup-card, .info-grid > .panel {
  transform-style: preserve-3d;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}
.event-row.is-tilting, .event-card.is-tilting, .setup-card.is-tilting, .info-grid > .panel.is-tilting {
  box-shadow: 0 20px 42px rgba(25, 31, 27, .12);
}
.event-row:hover { border-color: #7e7668; }
.event-card:hover { background: #fffdf7; }

.button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: color .22s ease, background .22s ease, border-color .22s ease, transform .22s ease;
}
.button::after {
  position: absolute;
  z-index: -1;
  top: -50%;
  left: -90%;
  width: 55%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  content: "";
  transform: skewX(-20deg);
  transition: left .6s cubic-bezier(.16, 1, .3, 1);
}
.button:hover { transform: translateY(-2px); }
.button:hover::after { left: 140%; }

@keyframes hero-line-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hero-detail-in {
  to { opacity: 1; }
}

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: page-out .18s ease both; }
::view-transition-new(root) { animation: page-in .42s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes page-out { to { opacity: 0; transform: scale(.992); } }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 800px) {
  .site-header, .page-heading, .section-heading, .hero-footer { align-items: flex-start; flex-direction: column; }
  .container { margin-top: 20px; }
  .hero { min-height: 500px; }
  .hero h1 { margin: 60px 0; text-align: left; }
  .info-grid, .site-footer { grid-template-columns: 1fr; }
  .calendar-shell { grid-template-columns: 1fr; }
  .calendar-selection { min-height: 260px; border-top: 1px solid var(--black); border-left: 0; }
  .event-row { grid-template-columns: 76px minmax(0, 1fr) 38px; gap: 18px; }
  .event-row-times { grid-column: 2 / -1; }
  .results-heading { align-items: stretch; flex-direction: column; }
  .results-controls { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .request-item { grid-template-columns: 1fr; }
  .dashboard-hero, .verification-banner { align-items: flex-start; flex-direction: column; }
  .booking-list article, .dashboard-event-list article { grid-template-columns: 1fr auto; }
  .booking-list article > div:nth-child(2) { grid-column: 1 / -1; }
  .event-notes { grid-template-columns: 1fr; }
  .registration-player-form { grid-template-columns: 1fr; }
  .game-row.has-admin { grid-template-columns: 1fr 52px 1fr; }
  .game-row.has-admin .game-admin { grid-column: 1 / -1; }
  .inline-admin-form { align-items: stretch; flex-direction: column; }
}
@media (max-width: 520px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: 12px; padding: 16px; }
  .brand { font-size: 14px; }
  nav { width: 100%; flex-wrap: nowrap; gap: 3px; padding-bottom: 4px; overflow-x: auto; overscroll-behavior-inline: contain; }
  nav > a, nav .link-button { padding: 7px 9px; white-space: nowrap; }
  .user-greeting { white-space: nowrap; }
  .container { width: min(100% - 20px, 1160px); }
  .hero { min-height: 430px; padding: 28px 22px; }
  .hero > .eyebrow { max-width: calc(100% - 128px); padding-right: 0; }
  .hero h1 { margin: 64px 0 46px; font-size: clamp(40px, 13vw, 54px); }
  .is-chinese .hero h1 {
    margin: 72px 0 44px;
    font-size: clamp(38px, 11.5vw, 50px);
    letter-spacing: .045em;
    line-height: 1.18;
  }
  .language-toggle { top: 16px; right: 16px; width: 134px; height: 43px; }
  .language-toggle-piece { right: 12px; font-size: 27px; }
  .language-toggle.is-chinese .language-toggle-piece { transform: translate(-90px, -52%); }
  .language-toggle.is-chinese .language-toggle-label { right: 10px; }
  .section-heading { margin-top: 54px; }
  .section-heading .button { width: 100%; text-align: center; }
  .card-topline, .event-meta { align-items: flex-start; flex-direction: column; }
  .event-row { grid-template-columns: 58px minmax(0, 1fr); padding: 20px 16px; }
  .event-row-date { padding-right: 12px; }
  .event-row-date strong { font-size: 38px; }
  .event-row-times { grid-column: 1 / -1; }
  .row-arrow { display: none; }
  .calendar-panel { padding: 18px 10px; }
  .calendar-toolbar { grid-template-columns: 40px 1fr 40px; gap: 8px; }
  .calendar-toolbar h3 { font-size: 20px; }
  .calendar-day, .calendar-blank { min-height: 48px; }
  .calendar-day { padding: 5px; }
  .calendar-count { display: none; }
  .calendar-key { flex-wrap: wrap; gap: 10px 16px; }
  .calendar-selection { min-height: 220px; padding: 26px 22px; }
  .info-grid { margin-top: 46px; }
  .panel, .event-card { padding: 24px 20px; }
  .attendee-list { grid-template-columns: 1fr; }
  .results-controls, .photo-grid { grid-template-columns: 1fr; }
  .setup-card { align-items: flex-start; flex-direction: column; }
  input[type="date"], input[type="date"] + select { width: 100%; margin-left: 0; }
  .game-row { grid-template-columns: 1fr 52px 1fr; gap: 8px; }
  .round-label { grid-column: 1 / -1; }
  dl div { grid-template-columns: 1fr; gap: 4px; }
  .actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .motion-reveal, .motion-reveal.is-revealed,
  .hero h1 span, .hero .eyebrow, .hero-footer {
    opacity: 1;
    transform: none;
  }
}
