* { margin: 0; padding: 0; box-sizing: border-box; }

/* atribut hidden mora premagati vse display: pravila */
[hidden] { display: none !important; }

:root {
  --bg: #0d0b1e;
  --bg2: #171332;
  --card: rgba(255, 255, 255, 0.055);
  --border: rgba(167, 139, 250, 0.25);
  --text: #ece9ff;
  --muted: #9d96c7;
  --accent: #a78bfa;
  --accent2: #7c5cff;
  --gold: #ffd60a;
}

html {
  /* barva, ki jo iOS pokaže v varnostnih območjih (status bar, domači indikator) */
  background-color: var(--bg);
}
html, body {
  height: 100%;
  background-image: radial-gradient(1200px 700px at 50% -10%, #241a4d 0%, var(--bg) 60%);
  background-color: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overscroll-behavior: none;
}

/* animirano aurora ozadje */
body::before, body::after {
  content: '';
  position: fixed;
  z-index: -1;
  width: 55vmax;
  height: 55vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
}
body::before {
  background: radial-gradient(circle, #7c5cff 0%, transparent 65%);
  top: -18vmax;
  left: -12vmax;
  animation: drift1 26s ease-in-out infinite alternate;
}
body::after {
  background: radial-gradient(circle, #ff4fa3 0%, transparent 65%);
  bottom: -20vmax;
  right: -14vmax;
  animation: drift2 32s ease-in-out infinite alternate;
}
@keyframes drift1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(10vmax, 6vmax) scale(1.2); }
}
@keyframes drift2 {
  from { transform: translate(0, 0) scale(1.15); }
  to   { transform: translate(-9vmax, -7vmax) scale(0.95); }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

#app {
  max-width: 1060px;
  margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

#topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px 8px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
}
.logo-mark {
  width: 36px;
  height: 36px;
  flex: none;
  filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.65));
  animation: gemfloat 3.6s ease-in-out infinite;
}
.logo-text {
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.22em;
  font-weight: 800;
  background: linear-gradient(100deg, #ffd60a 0%, #ff7ac3 25%, #a78bfa 50%, #6ee7ff 75%, #ffd60a 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(167, 139, 250, 0.35);
  animation: logoshine 7s linear infinite;
}
.logo-i {
  height: 0.92em;
  width: auto;
  margin: 0 0.1em;
  filter: drop-shadow(0 0 7px rgba(255, 214, 10, 0.75));
}
@keyframes logoshine {
  from { background-position: 0% 0; }
  to   { background-position: 200% 0; }
}

.topbtns { display: flex; gap: 8px; }

.iconbtn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.15s;
}
.iconbtn:hover { background: rgba(167, 139, 250, 0.18); }
.iconbtn.off { opacity: 0.4; filter: grayscale(1); }

#layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}
/* ob obisku je vidna samo menijska kartica */
body.menuonly #layout { display: none; }
#layout.layout-enter { animation: layoutin 0.5s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes layoutin {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

/* ---- plošča ---- */
#boardwrap { min-width: 0; }

#hud {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.hud-item {
  flex: 1;
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.hud-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.hud-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#progresswrap { margin-bottom: 8px; }
#progressbar, #timerbar {
  height: 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  overflow: hidden;
}
#timerbar { margin-top: 6px; }
#progressfill {
  height: 100%;
  width: 0%;
  border-radius: 8px;
  background: linear-gradient(90deg, #7c5cff, #ff7ac3, #ffd60a);
  transition: width 0.35s ease;
  position: relative;
  overflow: hidden;
}
#progressfill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.55) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: shimmer 2.6s linear infinite;
}
@keyframes shimmer {
  from { background-position: 130% 0; }
  to   { background-position: -90% 0; }
}
#timerfill {
  height: 100%;
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #16c98d, #6ee7ff);
}
#timerfill.low { background: linear-gradient(90deg, #e5484d, #f76b15); }

/* combo-merilec */
#combobar {
  height: 8px;
  margin-top: 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 165, 60, 0.35);
  overflow: hidden;
}
#combofill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, #ffd60a, #ff8a1e, #ff5e3a);
  transition: width 0.2s ease;
}
#combobar.active {
  animation: comboglow 0.7s ease-in-out infinite alternate;
  border-color: #ffb63e;
}
@keyframes comboglow {
  from { box-shadow: 0 0 4px rgba(255, 170, 40, 0.5); }
  to   { box-shadow: 0 0 16px rgba(255, 170, 40, 0.95); }
}

