.live-shell{max-width:1100px;margin:auto;padding:0 20px 45px}
.live-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:16px 0;border-bottom:1px solid var(--edge);margin-bottom:25px}
.live-header nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.live-shell main{padding:0;margin:0;max-width:none}
.live-form{max-width:580px}.live-form form{margin-top:12px}
.live-form h2{margin-top:0}
.live-inline{display:flex;gap:8px;align-items:center}
.live-inline select{width:auto;min-width:68px}
.live-shell .live-card-list{margin-top:15px}
.live-shell .score-entry-actions{flex-wrap:nowrap}
#notice{position:fixed;bottom:12px;right:14px;z-index:8;padding:11px 15px;max-width:calc(100% - 28px);background:#243228;border:1px solid #659270;border-radius:8px;color:#f4faf3}
#notice[data-error]{background:#482921;border-color:#a56750}
@media(max-width:560px){.live-shell{padding-inline:12px}.live-header{margin-bottom:17px}.live-header nav{width:100%}.live-shell .score-entry-actions{flex-wrap:wrap}.live-inline{gap:5px}.live-inline button{padding-inline:7px}}
.live-roster{position:static;height:auto;display:block}
.live-roster .row{border-color:var(--edge)}
.live-shell button:disabled{opacity:.5;cursor:not-allowed}

