@font-face { font-family: 'Outfit'; src: url(fonts/Outfit-Regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url(fonts/Outfit-Bold.ttf) format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Tektur'; src: url(fonts/Tektur-Medium.ttf) format('truetype'); font-weight: 100 900; font-display: swap; }

@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

:root {
  --cyan: #3dc9ff; --mint: #3dffb0; --pink: #ff3df2; --violet: #b43dff; --gold: #ffd23d;
  --muted: #9fb0e8; --line: rgba(140, 160, 255, .3);
  --font: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  --display: 'Tektur', 'Outfit', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #070816;
  font-family: var(--font); color: #eaf2ff;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.hidden { display: none !important; }

#menu, #death {
  position: fixed; inset: 0; display: flex; padding: 18px; overflow: auto;
  background: radial-gradient(ellipse at center, rgba(7,8,22,.25), rgba(7,8,22,.7));
}
#death { background: rgba(7,8,22,.6); }
.card { margin: auto; }

.card {
  position: relative; isolation: isolate; width: 100%; max-width: 960px; padding: 26px 36px 28px;
  background: rgba(12, 14, 38, .78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 26px;
  animation: rise .8s cubic-bezier(.2, .85, .25, 1) both;
}
.card::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 2px;
  background: conic-gradient(from var(--ang), #3dc9ff, #b43dff, #ff3df2, #ffd23d, #3dffb0, #3dc9ff);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 7s linear infinite;
}
.card::after {
  content: ''; position: absolute; inset: -2px; z-index: -2; border-radius: inherit;
  background: conic-gradient(from var(--ang), #3dc9ff, #b43dff, #ff3df2, #ffd23d, #3dffb0, #3dc9ff);
  filter: blur(26px); opacity: .38; animation: spin 7s linear infinite;
}
.card.small { max-width: 360px; padding: 26px 28px; text-align: center; }
@keyframes spin { to { --ang: 360deg; } }
@keyframes rise { from { opacity: 0; transform: translateY(28px) scale(.97); } to { opacity: 1; transform: none; } }

header { text-align: center; }
.logo {
  margin: 0; font-family: var(--display); font-weight: 500; font-size: 68px; letter-spacing: 6px; line-height: 1.1;
}
.logo span { display: inline-block; animation: wave 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * .13s); }
.logo .a { color: #fff; --glow: #3dc9ff; }
.logo .b { color: #fff; --glow: #ff3df2; }
@keyframes wave {
  0%, 100% { transform: translateY(0);    text-shadow: 0 0 10px var(--glow), 0 0 26px var(--glow), 0 0 52px var(--glow); }
  50%      { transform: translateY(-9px); text-shadow: 0 0 16px var(--glow), 0 0 40px var(--glow), 0 0 80px var(--glow); }
}
.tag { margin: 2px 0 18px; color: var(--muted); font-size: 15px; letter-spacing: 1px; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.col { display: flex; flex-direction: column; animation: rise .8s cubic-bezier(.2, .85, .25, 1) both; }
.col-worm { padding-right: 32px; animation-delay: .15s; }
.col-game { padding-left: 32px; border-left: 1px solid; border-image: linear-gradient(180deg, transparent, var(--line), transparent) 1; animation-delay: .3s; }
.col h2 {
  margin: 0 0 4px; font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--cyan); text-shadow: 0 0 12px rgba(61, 201, 255, .7);
}
label { display: block; margin: 12px 0 6px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: #8ea0e0; }

input[type=text], #name, #code {
  width: 100%; padding: 12px 15px; font: 700 19px var(--font); color: #fff; outline: none;
  background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
  user-select: text; -webkit-user-select: text;
}
#name:focus, #code:focus { border-color: var(--cyan); background: rgba(61,201,255,.09); box-shadow: 0 0 18px rgba(61,201,255,.5); }
#code { text-align: center; letter-spacing: 12px; text-transform: uppercase; font: 700 30px var(--display); padding: 14px; }
#name::placeholder { color: rgba(170,190,255,.45); font-weight: 500; letter-spacing: .5px; transition: color .25s; }
#name:focus::placeholder { color: rgba(170,190,255,.22); }
#code::placeholder { letter-spacing: 8px; color: rgba(160,176,232,.4); }

#swatches { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; justify-content: space-between; }
#swatches .brk { flex-basis: 100%; height: 0; margin-top: -9px; }
.sw {
  position: relative; width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255,255,255,.22);
  cursor: pointer; padding: 0; transition: transform .15s;
}
.sw:hover { transform: scale(1.18) rotate(8deg); }
.sw.on { border-color: #fff; transform: scale(1.2); animation: ring 1.6s ease-in-out infinite; }
@keyframes ring { 0%, 100% { outline: 2px solid rgba(255,255,255,.0); outline-offset: 2px; } 50% { outline: 2px solid rgba(255,255,255,.55); outline-offset: 5px; } }

.sw.custom {
  display: block; width: 36px; height: 36px; border: 0; background: none; border-radius: 50%;
  box-shadow: 0 0 14px rgba(180,61,255,.55), 0 0 26px rgba(61,201,255,.3);
}
.sw.custom::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#ff3d3d, #ffd23d, #7dff3d, #3dffd5, #3d6bff, #b43dff, #ff3df2, #ff3d3d);
  animation: prism 4s linear infinite;
}
.sw.custom::after {
  content: '+'; position: absolute; inset: 4px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #2b2f66, #0c0e28 75%);
  font: 500 24px/1 var(--display); color: #fff; text-shadow: 0 0 8px #fff, 0 0 14px var(--cyan);
  box-shadow: inset 0 0 8px rgba(0,0,0,.7); transition: transform .3s;
}
.sw.custom:hover::after, .sw.custom.open::after { transform: rotate(90deg); }
.sw.custom.picked { box-shadow: 0 0 16px var(--c), 0 0 30px var(--c); }
.sw.custom.picked::after { content: ''; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255,255,255,.9), inset 0 -6px 10px rgba(0,0,0,.25); }
.sw.custom.on { border: 0; }
@keyframes prism { to { transform: rotate(360deg); } }

#swatches { position: relative; }
#cpop {
  position: absolute; left: 0; bottom: calc(100% + 12px); z-index: 20; width: min(100%, 280px); padding: 14px;
  border-radius: 18px; background: rgba(12,14,38,.96); border: 1px solid rgba(140,160,255,.35);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 18px 50px rgba(0,0,0,.65), 0 0 36px rgba(180,61,255,.35);
  backdrop-filter: blur(10px); animation: pop .22s cubic-bezier(.2,.9,.3,1.2);
  --h: 120; --c: #fff;
}
#cpop.hidden { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.94); } }
#cp-sv {
  position: relative; height: 150px; border-radius: 12px; cursor: crosshair; touch-action: none;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(var(--h) 100% 50%));
  box-shadow: 0 0 18px hsl(var(--h) 100% 50% / .45);
}
#cp-hue {
  position: relative; height: 16px; margin-top: 14px; border-radius: 10px; cursor: pointer; touch-action: none;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
