:root { font: 16px/1.5 system-ui, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
.shell { width: min(63rem, calc(100% - 1.5rem)); margin-inline: auto; }
.mast { border-bottom: 1px solid; }
.mast .shell { display: flex; justify-content: space-between; align-items: center; min-height: 3.4rem; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-weight: 850; letter-spacing: .09em; }
.hero { padding: clamp(1rem, 3vw, 2.25rem) 0 1rem; }
.hero h1 { margin: 0; }
.kicker, .pit-label { font: 750 .74rem/1.35 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 .35rem; }
.hero p:last-child { margin: .65rem 0 0; max-width: 44rem; }
:focus-visible { outline: 2px solid #b25a21; outline-offset: 3px; }

.game {
  --text: #f6f4ea;
  --pit-muted: #c4cac6;
  --pit-edge: #46534d;
  --pit-accent: #ff774c;
  --pit-rail: #182722;
  --pit-panel: #202e29;
  color: var(--text);
  background: #101c18;
  border: 1px solid var(--pit-edge);
  border-radius: .75rem;
  overflow: hidden;
}
.game :focus-visible { outline-color: var(--pit-accent); }
.game button, .game input, .game select, .game textarea { font: inherit; }
.game button, .game input, .game select {
  border: 1px solid var(--pit-edge);
  border-radius: .4rem;
  color: var(--text);
  background: var(--pit-panel);
  padding: .48rem .65rem;
  min-height: 2.75rem;
}
.game button { font-weight: 750; cursor: pointer; }
.game button:hover:not(:disabled) { border-color: var(--pit-accent); }
.game button:disabled { opacity: .65; cursor: default; }
.game .primary { background: var(--pit-accent); color: #251611; border-color: var(--pit-accent); }
.pit-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem;
  background: #0c1713;
  border-bottom: 1px solid var(--pit-edge);
  padding: .6rem clamp(.75rem, 3vw, 1.25rem);
  font: 800 .7rem/1.3 ui-monospace, monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.pit-strip b { color: var(--pit-accent); }
.chequer {
  width: 1.45rem;
  height: 1rem;
  background: conic-gradient(var(--pit-accent) 25%, #38251d 0 50%, var(--pit-accent) 0 75%, #38251d 0) 0 0 / .52rem .52rem;
  transform: skewX(-16deg);
}
.pane { padding: clamp(.75rem, 3vw, 1.25rem); }
.pane :is(h2,h3,p) { margin: 0 0 .55rem; }
.pane h2 { font-size: clamp(1.22rem, 3vw, 1.8rem); line-height: 1.15; }
.pane h3 { font-size: 1.1rem; line-height: 1.3; }
.pane p { color: var(--pit-muted); }
.pane p:empty { display: none; }
.identity-grid { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: .6rem; margin: .75rem 0; }
.identity-grid label { display: grid; gap: .18rem; min-width: 0; font-size: .82rem; color: var(--pit-muted); }
.identity-grid :is(input,select) { width: 100%; font-size: 1rem; }
.driving { min-inline-size: 0; padding: 0; margin: .6rem 0 .85rem; border: 0; }
.driving legend { margin-bottom: .35rem; color: var(--pit-muted); font-size: .82rem; }
.style-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.style-grid label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: start;
  gap: .16rem .4rem;
  padding: .45rem .55rem;
  background: var(--pit-panel);
  border: 1px solid var(--pit-edge);
  border-radius: .45rem;
  cursor: pointer;
}
.style-grid label:has(:checked) { border-color: var(--pit-accent); background: #39271f; }
.style-grid label:has(:focus-visible) { outline: 2px solid var(--pit-accent); outline-offset: 2px; }
.style-grid input { min-height: 0; margin: 0; align-self: center; accent-color: var(--pit-accent); }
.style-grid small { grid-column: 2; color: var(--pit-muted); font-size: .75rem; line-height: 1.35; }
.style-description { display: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .8rem; }
.actions a { color: #ffae90; }
.driver { display: grid; grid-template-columns: 1fr auto; gap: .45rem 1rem; background: var(--pit-rail); }
.driver h2 { overflow-wrap: anywhere; }
.driver .pit-label { color: var(--pit-accent); }
.driver p { font-size: .86rem; margin-bottom: .2rem; }
.rating { font: 850 clamp(1.6rem, 6vw, 3.2rem)/.96 ui-monospace, monospace; color: var(--pit-accent); text-align: end; }
.rating small { display: block; font-size: .67rem; letter-spacing: .12em; color: var(--pit-muted); }
.stat-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: .35rem; grid-column: 1 / -1; }
.stat-grid div { padding: .43rem .45rem; background: #101c18; border-top: 2px solid #53655c; border-radius: .16rem; }
.stat-grid strong { display: block; font: 800 1.05rem/1.2 ui-monospace, monospace; }
.stat-grid span { display: block; font-size: .72rem; color: var(--pit-muted); overflow-wrap: anywhere; }
.ladder, .views { display: flex; flex-wrap: wrap; padding: 0; margin: 0; gap: .35rem; }
.ladder { grid-column: 1 / -1; list-style: none; }
.ladder li { padding: .12rem .45rem; border: 1px solid var(--pit-edge); color: var(--pit-muted); border-radius: .25rem; font-size: .74rem; }
.ladder [aria-current] { color: #271710; background: var(--pit-accent); border-color: var(--pit-accent); font-weight: 800; }
.views { padding: .5rem clamp(.75rem, 3vw, 1.25rem); border-bottom: 1px solid var(--pit-edge); }
.views [aria-pressed="true"] { border-color: var(--pit-accent); color: #ffae90; }
.choice-list { display: grid; gap: .45rem; }
.game .choice { display: flex; align-items: center; justify-content: space-between; gap: .55rem; width: 100%; padding: .65rem; text-align: start; }
.choice small { display: block; color: var(--pit-muted); font-size: .78rem; font-weight: 500; }
.choice b { color: #ffae90; font-size: .72rem; white-space: nowrap; }
#retired-area { padding: .8rem; border: 1px solid var(--pit-accent); background: var(--pit-rail); border-radius: .4rem; }
#notice, #share-status { margin: .6rem .75rem; color: #ffbca4; }
#notice:empty, #share-status:empty { display: none; }
#manual-share { display: grid; gap: .3rem; }
#share-text { width: 100%; color: var(--text); background: #101c18; border: 1px solid var(--pit-edge); min-height: 5rem; }
.game details { border-top: 1px solid var(--pit-edge); padding: .55rem 0; }
.game summary { cursor: pointer; font-weight: 700; }
.table-wrap { overflow-x: auto; }
.game table { border-collapse: collapse; width: 100%; min-width: 18rem; font-size: .8rem; }
.game th, .game td { text-align: start; padding: .4rem; border-bottom: 1px solid var(--pit-edge); }
.game .you { color: #ffae90; }
.guide { max-width: 46rem; }
.guide summary { font-weight: 750; cursor: pointer; padding: .5rem 0; }
.guide details { border-top: 1px solid; }

@media (max-width: 36rem) {
  .identity-grid { grid-template-columns: 1fr 5.1rem; }
  .identity-grid label:last-child { grid-column: 1 / -1; }
  .pit-strip { gap: .45rem; font-size: .64rem; letter-spacing: .06em; }
  .solo-label { display: none; }
  .views button { font-size: .82rem; padding-inline: .48rem; }
  .style-grid label { display: flex; align-items: center; gap: .23rem; min-height: 2.55rem; padding: .3rem; }
  .style-grid input { width: .68rem; }
  .style-grid strong { font-size: .71rem; }
  .style-grid small { display: none; }
  .style-description { display: block; margin: .4rem 0 0 !important; min-height: 2.1rem; font-size: .74rem; line-height: 1.38; }
  .stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .choice b { max-width: 6rem; white-space: normal; text-align: end; }
}
