:root {
  --bg1: #14213d;
  --bg2: #0b132b;
  --panel: #1c2b4f;
  --panel2: #243763;
  --accent: #fcbf49;
  --accent2: #f77f00;
  --text: #f4f7ff;
  --henry: #e63946;
  --theo: #3a86ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at 50% 0%, var(--bg1), var(--bg2) 70%) fixed;
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}
main { height: 100vh; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 8px; }
body { overflow: hidden; }
#screen-title, #screen-locker, #screen-wheel, #screen-pick, #screen-select { width: 1000px; max-width: none; transform-origin: center center; }
#title-canvas { width: 560px; height: 320px; }
#preview { width: 320px; height: 400px; }
#wheel { width: 560px; height: 610px; }
.screen { display: none; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 1200px; }
#screen-game { max-width: none; }
.screen.active { display: flex; }

h1 { margin: 0; text-align: center; font-size: clamp(34px, 7vw, 64px); line-height: 1; letter-spacing: 1px; text-shadow: 0 4px 0 #0006; }
h1 span { color: var(--accent); font-size: 1.35em; letter-spacing: 6px; }
h2 { margin: 0; font-size: 30px; text-shadow: 0 3px 0 #0006; }
.hint { opacity: .75; margin: 0; text-align: center; }

canvas { display: block; }
#game { max-width: 100%; height: auto; }
#title-canvas { filter: drop-shadow(0 8px 12px #0008); }

.btn {
  font: inherit; font-weight: 800; color: #1b1b1b; cursor: pointer;
  background: linear-gradient(#ffd166, var(--accent2));
  border: 0; border-radius: 16px; padding: 12px 22px;
  box-shadow: 0 5px 0 #a24f00, 0 8px 14px #0006;
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #a24f00; }
.btn.big { font-size: 24px; padding: 14px 34px; }
.btn.small { font-size: 15px; padding: 8px 14px; border-radius: 12px; box-shadow: 0 3px 0 #a24f00; }
.btn small { font-weight: 600; opacity: .7; font-size: .6em; }
.btn.alt { background: linear-gradient(#a9c4ff, #5b8def); box-shadow: 0 5px 0 #2a4a97, 0 8px 14px #0006; }
.btn.alt:active { box-shadow: 0 1px 0 #2a4a97; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }

.icon-btn {
  position: fixed; top: 10px; right: 10px; z-index: 20;
  width: 44px; height: 44px; font-size: 20px; cursor: pointer;
  border-radius: 50%; border: 2px solid #ffffff33; background: #0008; color: #fff;
}
.icon-btn.menu { position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; font-size: 18px; }
#mute { right: auto; left: 10px; }
#fs { right: auto; left: 62px; }

/* locker room */
.locker { display: grid; grid-template-columns: 340px 1fr; gap: 18px; width: 100%; align-items: start; }
.preview { background: var(--panel); border-radius: 20px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: inset 0 0 0 3px #ffffff14; }
.preview canvas { background: radial-gradient(circle at 50% 70%, #3b5ba5, #1b2a52); border-radius: 14px; }
.tabs { display: flex; gap: 8px; }
.tab { font: inherit; font-weight: 800; font-size: 18px; padding: 8px 22px; border-radius: 12px; border: 3px solid transparent; background: var(--panel2); color: var(--text); cursor: pointer; }
.tab.s0.active { background: var(--henry); }
.tab.s1.active { background: var(--theo); }
.options { background: var(--panel); border-radius: 20px; padding: 12px 16px; box-shadow: inset 0 0 0 3px #ffffff14; }
.opt { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid #ffffff14; }
.opt:last-child { border-bottom: 0; }
.opt .label { font-weight: 800; font-size: 17px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .val { flex: 1; text-align: center; font-weight: 700; min-width: 100px; }
.step { font: inherit; width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--panel2); color: var(--text); font-size: 15px; cursor: pointer; }
.step:hover { background: #34508f; }
.swatches { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #ffffff44; cursor: pointer; padding: 0; }
.swatch.sel { border-color: #fff; transform: scale(1.18); box-shadow: 0 0 0 2px #000a; }
.swatches.dim { opacity: .35; pointer-events: none; }
.opt.only-sw .swatches { grid-column: 2; }

.bottom { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; justify-content: center; }
.modes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mode { font: inherit; font-weight: 800; padding: 10px 14px; border-radius: 12px; border: 3px solid #ffffff33; background: var(--panel); color: var(--text); cursor: pointer; }
.mode.sel { border-color: var(--accent); background: var(--panel2); color: var(--accent); }

/* wheel */
.wheel-result { font-size: 26px; font-weight: 800; color: var(--accent); margin: 0; min-height: 34px; }

/* game */
#game-wrap { position: relative; width: min(calc(100vw - 16px), calc((100vh - 16px) * 1.6)); border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px #000a, 0 0 0 4px #ffffff22; }
#game { width: 100%; background: #000; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #060d1fcc; padding: 14px; }
.overlay.hidden { display: none; }
.card { background: var(--panel); border-radius: 22px; padding: 22px 28px; text-align: center; max-width: 560px; box-shadow: 0 10px 30px #000a, inset 0 0 0 3px #ffffff1a; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.card h3 { margin: 0; font-size: 34px; color: var(--accent); }
.card p { margin: 0; line-height: 1.45; }
.card .help { text-align: left; }
.card .help li { margin: 3px 0; }
.card .ctrl { font-size: 14px; opacity: .8; }
.card canvas { border-radius: 14px; background: radial-gradient(circle at 50% 70%, #3b5ba5, #1b2a52); }


.sport-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; width: 100%; }
.sport-card {
  font: inherit; color: var(--text); cursor: pointer; text-align: center;
  background: var(--panel); border: 3px solid var(--c, #ffffff33); border-radius: 18px;
  padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: 0 5px 0 #0006; transition: transform .1s, background .15s;
}
.sport-card:hover, .sport-card:focus-visible { transform: translateY(-4px); background: var(--panel2); outline: none; }
.sport-card:active { transform: translateY(1px); }
.sport-card .ico { font-size: 44px; line-height: 1.1; }
.sport-card .nm { font-weight: 800; font-size: 17px; }
.sport-card .bl { font-size: 12px; opacity: .75; min-height: 30px; }

/* character select */
.slots { display: flex; align-items: center; justify-content: center; gap: 22px; }
.vs { font-weight: 900; font-size: 34px; color: var(--accent); text-shadow: 0 3px 0 #0006; }
.slot {
  font: inherit; color: var(--text); cursor: pointer; background: var(--panel); border: 4px solid #ffffff22; border-radius: 22px;
  padding: 8px 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 6px 0 #0006; transition: border-color .15s, transform .1s;
}
.slot canvas { width: 190px; height: 210px; background: radial-gradient(circle at 50% 75%, #3b5ba5, #1b2a52); border-radius: 14px; }
.slot.active { border-color: var(--accent); transform: translateY(-3px); }
.slot.s0 .slot-title { color: #ff8a93; } .slot.s1 .slot-title { color: #8ab8ff; }
.slot-title { font-weight: 900; letter-spacing: 2px; font-size: 14px; }
.slot-name { font-weight: 900; font-size: 22px; }
.char-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; width: 100%; }
.char-card {
  position: relative; font: inherit; color: var(--text); cursor: pointer; background: var(--panel); border: 3px solid #ffffff22; border-radius: 16px;
  padding: 6px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .1s, background .15s;
}
.char-card canvas { width: 120px; height: 150px; border-radius: 10px; background: radial-gradient(circle at 50% 80%, #34508f, #1b2a52); }
.char-card:hover { transform: translateY(-3px); background: var(--panel2); }
.char-card .nm { font-weight: 800; font-size: 16px; }
.char-card.s0 { border-color: var(--henry); } .char-card.s1 { border-color: var(--theo); }
.char-card .badge { position: absolute; top: 6px; left: 6px; font-weight: 900; font-size: 12px; padding: 2px 7px; border-radius: 9px; color: #fff; }
.char-card.s0 .badge { background: var(--henry); } .char-card.s1 .badge { background: var(--theo); }