#cp-svk, #cp-huek {
  position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; pointer-events: none;
  border: 3px solid #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.45), 0 0 12px rgba(255,255,255,.8);
}
#cp-huek { top: 50%; background: hsl(var(--h) 100% 50%); }
#cp-svk { background: var(--c); }
.cp-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
#cp-prev { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 16px var(--c); }
#cp-hex {
  flex: 1; min-width: 0; padding: 9px 10px; border-radius: 12px; font: 500 18px var(--display); letter-spacing: 2px; text-align: center;
  text-transform: lowercase; color: #fff; outline: none; background: rgba(255,255,255,.07); border: 2px solid rgba(140,160,255,.25);
}
#cp-hex:focus { border-color: var(--cyan); box-shadow: 0 0 14px rgba(61,201,255,.5); }
#cp-dice {
  flex: none; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; line-height: 1; font-size: 21px; cursor: pointer;
  border-radius: 12px; border: 2px solid rgba(140,160,255,.25); background: rgba(255,255,255,.07); transition: transform .15s, border-color .15s, box-shadow .15s;
}
#cp-dice span { display: block; transform: translateY(1px); }
#cp-dice:hover { transform: scale(1.08); border-color: var(--pink); box-shadow: 0 0 14px rgba(255,61,242,.5); }
#cp-dice:active { transform: scale(.95); }