#canvasbox {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: min(92vw, 640px);
  margin: 0 auto;
}
#board {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 16px;
  touch-action: none;
  background: rgba(10, 8, 26, 0.75);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), 0 0 60px rgba(124, 92, 255, 0.14), 0 0 0 1px var(--border);
}

/* ---- prekrivni meniji: na telefonu spodnji list, na namizju centrirana kartica ---- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(6, 4, 16, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 40;
}
.overlay[hidden] { display: none; }

.panel {
  width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  animation: sheetup 0.34s cubic-bezier(0.2, 1.1, 0.4, 1);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(165deg, rgba(40, 30, 82, 0.96), rgba(15, 11, 36, 0.98));
  border: 1px solid rgba(167, 139, 250, 0.32);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
/* ročica za vlečenje na vrhu lista */
.panel::before {
  content: '';
  flex: none;
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  margin: 2px auto 4px;
}

@keyframes sheetup {
  from { opacity: 0; transform: translateY(48px); }
  to   { opacity: 1; transform: none; }
}
@keyframes panelin {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: none; }
}

/* menijsko stanje: meni je običajna kartica pod zgornjo vrstico,
   ne modal — logotip in gumbi ostanejo vidni */
body.menuonly .overlay {
  position: static;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  padding: 6px 0 22px;
  align-items: flex-start;
  justify-content: center;
}
body.menuonly .panel {
  max-width: 420px;
  max-height: none;
  margin: 0 auto;
  border-radius: 24px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.32);
  padding: 20px 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  animation: panelin 0.32s cubic-bezier(0.2, 1.25, 0.4, 1);
}
body.menuonly .panel::before { display: none; }

/* namizje: ista kartica, centrirana, brez ročice */
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 18px; }
  .panel {
    max-width: 420px;
    max-height: calc(100vh - 36px);
    border-radius: 24px;
    border-bottom: 1px solid rgba(167, 139, 250, 0.32);
    padding: 22px 20px;
    gap: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    animation: panelin 0.32s cubic-bezier(0.2, 1.25, 0.4, 1);
  }
  .panel::before { display: none; }
}

/* v meniju zgornje vrstice ni — logotip in gumbi so na kartici */
body.menuonly #topbar { display: none; }
body.menuonly #btnMenu { display: none; }
#menuBtnsSlot { margin-left: auto; flex: none; }
#menuBtnsSlot .iconbtn { width: 36px; height: 36px; font-size: 0.92rem; border-radius: 10px; }
.menutitles { flex: 1; }
.menutitles .subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* okraski menija: lebdeči dragulji čez ves zaslon */
#menudeco { display: none; }
body.menuonly #menudeco {
  display: block;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
body.menuonly .panel { position: relative; z-index: 1; }
#topbar { position: relative; z-index: 2; }
#menudeco span {
  position: absolute;
  bottom: -8vh;
  opacity: 0;
  animation: floatgem linear infinite;
  text-shadow: 0 0 12px currentColor;
}
#menudeco span:nth-child(1)  { left: 6%;  font-size: 15px; color: #ffd60a; animation-duration: 12s; animation-delay: 0s; }
#menudeco span:nth-child(2)  { left: 16%; font-size: 24px; color: #a78bfa; animation-duration: 15s; animation-delay: 3s; }
#menudeco span:nth-child(3)  { left: 27%; font-size: 13px; color: #6ee7ff; animation-duration: 11s; animation-delay: 6s; }
#menudeco span:nth-child(4)  { left: 38%; font-size: 19px; color: #ff7ac3; animation-duration: 14s; animation-delay: 1.5s; }
#menudeco span:nth-child(5)  { left: 49%; font-size: 12px; color: #ffd60a; animation-duration: 16s; animation-delay: 8s; }
#menudeco span:nth-child(6)  { left: 58%; font-size: 22px; color: #6ee7ff; animation-duration: 12.5s; animation-delay: 4.5s; }
#menudeco span:nth-child(7)  { left: 68%; font-size: 14px; color: #a78bfa; animation-duration: 13.5s; animation-delay: 0.8s; }
#menudeco span:nth-child(8)  { left: 78%; font-size: 18px; color: #ff7ac3; animation-duration: 15.5s; animation-delay: 7s; }
#menudeco span:nth-child(9)  { left: 87%; font-size: 12px; color: #ffd60a; animation-duration: 11.5s; animation-delay: 2.5s; }
#menudeco span:nth-child(10) { left: 94%; font-size: 20px; color: #6ee7ff; animation-duration: 14.5s; animation-delay: 5.5s; }
@keyframes floatgem {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  8%   { opacity: 0.85; }
  60%  { transform: translateY(-60vh) translateX(2vw) rotate(180deg); opacity: 0.6; }
  100% { transform: translateY(-112vh) rotate(360deg); opacity: 0; }
}