.auth-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(340px,.9fr);min-height:560px;border:1px solid #654731;border-radius:20px;overflow:hidden;background:#261b16;box-shadow:0 22px 60px #0a070649}
.auth-art{position:relative;min-height:100%;display:flex;align-items:end;padding:32px;background:linear-gradient(0deg,#180e0bf5,transparent 68%),url("/tavern-hero.webp") 79% center/cover no-repeat;border-right:1px solid #654731}
.auth-art-copy h2{font-family:"Songti SC","Noto Serif CJK SC",serif;font-size:clamp(24px,4.5vw,45px);line-height:1.16;letter-spacing:.03em;margin:11px 0 7px;color:#fff0d4}
.auth-art-copy p{margin:0;color:#e9c8a9}
.auth-panel{padding:clamp(24px,4vw,49px);background:radial-gradient(ellipse at 100% 0,#402a1b,#261b16 67%)}
.auth-tabs{display:flex;gap:5px;border:1px solid #5b4232;border-radius:10px;padding:4px;background:#1d1512}
.auth-tabs a{flex:1;text-align:center;padding:8px 12px;font-weight:700;border-radius:7px;color:#d0b9a5}
.auth-tabs a[aria-current]{background:#523823;color:#ffe0ad;box-shadow:inset 0 0 0 1px #936640}
.auth-heading{margin:24px 0 20px}
.auth-heading h1{margin:0;font-size:clamp(25px,4vw,36px);line-height:1.2;color:#fff3e2}
.auth-heading p{margin:6px 0 0;color:var(--muted)}
.auth-form{display:grid;gap:14px}
.auth-form label{font-weight:650;color:#f1dcc6}
.auth-form input{min-height:45px}
.auth-form input:focus-visible{outline:2px solid #edb66a;outline-offset:1px}
.auth-form>small{margin-top:-10px}
.password-field{display:grid;gap:6px}
.password-input{display:flex;gap:5px;align-items:center}
.password-input input{min-width:0}
.password-toggle{padding:8px;font-size:12px;color:#ffd69d;min-height:42px}
.auth-submit{width:100%;min-height:45px;background:linear-gradient(#ffd594,#edac58);border-color:#efb56c;box-shadow:inset 0 1px #fff0c5}
.auth-error{border-left:2px solid #e48a72;padding:7px 9px;background:#4a2822;color:#ffcab9;margin:0;font-size:13px}
.auth-back{display:inline-block;margin-top:16px;font-size:13px;color:#d9b999}
.auth-back:hover{color:#ffe0ac}
@media(max-width:760px){.auth-layout{grid-template-columns:1fr;min-height:0;max-width:530px;margin:auto}.auth-art{min-height:168px;padding:16px 20px;border-right:0;border-bottom:1px solid #654731;background-position:center,77% 48%}.auth-panel{padding:20px}.auth-art-copy h2{font-size:27px}.auth-heading{margin:19px 0 16px}}

/* Responsive application shell */
.live-shell{
  width:100%;
  max-width:none;
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  padding:0 clamp(12px,3vw,56px) clamp(14px,3vw,45px);
}
.live-header{flex:none}
.live-shell>main{flex:1;min-width:0;width:100%;margin:0}
.live-shell>main:has(.auth-layout){display:flex}
.auth-layout{
  width:100%;
  max-width:none;
  min-width:0;
  flex:1;
  grid-template-columns:minmax(0,1.35fr) minmax(360px,1fr);
}
.auth-art{min-width:0;min-height:0;background-position:center,75% center}
.auth-panel{min-width:0;display:flex;flex-direction:column;justify-content:center;align-items:stretch}
.auth-panel>*{width:100%;max-width:520px;margin-inline:auto}
.auth-panel .auth-back{width:100%}
.live-shell .hero{min-height:clamp(265px,46vh,540px)}
.live-shell .cards{grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))}
.live-card-list:has(>.card:only-child){grid-template-columns:minmax(0,1fr)}
.live-shell .card,.live-shell .score-layout,.live-shell .live-header nav{min-width:0}
.live-shell .score-layout{grid-template-columns:minmax(0,1.65fr) minmax(240px,1fr)}
.live-shell h1,.live-shell h2,.live-shell h3,.live-shell p,.live-shell .score-player strong,.live-roster strong{overflow-wrap:anywhere}
.live-shell .live-form{width:100%}
@media(max-width:900px){
 .live-shell .score-layout{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:760px){
 .live-header{margin-bottom:12px}
 .auth-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(150px,28vh) minmax(min-content,1fr)}
 .auth-art{min-height:150px;background-position:center,77% 48%}
 .auth-panel{justify-content:flex-start;padding:clamp(14px,4vw,25px)}
 .live-shell .hero{min-height:clamp(238px,39vh,360px)}
}

/* A low-contrast tavern scene sits behind the working surfaces. */
.live-shell{position:relative;isolation:isolate}
.tavern-backdrop{position:fixed;inset:0;z-index:-1;pointer-events:none;
 background:
   linear-gradient(180deg,#21161155 0%,#19120edd 63%,#17110efc 100%),
   linear-gradient(90deg,#180f0df5 3%,#201410bc 53%,#24171278 100%),
   url("/tavern-hero.webp") 77% 44%/cover no-repeat;
}
.tavern-backdrop::after{content:"";position:absolute;inset:0;background:
 radial-gradient(ellipse at 85% 22%,#ce82242b,transparent 46%),
 radial-gradient(ellipse at 11% 84%,#81432431,transparent 55%),
 repeating-linear-gradient(135deg,transparent 0 23px,#f0bc7308 24px,transparent 25px 34px);
}
.live-header{border-image:linear-gradient(90deg,#99633c,#745238,#5a3c2b55) 1}
.live-shell .section-head h2{display:flex;align-items:center;gap:10px}
.live-shell .section-head h2::before{content:"";width:8px;height:8px;border:1px solid #e5ac65;background:#7b4a2a;transform:rotate(45deg);box-shadow:0 0 12px #f2aa6370}
.live-shell .panel,.live-shell .card{border-color:#674b38}
.live-shell .auth-layout{box-shadow:0 22px 70px #0e0807ba}
@media(max-width:760px){.tavern-backdrop{background-position:center,center,72% center}}
.event-instructions{white-space:pre-wrap}
.live-shell [data-form=sponsor]{margin-top:12px}

/* Arena art and subtle magic, shared across the live player pages. */
body:not(.admin-view){--bg:#15121e;--panel:#241f2c;--edge:#504052;--text:#fff1e9;--muted:#cbbbc5}
.live-shell .tavern-backdrop{background:
 linear-gradient(180deg,#14102080,#18121eea 69%,#17111af9),
 linear-gradient(90deg,#161020ef,#31204375),
 url("/arena-v2.webp") 76% 48%/cover no-repeat;
}
.live-shell .tavern-backdrop::after{background:
 radial-gradient(ellipse at 80% 21%,#8d64bb30,transparent 52%),
 radial-gradient(ellipse at 18% 78%,#ac5d2320,transparent 54%);
}
body:not(.admin-view) .live-shell .hero{background:#1d1526;border-color:#9b7251;box-shadow:0 0 0 3px #292033a6;min-height:clamp(260px,46vh,500px)}
.live-shell .hero-art{background:
 linear-gradient(90deg,#1b1328 0,#1c1528ec 24%,#21163074 49%,transparent 78%),
 url("/arena-v2.webp") 76% 48%/cover no-repeat;
}
.live-shell .hero-art::after,.event-stage::after{content:"";position:absolute;inset:0;pointer-events:none;background:
 radial-gradient(ellipse at 78% 58%,#82d2ff25,transparent 35%),
 radial-gradient(circle at 65% 53%,#ffd893 0 1px,transparent 3px),
 radial-gradient(circle at 91% 75%,#ed944e 0 1px,transparent 4px),
 radial-gradient(circle at 72% 73%,#eab688 0 1px,transparent 3px);
 animation:arena-sparks 8s ease-in-out infinite alternate;
}
@keyframes arena-sparks{0%,100%{opacity:.28;transform:translateY(6px)}50%{opacity:.82;transform:translateY(-5px)}}
.event-stage{position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:center;min-height:clamp(215px,35vh,350px);padding:clamp(20px,4vw,54px);margin-bottom:18px;border:1px solid #96704f;border-radius:18px;background:
 linear-gradient(90deg,#21182eea 7%,#241934d9 36%,#261c4460 72%),
 url("/arena-v2.webp") 78% 63%/cover no-repeat;
}
.event-stage>div{z-index:1}
.event-stage h1{font-size:clamp(29px,5vw,53px);margin:0;line-height:1.11;color:#fff0d9;text-shadow:0 4px 13px #180e26;letter-spacing:.015em}
.event-stage p{color:#eedcdb;margin:8px 0 19px}
.event-stage .quiet{background:#281c37;color:#f8e9dd;border-color:#765d79}
.live-shell .auth-art{background:linear-gradient(0deg,#1c1327ee,transparent 70%),url("/arena-v2.webp") 76% center/cover no-repeat}
.live-shell .auth-panel{background:radial-gradient(ellipse at 100% 0,#402d49,#241b2c 65%)}
body:not(.admin-view) .live-shell .panel,body:not(.admin-view) .live-shell .car-card{background:linear-gradient(145deg,#302636,#221b26 74%);border-color:#564352}
.live-shell .card-emblem,.live-shell .table-crest{box-shadow:inset 0 0 0 2px #4b304e,0 0 16px #dba06f2a}
@media(max-width:760px){
 .live-shell .hero-art,.event-stage{background-position:center,70% center}
 .live-shell .hero-art{background-image:linear-gradient(90deg,#1b1328ed,#211630a5 57%,#25152f46),url("/arena-v2.webp")}
 .live-shell .auth-art{background-position:center,72% 54%}
}
@media(prefers-reduced-motion:reduce){.live-shell .hero-art::after,.event-stage::after{animation:none;opacity:.4}}



/* One illustrated scene supplies the characters and the environment. */
.live-shell .hero-art{background:
 linear-gradient(90deg,#1b1328 0,#1c1528dc 25%,#21163054 53%,transparent 79%),
 url("/arena-v4.webp") 72% 53%/cover no-repeat,#1b1328}
.live-shell .event-stage{background:
 linear-gradient(90deg,#21182eee 7%,#241934b9 38%,#261c4434 76%),
 url("/arena-v4.webp") 73% 65%/cover no-repeat,#21182e}
.live-shell .auth-art{background:linear-gradient(0deg,#1c1327f0,transparent 70%),
 url("/arena-v4.webp") 73% 52%/cover no-repeat,#21182e}
.live-shell .tavern-backdrop{background:
 linear-gradient(180deg,#141020a5,#18121eef 64%,#17111afc),
 linear-gradient(90deg,#161020ed,#3120437a),
 url("/arena-v4.webp") 76% 47%/cover no-repeat,#161020}
@media(max-width:760px){
 .live-shell .hero-art{background-image:linear-gradient(90deg,#1b1328ef,#211630a0 56%,#25152f34),url("/arena-v4.webp");background-position:center,68% 50%}
 .live-shell .event-stage,.live-shell .auth-art{background-position:center,75% 50%}
}
.reward-form{padding:10px;border:1px solid var(--edge);border-radius:9px;margin:8px 0}
.moderation-filters{margin-bottom:13px}

/* Recruitment and daily scoreboards */
body:not(.admin-view) .live-shell .hall-hero {
  min-height: clamp(220px, 32vh, 330px);
  margin-bottom: 24px;
}
.my-locked-cars, .recruiting-cars { margin-block: 24px; }
.hall-empty {
  margin: 0;
  padding: 16px 20px;
  border: 1px dashed #6e576c;
  border-radius: 12px;
  color: var(--muted);
  background: #211927b8;
}
.live-shell .locked-card {
  border-inline-start: 3px solid #78c5a9;
}
.live-shell .car-card {
  min-width: 0;
  transition: border-color .18s, background-color .18s;
  overflow-wrap: anywhere;
}
.live-shell .car-card:hover, .live-shell .car-card:focus-visible { border-color: #dfaa70; }
.car-card-status, .car-capacity {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.car-capacity { color: var(--muted); font-size: .875rem; }
.car-capacity strong { color: #ffe2b7; font-variant-numeric: tabular-nums; }
.recruiting-card .car-capacity { margin-top: auto; }
.tavern-progress {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 6px;
  appearance: none;
  border: 0;
  border-radius: 9px;
  overflow: hidden;
  background: #514050;
  color: #e9ad69;
}
.tavern-progress::-webkit-progress-bar { background: #514050; }
.tavern-progress::-webkit-progress-value { background: #e9ad69; border-radius: 9px; }
.tavern-progress::-moz-progress-bar { background: #e9ad69; border-radius: 9px; }
.score-progress { margin-block: 16px; }
.score-entries {
  padding-inline: clamp(8px, 2vw, 16px);
  border: 1px solid #695465;
  border-radius: 12px;
  background: #18131f85;
}
.score-entries:empty { display: none; }
.score-entries .score-entry:last-child { border-bottom: 0; }
.current-score .score-player { min-width: 0; overflow-wrap: anywhere; }
.current-score .rank-medal { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.current-score .rank-medal[data-rank=""] { color: #d9c8d4; background: #302735; border-color: #695465; }
.current-score .rank-medal[data-rank="1"] { color: #302015; background: #f4bb70; border-color: #ffdaa0; }
.current-score select { min-height: 44px; }
@media (max-width: 600px) {
  body:not(.admin-view) .live-shell .hall-hero { min-height: 210px; }
  .my-locked-cars, .recruiting-cars { margin-block: 18px; }
}

.current-score .score-entry { position: relative; flex-wrap: wrap; }
.current-score .score-entry:has(.rank-picker[open]) .score-player { max-width: calc(100% - 112px); min-height: 44px; }
.rank-picker { margin-inline-start: auto; }
.rank-picker summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 92px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #94704c;
  border-radius: 10px;
  color: #ffdfb0;
  background: #392a30;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.rank-picker summary::-webkit-details-marker { display: none; }
.rank-picker summary:hover, .rank-picker[open] summary { background: #523744; }
.rank-chevron {
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: translateY(-2px) rotate(45deg);
}
.rank-picker[open] .rank-chevron { transform: translateY(2px) rotate(225deg); }
.rank-picker[open] { flex: 0 0 100%; }
.rank-picker[open] summary { position: absolute; inset: 10px 0 auto auto; }
.rank-choices {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  margin-top: 5px;
}
.rank-choice {
  min-height: 44px;
  padding: 0;
  border: 1px solid #846676;
  border-radius: 8px;
  background: #332735;
  color: #fff0df;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.rank-choice:hover:enabled { border-color: #ffc888; background: #523848; }
.rank-choice[aria-pressed="true"] { background: #f4bb70; color: #302015; border-color: #ffdaa0; }
.rank-choice:disabled { opacity: .65; text-decoration: line-through; }
.rank-picker :is(summary,button):focus-visible { outline: 2px solid #ffd594; outline-offset: 2px; }
@media (max-width: 480px) {
  .rank-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.event-standings, .event-game-results { list-style: none; margin: 0; padding: 0; }
.event-standings > li { padding: 12px 0; border-bottom: 1px solid var(--edge); }
.event-standings > li:last-child { border-bottom: 0; }
.event-standing-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; overflow-wrap: anywhere; }
.event-standing-head .score-points { margin-inline-start: auto; white-space: nowrap; }
.event-game-results { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.event-game-results li { padding: 4px 8px; border-radius: 6px; background: #18131f85; color: var(--muted); font-size: .85rem; }

.event-desk { margin-top: 12px; border: 1px solid #695465; border-radius: 12px; background: #18131f85; }
.event-desk > summary { padding: 12px; cursor: pointer; }
.event-desk > summary .badge, .event-desk > summary small { margin-inline-start: 8px; }
.event-game-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0 12px 12px; list-style: none; }
.event-game-steps li { padding: 5px 8px; border: 1px solid #695465; border-radius: 8px; }
.event-game-steps small { display: block; }
.event-game-steps [aria-current="step"] { border-color: #dfa36a; color: #ffdfb0; background: #392a30; }
.event-game-steps [data-state="已确认"] { border-color: #588d7d; }
.event-report-body { padding: 0 12px 12px; }
.event-report .score-entry { position: relative; flex-wrap: wrap; gap: 8px; }
.event-seat-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.event-report .score-entry:has(.rank-picker[open]) .event-seat-name { max-width: calc(100% - 110px); min-height: 44px; }
.event-own-seat .event-seat-name strong { color: #ffdfb0; }
@media (max-width: 650px) {
  .event-report .rank-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.event-detail-grid {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) clamp(250px, 31%, 390px);
  gap: clamp(12px, 2vw, 24px);
}
.event-support-column .panel { overflow-wrap: anywhere; }
.event-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0 0; }
.event-facts > div { min-width: 0; border-top: 1px solid var(--edge); padding-top: 7px; }
.event-facts dt { color: var(--muted); font-size: .82rem; }
.event-facts dd { margin: 3px 0 0; font-weight: 600; }
.event-detail-grid form :is(input, select, textarea) { max-width: 100%; }
.event-detail-grid > .stack { min-width: 0; }
.event-pool-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 14px; }
.event-pool-total h2 { margin: 0; }
.event-pool-total strong { color: #ffdfb0; font-size: 1.35rem; }
.event-pool-details { margin-top: 10px; border-top: 1px solid var(--edge); padding-top: 8px; }
.event-pool-details summary, .event-draw-round summary { cursor: pointer; }
.event-draw-round { margin-top: 10px; border: 1px solid var(--edge); border-radius: 10px; padding: 10px; }
.event-draw-round summary small { margin-inline-start: 6px; color: var(--muted); }
.event-draw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 10px; margin-top: 10px; }
.event-draw-table { min-width: 0; padding: 10px; background: #18131f85; border-radius: 8px; }
.event-draw-table header, .event-draw-table li { display: flex; align-items: center; gap: 7px; }
.event-draw-table header { justify-content: space-between; }
.event-draw-table h3 { margin: 0; }
.event-draw-table ol { list-style: none; margin: 6px 0 0; padding: 0; }
.event-draw-table li { padding: 7px 0; border-top: 1px solid var(--edge); }
.event-draw-table li strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.event-draw-table li .badge { white-space: nowrap; }
@media (max-width: 760px) {
  .event-detail-grid { grid-template-columns: minmax(0, 1fr); }

}

.template-details { margin-top: 12px; border-top: 1px solid var(--edge); padding-top: 10px; }
.template-details summary { width: fit-content; cursor: pointer; color: #ffdfb0; font-weight: 600; }
.template-example { margin: 16px 0; }
.template-example figcaption { margin-bottom: 10px; font-weight: 700; }
.template-flow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 22px; list-style: none; padding: 0; margin: 0; }
.template-flow > li { position: relative; padding: 12px; border: 1px solid #695465; border-radius: 10px; background: #18131f85; }
.template-flow > li:not(:last-child)::after { content: "→"; position: absolute; top: 50%; left: 100%; width: 22px; text-align: center; transform: translateY(-50%); color: #ffcf8d; }
.template-flow h4 { margin: 0 0 8px; }
.template-flow h4 small { margin-inline-start: 5px; color: #ffdfb0; }
.template-tables { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.template-tables span { padding: 4px 7px; border-radius: 5px; background: #46343f; }
.template-details ul { margin: 8px 0 0; padding-inline-start: 22px; color: var(--muted); }
.template-details ul li + li { margin-top: 5px; }
@media (max-width: 600px) {
  .template-flow { grid-auto-flow: row; }
  .template-flow > li:not(:last-child)::after { content: "↓"; top: 100%; left: 50%; transform: translateX(-50%); }
}


.profile-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.profile-stat-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 0; }
.profile-stat-card dl > div { min-width: 0; background: #18131f85; padding: 9px; border-radius: 8px; }
.profile-stat-card dt { color: var(--muted); font-size: .85rem; }
.profile-stat-card dd { margin: 3px 0 0; color: #ffdfb0; font-size: clamp(1.1rem, 2.4vw, 1.5rem); font-weight: 750; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.profile-stat-note { margin: 0; }
