:root {
  --bg1: #4666d2;
  --bg2: #2a3b92;
  --panel1: #4d6edb;
  --panel2: #33479f;
  --dim: rgba(10, 16, 48, .72);
  --ink: #2a3b92;
  --gold: #ffd84a;
  --goldtext: #ffd84a;
  --fg: #ffffff;
  --chip: rgba(255, 255, 255, .16);
  --chip-dark: rgba(0, 0, 0, .18);
  --green: #4cc35a;
  --green-dark: #2f8a3b;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  color: var(--fg);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}
/* Hintergrund liegt auf <html>, die Dekoration (#bgCanvas) darüber, die Oberfläche noch darüber */
html { background: linear-gradient(180deg, var(--bg1), var(--bg2)) fixed; }
body { background: none; }
#bgCanvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

#app {
  height: 100vh;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
}

#hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 4px 0;
}

.best {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 20px;
  color: var(--goldtext);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .2);
}

.score-wrap { text-align: center; }

#score {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .25);
  font-variant-numeric: tabular-nums;
}

#combo {
  height: 20px;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 900;
  color: var(--goldtext);
  letter-spacing: .5px;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .2s, transform .2s;
}
#combo.show { opacity: 1; transform: scale(1); }

.icon-btn {
  justify-self: end;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 12px;
  background: var(--chip);
  color: var(--fg);
  cursor: pointer;
}
.icon-btn:active { transform: scale(.94); }

#game {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: block;
  touch-action: none;
}

#tools {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 4px 0 16px;
}

.tool {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: var(--chip);
  color: var(--fg);
  font-weight: 800;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}
.tool:active:not(:disabled) { transform: scale(.94); }
.tool:disabled { opacity: .35; cursor: default; }
.tool[hidden] { display: none; }

.badge {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 13px;
  line-height: 22px;
  text-align: center;
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--dim);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.overlay.show { opacity: 1; pointer-events: auto; }

.panel {
  width: min(100%, 360px);
  padding: 28px 24px 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel1), var(--panel2));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
  text-align: center;
  transform: scale(.9);
  transition: transform .25s cubic-bezier(.2, 1.4, .4, 1);
}
.overlay.show .panel { transform: scale(1); }

.panel h2 {
  margin-bottom: 14px;
  font-size: 28px;
  font-weight: 900;
}

.label { font-size: 15px; font-weight: 700; opacity: .8; }
.final {
  margin: 2px 0 6px;
  font-size: 56px;
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .25);
}

.record {
  display: none;
  margin: 0 auto 10px;
  padding: 6px 14px;
  width: max-content;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 900;
  animation: pulse 1s infinite alternate;
}
.record.show { display: block; }
@keyframes pulse { to { transform: scale(1.08); } }

.big-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: var(--green);
  box-shadow: 0 4px 0 var(--green-dark);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
.big-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--green-dark); }
.big-btn.secondary { background: rgba(255, 255, 255, .18); box-shadow: none; }
.big-btn.danger { background: #e8453c; box-shadow: 0 4px 0 #a52c25; }
.big-btn[hidden] { display: none; }

.toggles {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.toggle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .15);
  font-weight: 700;
  cursor: pointer;
}
.toggle input { display: none; }
.toggle i {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .25);
  transition: background .2s;
}
.toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}
.toggle input:checked + i { background: var(--green); }
.toggle input:checked + i::after { transform: translateX(18px); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.stats div {
  display: flex;
  flex-direction: column;
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .15);
}
.stats b { font-size: 20px; }
.stats span { font-size: 12px; opacity: .75; }

.keys { margin-top: 14px; font-size: 12px; opacity: .6; }
.keys a { color: inherit; }

/* Startseite */
.overlay.start {
  z-index: 20;
  background: transparent;
  color: var(--fg);
  transition: opacity .3s;
}
/* Auf der Startseite blendet sich das Spielfeld aus, damit Hintergrund und Dekoration frei sichtbar sind */
body:has(#startOverlay.show) #app { visibility: hidden; }
.overlay.start .big-btn.secondary { background: var(--btn2, rgba(255, 255, 255, .18)); }
.start-inner {
  width: min(100%, 340px);
  text-align: center;
  transform: translateY(12px);
  transition: transform .35s cubic-bezier(.2, 1.3, .4, 1);
}
.overlay.start.show .start-inner { transform: none; }

.logo {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 4px;
  justify-content: center;
  margin-bottom: 18px;
}
.logo i {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--c, rgba(0, 0, 0, .18));
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, .3), inset 0 -5px 0 rgba(0, 0, 0, .25);
  animation: drop .5s cubic-bezier(.2, 1.4, .4, 1) backwards;
}
.logo i:not([style]) { box-shadow: inset 0 2px 4px rgba(0, 0, 0, .25); }
.logo i:nth-child(1) { animation-delay: .05s; } .logo i:nth-child(2) { animation-delay: .1s; }
.logo i:nth-child(4) { animation-delay: .15s; } .logo i:nth-child(5) { animation-delay: .2s; }
.logo i:nth-child(6) { animation-delay: .25s; } .logo i:nth-child(8) { animation-delay: .3s; }
.logo i:nth-child(9) { animation-delay: .35s; }
@keyframes drop { from { transform: translateY(-40px) scale(.6); opacity: 0; } }