/* dihajoč sijaj menijske kartice */
body.menuonly .panel { animation: panelin 0.32s cubic-bezier(0.2, 1.25, 0.4, 1), panelglow 4.5s ease-in-out 0.4s infinite alternate; }
@keyframes panelglow {
  from { box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5), 0 0 24px rgba(124, 92, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
  to   { box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5), 0 0 52px rgba(124, 92, 255, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
}

/* okrasna ločnica pod naslovom */
.menudivider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-shadow: 0 0 10px rgba(167, 139, 250, 0.8);
  margin: -2px 0;
}
.menudivider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.55), transparent);
}

@media (prefers-reduced-motion: reduce) {
  #menudeco span, .mode-icon, .menugem { animation: none !important; }
}

.menuhead {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  padding: 4px 2px;
}
.menutitles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.menuhead .paneltitle { font-size: 1.35rem; }
.menugem {
  flex: none;
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  animation: gemfloat 3.6s ease-in-out infinite;
}
.menugem svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 16px rgba(167, 139, 250, 0.75));
}
.menuhead .paneltitle {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
}
.menuhead .logo-i { height: 0.9em; margin: 0 0.08em; filter: drop-shadow(0 0 7px rgba(255, 214, 10, 0.75)); }
/* bleščica, ki kroži okoli logotipa */
.menugem::after {
  content: '✧';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: start end;
  font-size: 0.85rem;
  color: #fff8d8;
  text-shadow: 0 0 8px #ffd60a;
  animation: orbitgem 4.2s linear infinite;
}
@keyframes orbitgem {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes gemfloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-6px) rotate(3deg); }
}