#preview { display: block; width: 100%; aspect-ratio: 320 / 100; margin-top: auto; border-radius: 16px; background: rgba(0,0,0,.3); border: 1px solid rgba(140,160,255,.15); }
.col-worm #swatches { margin-bottom: 14px; }
#btn-join { margin-top: 16px; }

.tabs { display: flex; gap: 8px; margin: 12px 0 6px; padding: 5px; border-radius: 16px; background: rgba(0,0,0,.28); }
.tab {
  flex: 1; padding: 11px 6px; font: 700 16px var(--font); color: var(--muted); cursor: pointer;
  background: transparent; border: none; border-radius: 12px; transition: all .2s;
}
.tab:hover { color: #fff; }
.tab.on { color: #fff; background: linear-gradient(135deg, rgba(90,100,255,.55), rgba(180,61,255,.5)); box-shadow: 0 0 18px rgba(120,90,255,.6); }

.panel { display: flex; flex-direction: column; flex: 1; animation: rise .35s ease both; }
.modes { display: flex; gap: 10px; margin: 8px 0 12px; }
.mode, .shape, .gmode {
  flex: 1; padding: 13px 8px; font: inherit; color: #cfd8ff; cursor: pointer; text-align: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 14px; transition: all .2s;
}
.mode:hover, .shape:hover, .gmode:hover { transform: translateY(-2px); border-color: rgba(61,255,176,.6); }
.mode b, .shape b, .gmode b { display: block; font-size: 16px; }
.mode small, .shape small, .gmode small { display: block; margin-top: 3px; font-size: 12px; color: #8ea0e0; }
.mode.on, .shape.on, .gmode.on { background: rgba(61,255,176,.14); border-color: var(--mint); color: #fff; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 10px rgba(61,255,176,.3); } 50% { box-shadow: 0 0 22px rgba(61,255,176,.7); } }

#botbox, #maxbox { margin: 0 0 12px; }
#botbox label, #maxbox label { margin: 0 0 8px; }
#botbox b, #maxbox b { color: var(--mint); font-size: 17px; }
#botn, #maxp { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 8px; outline: none; cursor: pointer; background: linear-gradient(90deg, var(--mint), var(--cyan)); }
#botn::-webkit-slider-thumb, #maxp::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--mint); box-shadow: 0 0 14px var(--mint); }
#botn::-moz-range-thumb, #maxp::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--mint); box-shadow: 0 0 14px var(--mint); }

button.play {
  position: relative; overflow: hidden; width: 100%; margin-top: auto; padding: 15px; cursor: pointer; border: none; border-radius: 16px;
  font: 700 21px var(--display); letter-spacing: 2px; text-transform: uppercase; color: #08102a;
  background: linear-gradient(90deg, #3dffb0, #3dc9ff, #3dffb0); background-size: 200% 100%;
  box-shadow: 0 0 22px rgba(61,255,200,.55); transition: transform .12s, box-shadow .12s;
  animation: flow 4s linear infinite, pulse 2.4s ease-in-out infinite;
}
button.play::after {
  content: ''; position: absolute; top: 0; left: -70%; width: 40%; height: 100%; transform: skewX(-22deg);
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.6), transparent); animation: shine 3.4s ease-in-out infinite;
}
button.play:hover { transform: translateY(-2px) scale(1.015); box-shadow: 0 0 36px rgba(61,255,200,.95); }
button.play:active { transform: scale(.98); }
@keyframes flow { to { background-position: 200% 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 18px rgba(61,255,200,.45); } 50% { box-shadow: 0 0 34px rgba(61,255,200,.85); } }
@keyframes shine { 0% { left: -70%; } 55%, 100% { left: 140%; } }

button.ghost {
  width: 100%; margin-top: 10px; padding: 10px; font: 700 15px var(--font); color: var(--muted); cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 12px; transition: all .2s;
}
button.ghost:hover { color: #fff; border-color: var(--cyan); }
#err { min-height: 20px; margin: 14px 0 0; text-align: center; color: #ff6b8b; font-weight: 700; font-size: 15px; }

#chip { position: fixed; left: 14px; bottom: 14px; display: flex; gap: 6px; }
#chip button {
  font: 700 14px var(--font); color: #dfe8ff; cursor: pointer; padding: 8px 12px;
  background: rgba(14,16,40,.7); border: 1px solid var(--line); border-radius: 10px;
}
#chip button:hover { border-color: var(--cyan); box-shadow: 0 0 12px rgba(61,201,255,.5); }
#chip b { letter-spacing: 3px; color: var(--mint); font-family: var(--display); }

#death h2 { margin: 0 0 6px; font: 500 38px var(--display); color: #ff4d7a; text-shadow: 0 0 18px #ff2d6a; }
#death p { margin: 0 0 18px; color: #c8d4ff; line-height: 1.5; }

#legal {
  position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 2;
  font-size: 12px; letter-spacing: .5px; color: rgba(159,176,232,.55); text-decoration: none; transition: color .2s;
}
#legal a { color: inherit; text-decoration: none; }
#legal a:hover, #legal a:focus-visible { color: #eaf2ff; text-decoration: underline; }
#legal span { margin: 0 10px; }
@media (max-width: 800px) {
  .card { padding: 20px 20px 22px; }
  #menu { flex-direction: column; }
  #legal { position: static; transform: none; margin: 14px auto 0; }
  .logo { font-size: 46px; letter-spacing: 3px; }
  .cols { grid-template-columns: 1fr; gap: 22px; }
  .col-worm { padding-right: 0; }
  .col-game { padding-left: 0; border-left: none; border-image: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.sw.rainbow {
  background: linear-gradient(90deg, #ff3d3d, #ffd23d, #7dff3d, #3dffd5, #3d6bff, #b43dff, #ff3d3d); background-size: 200% 100%;
  animation: flow 2.4s linear infinite; box-shadow: 0 0 12px rgba(255,255,255,.45);
}
.sw.rainbow.on { animation: flow 2.4s linear infinite, ring 1.6s ease-in-out infinite; }
@keyframes flow { to { background-position: 200% 0; } }

.diffs { display: flex; gap: 8px; margin-top: 10px; }
.diff {
  flex: 1; padding: 9px 6px; font: 700 15px var(--font); color: #cfd8ff; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; transition: all .2s;
}
.diff:hover { transform: translateY(-2px); }
.diff[data-diff="easy"].on   { background: rgba(61,255,176,.16); border-color: #3dffb0; color: #fff; box-shadow: 0 0 14px rgba(61,255,176,.45); }
.diff[data-diff="medium"].on { background: rgba(255,210,61,.16); border-color: #ffd23d; color: #fff; box-shadow: 0 0 14px rgba(255,210,61,.45); }
.diff[data-diff="hard"].on   { background: rgba(255,61,129,.18); border-color: #ff3d81; color: #fff; box-shadow: 0 0 14px rgba(255,61,129,.5); }

.visrow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.visrow span { flex: 1; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: #8ea0e0; }
.vis {
  padding: 9px 16px; font: 700 15px var(--font); color: #cfd8ff; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; transition: all .2s;
}
.vis:hover { transform: translateY(-2px); }
.vis.on { background: rgba(61,201,255,.15); border-color: var(--cyan); color: #fff; box-shadow: 0 0 14px rgba(61,201,255,.45); }
.vis[data-pub="1"].on { background: rgba(255,210,61,.15); border-color: var(--gold); box-shadow: 0 0 14px rgba(255,210,61,.45); }

.or { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: #8ea0e0; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.quick {
  width: 100%; padding: 14px 10px; font: inherit; color: #fff; cursor: pointer; text-align: center;
  background: linear-gradient(135deg, rgba(255,210,61,.16), rgba(255,61,242,.14)); border: 1px solid rgba(255,210,61,.55); border-radius: 16px;
  box-shadow: 0 0 18px rgba(255,210,61,.25); transition: transform .2s, box-shadow .2s;
}
.quick:hover { transform: translateY(-2px); box-shadow: 0 0 28px rgba(255,210,61,.55); }
.quick b { display: block; font: 500 19px var(--display); letter-spacing: 1.5px; text-transform: uppercase; }
.quick small { display: block; margin-top: 4px; font-size: 13px; color: #ffe9a8; }
.quick.empty { border-color: var(--line); box-shadow: none; background: rgba(255,255,255,.05); }
.quick.empty small { color: #8ea0e0; }

.hint { margin: 8px 0 0; font-size: 13px; color: #8ea0e0; }
#diffs { margin: -6px -22px -12px; padding: 18px 22px 18px; max-height: 110px; overflow: hidden; opacity: 1; transform: translateY(0);
  transition: max-height .4s cubic-bezier(.2,.8,.25,1), padding .4s cubic-bezier(.2,.8,.25,1), margin .4s cubic-bezier(.2,.8,.25,1), opacity .3s ease, transform .4s cubic-bezier(.2,.8,.25,1); }
#diffs.collapsed { max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; opacity: 0; transform: translateY(-8px); pointer-events: none; }
#diffs .diff { transition: all .2s, opacity .3s .1s; }

#mobile { display: none; position: fixed; inset: 0; padding: 18px; overflow: auto; background: radial-gradient(ellipse at center, rgba(7,8,22,.25), rgba(7,8,22,.7)); }
body.mobile #mobile { display: flex; }
body.mobile #menu, body.mobile #death, body.mobile #chip { display: none !important; }
#mobile .logo { font-size: 44px; letter-spacing: 3px; margin: 0 0 6px; }
.mob-ico { font-size: 44px; margin: 6px 0 0; }
#mobile h2 { margin: 4px 0 10px; font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: 3px; text-transform: uppercase; color: var(--cyan); }
.mob-txt { margin: 8px 0; color: #dfe8ff; line-height: 1.5; }
#legal-mob { display: inline-block; margin-top: 16px; font-size: 12px; color: rgba(159,176,232,.55); text-decoration: none; }
#legal-mob:hover { color: #eaf2ff; text-decoration: underline; }

.gear { position: fixed; top: 14px; right: 14px; z-index: 3; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; padding: 0; font-size: 22px; line-height: 1; cursor: pointer; color: #dfe8ff; background: rgba(14,16,40,.7); border: 1px solid var(--line); border-radius: 12px; transition: all .2s; }
.gear:hover, .gear-in:hover { border-color: var(--cyan); box-shadow: 0 0 12px rgba(61,201,255,.5); }
#chip .gear-in { font-size: 18px; padding: 6px 11px; }
#recon, #settings, #records { position: fixed; inset: 0; display: flex; padding: 18px; overflow: auto; z-index: 20; background: rgba(7,8,22,.62); }
#recon h2, #settings h2 { margin: 0 0 10px; font: 500 28px var(--display); color: var(--cyan); text-shadow: 0 0 16px rgba(61,201,255,.6); }
#recon h2 { color: #ffb43d; text-shadow: 0 0 16px rgba(255,180,61,.6); }
#recon p { margin: 0 0 14px; color: #c8d4ff; }
.spin { width: 38px; height: 38px; margin: 0 auto 8px; border-radius: 50%; border: 4px solid rgba(140,160,255,.25); border-top-color: var(--cyan); animation: turn 0.9s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
#settings .card { text-align: left; }
#settings h2 { text-align: center; }
#settings label { display: block; margin: 14px 0 8px; }
#settings label b { color: var(--mint); font-size: 17px; }
.rng { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 8px; outline: none; cursor: pointer; background: linear-gradient(90deg, var(--mint), var(--cyan)); }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--mint); box-shadow: 0 0 14px var(--mint); }
.rng::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--mint); box-shadow: 0 0 14px var(--mint); }
.modes.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fxq { cursor: pointer; padding: 10px 8px; font: inherit; color: #dfe8ff; text-align: center; background: rgba(14,16,40,.5); border: 1px solid var(--line); border-radius: 12px; transition: all .2s; }
.fxq b { display: block; font-size: 15px; }
.fxq small { display: block; margin-top: 3px; font-size: 12px; color: #8ea0e0; }
.fxq:hover { border-color: var(--cyan); }
.fxq.on { border-color: var(--mint); background: rgba(61,255,176,.12); box-shadow: 0 0 14px rgba(61,255,176,.3); }
#death .card.small { max-width: 440px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; margin: 4px 0 14px; }
.tile { display: flex; flex-direction: column; padding: 10px 4px 8px; border-radius: 12px; background: rgba(14,16,40,.6); border: 1px solid var(--line); }
.tile b { display: block; font: 500 22px var(--display); color: #fff; text-shadow: 0 0 12px rgba(61,201,255,.7); }
.tile span { display: flex; align-items: center; justify-content: center; min-height: 28px; margin-top: 2px; line-height: 1.15; font-size: 11px; letter-spacing: .5px; color: #8ea0e0; }
#death #st-record { margin: 0 0 4px; font-weight: 700; color: #ffd23d; }
.share { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.share button.ghost { margin-top: 0; }
#death #share-msg { min-height: 18px; margin: 4px 0 8px; font-size: 13px; color: #3dffb0; }
body.mobile #recon, body.mobile #settings, body.mobile #records, body.mobile .gear { display: none !important; }

.gear.trophy { right: 62px; }
#records h2 { margin: 0 0 12px; text-align: center; font: 500 28px var(--display); color: var(--gold, #ffd23d); text-shadow: 0 0 16px rgba(255,210,61,.5); }
#records h3 { margin: 14px 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #8ea0e0; text-align: center; }
#rc-total, #rc-empty { margin: 0; font-size: 13px; color: #9fb0e8; text-align: center; }
#rc-list { margin: 0; padding: 0; list-style: none; text-align: left; }
#rc-list li { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 10px; margin-bottom: 5px; font-size: 14px; border-radius: 10px; background: rgba(14,16,40,.55); border: 1px solid var(--line); }
#rc-list li:first-child { border-color: rgba(255,210,61,.6); box-shadow: 0 0 12px rgba(255,210,61,.18); }
#rc-list .n { color: #8ea0e0; font-weight: 700; }
#rc-list .s { font: 500 18px var(--display); color: #fff; }
#rc-list .d { font-size: 12px; color: #8ea0e0; text-align: right; }
#rc-list .m { font-size: 12px; color: #9fb0e8; text-align: right; }
.rec-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.rec-btns .ghost { margin-top: 0; }
.rec-btns .ghost.warn { border-color: #ff5d73; color: #ff8a9a; }

.gear.trophy { font-size: 20px; }
#chip .gear-in { display: inline-flex; align-items: center; justify-content: center; }
#records .card.small { max-width: 500px; }
#records .tile span { white-space: nowrap; }

/* --- modes de jeu, durée, traînées --- */
.modes.three { gap: 8px; }
.gmode { padding: 11px 2px; }
.gmode b { font-size: 14px; }
.gmode small { font-size: 10.5px; }
#durbox { margin: 0 0 12px; }
#durbox label { margin: 0 0 8px; }
#durbox b { color: var(--mint); font-size: 17px; }
#dur { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 8px; outline: none; cursor: pointer; background: linear-gradient(90deg, var(--mint), var(--cyan)); }
#dur::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--mint); box-shadow: 0 0 14px var(--mint); }
#dur::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--mint); box-shadow: 0 0 14px var(--mint); }

/* --- barre de spectateur --- */
#specbar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 8;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 22px;
  background: rgba(8,10,30,.78); border: 1px solid var(--line); backdrop-filter: blur(8px);
}
#specbar #sp-name { min-width: 190px; text-align: center; font-weight: 700; color: #cfd8ff; }
#specbar button { margin: 0; padding: 9px 16px; width: auto; font-size: 15px; cursor: pointer; }
#specbar #sp-prev, #specbar #sp-next { padding: 9px 14px; background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 12px; color: #fff; font: 700 15px var(--font); }
#specbar #sp-prev:hover, #specbar #sp-next:hover { border-color: var(--cyan); }

/* --- résultats de manche --- */
#results { position: fixed; inset: 0; display: flex; padding: 18px; overflow: auto; z-index: 12; background: rgba(7,8,22,.55); }
#results .card.small { max-width: 460px; }
#results h2 { margin: 0 0 4px; font: 500 34px var(--display); color: var(--gold, #ffd23d); text-shadow: 0 0 18px rgba(255,210,61,.55); }
#results #rs-sub { margin: 0 0 14px; color: #c8d4ff; font-weight: 700; }
#rs-team { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
#rs-team .tt { padding: 12px 6px; border-radius: 14px; background: rgba(14,16,40,.6); border: 2px solid var(--line); }
#rs-team .tt b { display: block; font: 500 34px var(--display); color: #fff; }
#rs-team .tt span { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
#rs-team .t0 span { color: #3dc9ff; } #rs-team .t1 span { color: #ff3d81; }
#rs-team .tt.win { box-shadow: 0 0 22px currentColor; }
#rs-team .t0.win { border-color: #3dc9ff; color: rgba(61,201,255,.7); } #rs-team .t1.win { border-color: #ff3d81; color: rgba(255,61,129,.7); }
#rs-list { list-style: none; margin: 0 0 12px; padding: 0; text-align: left; }
#rs-list li { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 10px; margin-bottom: 5px; border-radius: 10px; background: rgba(14,16,40,.55); font-weight: 700; }
#rs-list li:first-child { background: rgba(255,210,61,.12); border: 1px solid rgba(255,210,61,.5); }
#rs-list li.me { outline: 2px solid var(--cyan); }
#rs-list .n { text-align: center; color: #8ea0e0; }
#rs-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rs-list .sc { font-family: var(--display); color: #fff; }
#rs-list .kl { font-size: 12px; color: #ff9aa8; min-width: 44px; text-align: right; }
#rs-next { margin: 0 0 8px; color: #8ea0e0; font-weight: 700; }

/* --- tutoriel --- */
#tuto {
  position: fixed; left: 50%; bottom: 128px; transform: translateX(-50%); z-index: 9; width: min(440px, calc(100vw - 32px));
  display: grid; grid-template-columns: 52px 1fr; gap: 6px 14px; padding: 16px 18px; border-radius: 20px;
  background: rgba(10,12,34,.88); border: 1px solid rgba(61,201,255,.5); box-shadow: 0 0 26px rgba(61,201,255,.3); animation: rise .5s ease both;
}
#tuto-ico { grid-row: 1; font-size: 38px; align-self: center; text-align: center; }
#tuto-title { display: block; font: 500 18px var(--display); color: var(--cyan); margin-bottom: 3px; }
#tuto-text { margin: 0; color: #dfe6ff; line-height: 1.45; font-size: 15px; }
.tuto-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 4px; }
#tuto-dots { flex: 1; letter-spacing: 6px; color: #5a6aa8; }
#tuto-dots i { font-style: normal; } #tuto-dots i.on { color: var(--mint); }
.tuto-foot button { margin: 0; width: auto; padding: 8px 18px; font-size: 14px; cursor: pointer; }
#death #btn-spec { margin-bottom: 8px; }
body.mobile #specbar, body.mobile #results, body.mobile #tuto { display: none !important; }

/* choix de la traînée : pastilles rondes à droite des couleurs */
#swatches .tlabel { margin-left: auto; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: #8ea0e0; }
#swatches .sep { width: 1px; height: 26px; margin: 0 2px; background: rgba(255,255,255,.22); }
.sw.trl { display: grid; place-items: center; width: 34px; height: 34px; background: rgba(255,255,255,.07); font: 700 18px/1 var(--font); color: #fff; }
.sw.trl[data-tr="1"] { color: #ffd23d; text-shadow: 0 0 8px #ffd23d; }
.sw.trl[data-tr="2"] { color: #ff6b9a; text-shadow: 0 0 8px #ff3d81; font-size: 24px; padding: 0; line-height: 1; position: relative; top: 0.5px; }
.sw.trl[data-tr="3"]::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--cyan) 60%); box-shadow: 0 0 9px var(--cyan); }
.sw.trl[data-tr="0"] { color: #9fb0e8; font-size: 15px; }