.start h1 {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.start h1 span { display: block; color: var(--goldtext); }

.start-best {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--chip-dark);
  color: var(--gold);
  font-weight: 800;
  font-size: 17px;
}
.start-best b { font-size: 20px; }

.start-buttons { margin-top: 8px; }
.start-buttons .big-btn { padding: 16px; font-size: 20px; }
.start-buttons small { font-size: 14px; font-weight: 700; opacity: .85; }
.start .stats { grid-template-columns: repeat(2, 1fr); margin-top: 20px; }

/* HUD */
.hud-left { display: flex; flex-direction: column; gap: 2px; }
.mode-tag { height: 16px; font-size: 12px; font-weight: 800; color: var(--goldtext); opacity: .9; letter-spacing: .3px; }
.best.flash { animation: flash .9s ease-out 2; }
@keyframes flash { 50% { transform: scale(1.25); color: #fff; } }

/* Startseite oben */
.overlay.start { flex-direction: column; overflow-y: auto; justify-content: safe center; padding: calc(env(safe-area-inset-top) + 72px) 16px 24px; }
.start-top {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 12px);
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.player-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 70%;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, .2);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.player-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-chip.empty { background: var(--gold); color: var(--ink); }

.big-btn.daily {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--gold);
  box-shadow: 0 4px 0 #c9a020;
  color: var(--ink);
}
.big-btn.daily:active { box-shadow: 0 2px 0 #c9a020; }
.daily-title { display: flex; align-items: center; gap: 8px; }
.big-btn.daily small { font-size: 13px; font-weight: 700; opacity: .8; }
.big-btn.gold { background: var(--gold); box-shadow: 0 4px 0 #c9a020; color: var(--ink); }

.btn-row { display: flex; gap: 10px; }
.btn-row .big-btn { font-size: 16px; }

.rank-line { white-space: pre-line; min-height: 20px; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--gold); }

/* Einstellungen */
.overlay.top { z-index: 30; }
.toggle small { display: block; font-size: 11px; font-weight: 600; opacity: .7; }
.toggle.wide { margin-top: 10px; text-align: left; }
.section-label { margin: 16px 0 8px; font-size: 13px; font-weight: 800; opacity: .75; text-align: left; }
.name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .15);
  font-size: 14px;
  text-align: left;
}
.name-row b { overflow-wrap: anywhere; }
.small-btn {
  flex: none;
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* Name */
.name-input {
  width: 100%;
  padding: 14px;
  border: 2px solid rgba(255, 255, 255, .25);
  border-radius: 14px;
  background: rgba(0, 0, 0, .2);
  color: #fff;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.name-input:focus { border-color: var(--gold); }
.name-msg { min-height: 20px; margin-top: 8px; font-size: 14px; font-weight: 700; opacity: .85; }
.name-msg.ok { color: #8cff8c; opacity: 1; }
.name-msg.bad { color: #ffb3ad; opacity: 1; }

/* Profil */
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: hsl(var(--h, 220) 55% 45%);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25), inset 0 2px 0 rgba(255, 255, 255, .3);
  font-weight: 900;
  font-size: 17px;
  text-transform: uppercase;
}
.avatar.big { width: 76px; height: 76px; margin: 0 auto 8px; font-size: 34px; }
.stats.grid2 { grid-template-columns: 1fr 1fr; }
.panel h2 + .small-btn { margin-bottom: 4px; }
.stats b { font-variant-numeric: tabular-nums; }

/* Rangliste (Clash-Royale-Stil: Platzmarke, Avatar, Name, Punkte mit Krone) */
.board-panel { display: flex; flex-direction: column; max-height: 100%; padding-left: 16px; padding-right: 16px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 4px;
  white-space: nowrap;
  border: none;
  border-radius: 12px;
  background: rgba(0, 0, 0, .2);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  opacity: .75;
  cursor: pointer;
}
.seg-btn.active { background: var(--gold); color: var(--ink); opacity: 1; box-shadow: 0 3px 0 #c9a020; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 8px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .2); }
.tabs[hidden] { display: none; }
.tab {
  padding: 8px 4px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 800;
  opacity: .7;
  cursor: pointer;
}
.tab.active { background: rgba(255, 255, 255, .22); opacity: 1; }

.banner {
  margin: 10px 0 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .1);
}
.banner-title { font-weight: 900; font-size: 15px; color: var(--gold); }
.banner-sub { white-space: pre-line; margin-top: 2px; font-size: 12px; font-weight: 600; opacity: .8; }

.board-list {
  flex: 1;
  min-height: 140px;
  max-height: 44vh;
  overflow-y: auto;
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.board-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .18);
  font-weight: 800;
}
.board-list li.info { justify-content: center; opacity: .75; background: none; font-weight: 700; }
.board-list .pos {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  font-size: 14px;
}
.board-list li.r1 { background: linear-gradient(90deg, rgba(255, 216, 74, .4), rgba(255, 216, 74, .12)); }
.board-list li.r2 { background: linear-gradient(90deg, rgba(200, 210, 230, .35), rgba(200, 210, 230, .1)); }
.board-list li.r3 { background: linear-gradient(90deg, rgba(221, 140, 80, .38), rgba(221, 140, 80, .1)); }
.board-list li.r1 .pos { background: #ffd84a; color: #5a4200; }
.board-list li.r2 .pos { background: #d3dae8; color: #39415a; }
.board-list li.r3 .pos { background: #e0935a; color: #4a2508; }
.board-list li.r1 .avatar { width: 44px; height: 44px; }
.board-list .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .pts { display: flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.board-list .pts svg { color: var(--gold); }
.board-list li.me { outline: 2px solid var(--gold); }

.board-me {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 12px 8px 8px;
  border-radius: 14px;
  background: rgba(255, 216, 74, .22);
  outline: 2px solid var(--gold);
  font-weight: 800;
  text-align: left;
}
.board-me[hidden] { display: none; }
.board-me .who { flex: 1; min-width: 0; }
.board-me small { display: block; font-size: 11px; font-weight: 700; opacity: .8; }
.board-me .pts { display: flex; align-items: center; gap: 5px; }
.board-me .pts svg { color: var(--gold); }

/* Combo-Anzeige wächst mit der Serie (--lvl = 0 bis 8) */
#combo.show {
  font-size: calc(15px + var(--lvl, 2) * 1.6px);
  text-shadow: 0 0 calc(var(--lvl, 2) * 2px) rgba(255, 216, 74, .9);
  animation: comboPulse .6s ease-in-out infinite alternate;
}
@keyframes comboPulse { to { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { #combo.show { animation: none; } }

/* Show-Effekte über dem ganzen Bildschirm */
#fx { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
#fx > div { position: absolute; inset: 0; opacity: 0; }
#fx .wash {
  background: linear-gradient(135deg, #ff3860, #ffd84a, #39ff14, #00f0ff, #bf40ff, #ff3860);
  animation-name: washA, hue;
  animation-timing-function: ease-in-out, linear;
  animation-fill-mode: both;
}
@keyframes washA { 0%, 100% { opacity: 0; } 50% { opacity: var(--a); } }
@keyframes hue { to { filter: hue-rotate(360deg); } }
#fx .flash { animation-name: flashA; animation-timing-function: ease-out; animation-fill-mode: both; }
@keyframes flashA { 0% { opacity: var(--a); } 100% { opacity: 0; } }

/* Design-Bereich */
.design-preview { border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); line-height: 0; }
.design-preview canvas { width: 100%; height: auto; display: block; }
#designOverlay .panel { max-height: calc(100dvh - 32px); overflow-y: auto; }
.strip-label { margin: 14px 0 6px; font-size: 13px; font-weight: 800; opacity: .75; text-align: left; }
/* Bilderreihen zum Durchwischen (ohne Namen) */
.strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 5px 4px 8px;
  margin: 0 -4px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.strip::-webkit-scrollbar { display: none; }
.thumb {
  position: relative;
  flex: none;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 14px;
  background: none;
  scroll-snap-align: center;
  cursor: pointer;
  box-sizing: content-box;
}
.thumb canvas { display: block; width: 58px; height: 58px; border-radius: 10px; }
.thumb.active { border-color: var(--gold); }
.thumb.active::after {
  content: "";
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%232a3b92' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.strip-hint { margin: 2px 0 12px; font-size: 12px; font-weight: 700; opacity: .5; text-align: center; }
#designOverlay .btn-row .big-btn { margin-top: 0; }

/* Weiterspielen (Variante A) */
.overlay.revive { z-index: 25; background: rgba(10, 16, 48, .72); }
.revive-inner { width: min(100%, 340px); text-align: center; }
.revive-inner h2 { font-size: 28px; font-weight: 900; margin-bottom: 4px; }
.revive-inner p { margin-bottom: 8px; font-size: 14px; font-weight: 600; opacity: .85; }
.revive .ring { position: relative; width: 132px; height: 132px; margin: 6px auto 16px; }
.revive .ring svg { transform: rotate(-90deg); }
.revive .ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; font-weight: 900; }
#reviveRing { stroke-dashoffset: 0; }
@keyframes reviveRing { to { stroke-dashoffset: 364.4; } }
.ad-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.link-btn {
  margin-top: 16px;
  padding: 8px 14px;
  border: none;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  opacity: .75;
  text-decoration: underline;
  cursor: pointer;
}
.overlay.ad { z-index: 40; background: rgba(0, 0, 0, .88); }
.ad-card { width: min(100%, 320px); padding: 28px 20px; border-radius: 20px; border: 2px dashed rgba(255, 255, 255, .35); text-align: center; }
.ad-tag { display: inline-block; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .15); font-size: 13px; font-weight: 800; }
.ad-card p { margin-top: 14px; font-size: 14px; opacity: .8; }
.ad-card b { display: block; margin: 10px 0 0; font-size: 64px; font-weight: 900; }
.ad-card .ad-small { margin-top: 4px; font-size: 13px; }

/* Namensfenster liegt immer ganz oben (auch wenn es aus Profil oder Einstellungen geöffnet wird) */
#nameOverlay { z-index: 35; }

/* Statistik & Orden */
.stats-panel { max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
#statsBody { flex: 1; min-height: 0; overflow-y: auto; text-align: left; margin-bottom: 4px; }
.stabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .2); margin-bottom: 12px; }
.stab { padding: 8px 4px; border: none; border-radius: 9px; background: transparent; color: inherit; font: inherit; font-weight: 800; opacity: .7; cursor: pointer; }
.stab.active { background: rgba(255, 255, 255, .22); opacity: 1; }
.shero { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(0, 0, 0, .18); margin-bottom: 4px; }
.shero b { display: block; font-size: 19px; overflow-wrap: anywhere; }
.shero small { font-size: 12px; opacity: .75; font-weight: 600; }
.ssec { margin: 12px 2px 6px; font-size: 12px; font-weight: 800; opacity: .7; letter-spacing: .3px; text-transform: uppercase; }
.sgrid { display: grid; gap: 8px; }
.sgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sgrid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scell { border-radius: 12px; background: rgba(0, 0, 0, .16); padding: 9px 6px; text-align: center; }
.scell b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.scell span { font-size: 11px; opacity: .78; font-weight: 600; }
.scell.gold b { color: var(--gold); }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 11px; background: rgba(0, 0, 0, .16); margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.srow b { color: var(--gold); white-space: nowrap; }
.medals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.medal { border-radius: 14px; background: rgba(0, 0, 0, .16); padding: 10px 4px 8px; text-align: center; }
.medal .ic { width: 46px; height: 46px; margin: 0 auto 5px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 900; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25), inset 0 2px 0 rgba(255, 255, 255, .35); }
.medal .ic.t1 { background: linear-gradient(180deg, #e8a56a, #b9683a); color: #fff; }
.medal .ic.t2 { background: linear-gradient(180deg, #e6ebf5, #9aa6c0); color: #33405e; }
.medal .ic.t3 { background: linear-gradient(180deg, #ffe36a, #e0a416); color: #5a3d00; }
.medal .ic.t0 { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .4); box-shadow: none; }
.medal small { display: block; min-height: 26px; font-size: 11px; font-weight: 700; line-height: 1.15; opacity: .9; }
.medal .bar { height: 6px; margin: 4px 6px 0; border-radius: 9px; background: rgba(0, 0, 0, .28); overflow: hidden; }
.medal .bar i { display: block; height: 100%; background: var(--gold); border-radius: 9px; }
.medal.new { animation: pulse 1s infinite alternate; }

select.small-btn { appearance: none; -webkit-appearance: none; padding: 6px 12px; text-align: center; max-width: 55%; }
select.small-btn option { color: #1b234f; background: #fff; }