.paneltitle {
  font-size: 1.55rem;
  letter-spacing: 0.16em;
  background: linear-gradient(90deg, #ffd60a, #ff7ac3, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle { color: var(--muted); font-size: 0.85rem; }

.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.fieldlabel {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.fieldhint { text-transform: none; letter-spacing: 0; opacity: 0.8; }
.sectionlabel {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-align: left;
  margin-bottom: -6px;
}
#playerName {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#playerName:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.22);
}

.modepick { display: flex; flex-direction: column; gap: 10px; }

/* izbira načina igre */
.modebtn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.modebtn:hover, .modebtn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--border);
  background: rgba(167, 139, 250, 0.13);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
.modebtn:active { transform: scale(0.98); }
.mode-icon {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  border-radius: 12px;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 12px rgba(0, 0, 0, 0.35);
  animation: iconbob 3.4s ease-in-out infinite;
}
.modebtn:nth-child(2) .mode-icon { animation-delay: 0.5s; }
.modebtn:nth-child(3) .mode-icon { animation-delay: 1s; }
.modebtn:nth-child(4) .mode-icon { animation-delay: 1.5s; }
@keyframes iconbob {
  0%, 100% { transform: none; }
  50%      { transform: translateY(-2px) scale(1.05); }
}
.mi-classic { background: linear-gradient(150deg, #7c5cff, #a855f7); }
.mi-timed   { background: linear-gradient(150deg, #0ea5a0, #16c98d); }
.mi-daily   { background: linear-gradient(150deg, #f59e0b, #ff5e3a); }
.mi-weekly  { background: linear-gradient(150deg, #3b82f6, #7c5cff); }
.mode-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mode-name { font-weight: 700; font-size: 0.98rem; }
.mode-desc {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 639px) {
  .mode-arrow { display: none; }
}
.mode-side {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.mode-best {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255, 214, 10, 0.12);
  border: 1px solid rgba(255, 214, 10, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mode-arrow {
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.15s, color 0.15s;
}
.modebtn:hover .mode-arrow { transform: translateX(3px); color: var(--accent); }

.menurow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}
.ghostbtn {
  flex: 1;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.ghostbtn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

.bigbtn {
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: linear-gradient(180deg, #8b6bff, #6a48e8);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
}
.bigbtn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgba(124, 92, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.bigbtn:active { transform: scale(0.97); }

.howtext { text-align: left; display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.howtext b { color: var(--gold); }

#lbholder { text-align: left; }
#lbholder .card { box-shadow: none; background: rgba(0, 0, 0, 0.25); }

/* dosežki */
.achgrid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 2px;
}
.achitem {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 9px 12px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 214, 10, 0.35);
  box-shadow: 0 0 12px rgba(255, 214, 10, 0.12);
}
.achitem.locked {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  opacity: 0.45;
  filter: grayscale(0.8);
}
.ach-icon { font-size: 1.45rem; flex: none; }
.ach-name { font-size: 0.88rem; font-weight: 700; }
.ach-desc { font-size: 0.72rem; color: var(--muted); }

/* statistika */
.statlist { display: flex; flex-direction: column; gap: 6px; }
.statrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.85rem;
  text-align: left;
}
.stat-label { color: var(--muted); }
.stat-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* konec igre */
.finalscore {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 214, 10, 0.3);
}
.fs-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.fs-value {
  font-size: 2.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff3b0, #ffd60a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.oversub { color: var(--muted); font-size: 0.88rem; min-height: 1.2em; }
#submitStatus.ok { color: #16c98d; }

/* ---- napis čez ploščo (stopnja, kaskade) ---- */
#banner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
  font-size: clamp(1.6rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
  color: #fff;
  text-shadow: 0 0 18px var(--accent2), 0 0 40px var(--accent2);
  animation: bannerpop 1.5s ease forwards;
}
#banner[hidden] { display: none; }
@keyframes bannerpop {
  0% { opacity: 0; transform: scale(0.5); }
  20% { opacity: 1; transform: scale(1.08); }
  30% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.15); }
}

/* obvestila o dosežkih */
#toasts {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}
.toast {
  padding: 11px 18px;
  border-radius: 13px;
  background: linear-gradient(165deg, rgba(50, 38, 96, 0.97), rgba(20, 14, 46, 0.97));
  border: 1px solid rgba(255, 214, 10, 0.55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 214, 10, 0.25);
  font-size: 0.92rem;
  font-weight: 600;
  animation: toastin 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
  transition: opacity 0.5s, transform 0.5s;
}
.toast.out { opacity: 0; transform: translateY(-12px); }
@keyframes toastin {
  from { opacity: 0; transform: translateY(-18px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- stranski stolpec ---- */
#side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.035));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.cardtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 10px;
}

#challenges { list-style: none; display: flex; flex-direction: column; gap: 10px; }
#challenges li {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.85rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
#challenges li.done {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(255, 214, 10, 0.35);
}
#challenges li.done .ch-text { color: var(--gold); }
.ch-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ch-reward { color: var(--gold); font-size: 0.75rem; white-space: nowrap; }
.ch-bar {
  margin-top: 6px;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.ch-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #16c98d, #6ee7ff);
  transition: width 0.3s ease;
}
#challenges .ch-empty { color: var(--muted); text-align: center; border: none; background: none; }

.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tab {
  flex: 1;
  padding: 6px 4px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  white-space: nowrap;
}
.tab.active {
  background: rgba(124, 92, 255, 0.3);
  color: var(--text);
  font-weight: 600;
}

#leaderboard { list-style: none; display: flex; flex-direction: column; gap: 4px; }
#leaderboard li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.85rem;
}
#leaderboard li:nth-child(odd) { background: rgba(255, 255, 255, 0.04); }
#leaderboard li.me { background: rgba(255, 214, 10, 0.14); outline: 1px solid rgba(255, 214, 10, 0.4); }
.lb-rank { width: 1.6em; color: var(--muted); font-variant-numeric: tabular-nums; }
li:nth-child(1) .lb-rank { color: var(--gold); }
li:nth-child(2) .lb-rank { color: #c0c0d8; }
li:nth-child(3) .lb-rank { color: #d59a66; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-lvl { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.lb-empty { color: var(--muted); justify-content: center; }

/* ---- telefon ---- */
@media (max-width: 820px) {
  #layout { grid-template-columns: 1fr; }
  #side { flex-direction: column; }
  .logo { font-size: 1.2rem; }
  #challenges li { font-size: 0.8rem; }
  .hud-value { font-size: 1rem; }
}
@media (min-width: 500px) and (max-width: 820px) {
  #side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
