:root {
  color-scheme: dark;
  --bg: #0b1014;
  --ink: #f7fbff;
  --muted: #b8c7d1;
  --line: rgba(255, 255, 255, 0.18);
  --panel: rgba(255, 255, 255, 0.105);
  --mint: #79f2c5;
  --cyan: #83d8ff;
  --rose: #ff7a93;
  --gold: #ffd166;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 8%, rgba(121, 242, 197, 0.28), transparent 26rem),
    radial-gradient(circle at 82% 16%, rgba(131, 216, 255, 0.22), transparent 28rem),
    radial-gradient(circle at 48% 92%, rgba(255, 122, 147, 0.14), transparent 30rem),
    linear-gradient(135deg, #071015 0%, #111923 44%, #0b1014 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 82%);
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 96px;
}

.glass-surface,
.capture-panel,
.collection-panel,
.arena-panel,
.shop-panel,
.friends-panel,
.settings-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.055)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(22px) saturate(145%);
}

.auth-view {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.75fr);
  gap: 24px;
  align-items: center;
  padding: 30px;
}

.admin-shell {
  display: grid;
  gap: 18px;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 24px;
}

.admin-link {
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 850;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-form.single-column {
  grid-template-columns: 1fr;
}

.admin-form .primary-action,
.admin-form .auth-message {
  grid-column: 1 / -1;
}

.wide-action {
  width: 100%;
  margin-top: 14px;
}

.admin-stats {
  grid-template-columns: repeat(3, 1fr);
}

.auth-card {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 16px;
  background: rgba(5, 12, 16, 0.32);
}

.language-select {
  margin-bottom: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-tab,
.ghost-action {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.auth-tab.active,
.ghost-action:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
}

.auth-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.topbar div {
  display: grid;
  gap: 2px;
}

.topbar strong {
  font-size: 1.1rem;
}

.status-pill {
  min-width: 84px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(121, 242, 197, 0.14);
  border: 1px solid rgba(121, 242, 197, 0.24);
  color: var(--mint);
  text-align: center;
  font-weight: 900;
}

.hero {
  min-height: 38vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 28px;
  align-items: center;
  padding: 32px 0 22px;
}

.compact-hero {
  min-height: 260px;
}

.eyebrow,
.step-pill {
  margin: 0;
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(4rem, 12vw, 8.7rem);
  line-height: 0.82;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

.tagline {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.5;
}

.battle-preview {
  position: relative;
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03)),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 20px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.battle-preview::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(121, 242, 197, 0.16));
}

.orbital-rock {
  position: absolute;
  width: 112px;
  aspect-ratio: 1;
  border-radius: 56% 44% 48% 52% / 44% 54% 46% 56%;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.34));
  animation: float 3.2s ease-in-out infinite;
}

.rock-one {
  left: 18%;
  top: 25%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.52), transparent 0.7rem),
    linear-gradient(140deg, #d8fbf1, #6f8f9a 50%, #1e2a32);
}

.rock-two {
  right: 16%;
  bottom: 24%;
  background:
    radial-gradient(circle at 70% 25%, rgba(255, 255, 255, 0.45), transparent 0.65rem),
    linear-gradient(150deg, #ffe3a2, #ff7a93 48%, #343044);
  animation-delay: -1.3s;
}

.arena-line {
  position: absolute;
  left: 50%;
  top: 16%;
  width: 1px;
  height: 70%;
  background: linear-gradient(transparent, rgba(244, 239, 229, 0.42), transparent);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-5deg);
  }
  50% {
    transform: translateY(-14px) rotate(7deg);
  }
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.capture-panel,
.collection-panel,
.arena-panel,
.shop-panel,
.friends-panel,
.settings-panel {
  padding: 18px;
}

.capture-panel {
  position: sticky;
  top: 18px;
}

.full-panel {
  max-width: 820px;
  margin: 0 auto;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.photo-drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 1px dashed rgba(244, 239, 229, 0.34);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background:
    linear-gradient(145deg, rgba(131, 216, 255, 0.18), rgba(255, 122, 147, 0.13)),
    rgba(255, 255, 255, 0.06);
}

.photo-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-drop img {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
}

.photo-drop.has-image img {
  display: block;
}

.photo-drop.has-image span {
  display: none;
}

.photo-drop span {
  max-width: 220px;
  color: var(--ink);
  text-align: center;
  font-weight: 800;
}

.field-grid,
.duel-selectors,
.friend-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.friend-form {
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(244, 239, 229, 0.16);
  border-radius: 12px;
  background: rgba(4, 10, 14, 0.52);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(121, 242, 197, 0.15);
}

.gps-card,
.stats-row,
.battle-stage {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.075);
}

.gps-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}

.gps-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.icon-button {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--cyan), var(--mint));
  color: #071015;
  cursor: pointer;
}

.icon-button span {
  display: block;
  width: 18px;
  height: 18px;
  margin: auto;
  border: 3px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.icon-button span::before,
.icon-button span::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.icon-button span::before {
  width: 3px;
  height: 30px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.icon-button span::after {
  width: 30px;
  height: 3px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.primary-action,
.danger-action {
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
}

.primary-action {
  background: linear-gradient(100deg, var(--mint), var(--cyan) 52%, var(--gold));
  color: #071015;
}

.danger-action {
  background: linear-gradient(100deg, var(--rose), #ffb3c0);
  color: #26060d;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}

.stats-row div {
  display: grid;
  gap: 3px;
  padding: 13px;
  border-right: 1px solid var(--line);
}

.stats-row div:last-child {
  border-right: 0;
}

.stats-row strong {
  font-size: 1.5rem;
}

.stats-row span,
.rock-card small,
.fighter small {
  color: var(--muted);
  font-size: 0.8rem;
}

.rock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.rock-card,
.friend-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.075);
  overflow: hidden;
}

.rock-card img,
.rock-fallback {
  width: 100%;
  aspect-ratio: 1.2;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(121, 242, 197, 0.22), rgba(131, 216, 255, 0.16));
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
}

.rock-card-body {
  padding: 12px;
}

.rock-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.rock-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.meter {
  height: 8px;
  margin-top: 9px;
  border-radius: 999px;
  background: rgba(244, 239, 229, 0.13);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--mint));
}

.battle-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.fighter {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.fighter span,
.friend-avatar {
  display: grid;
  place-items: center;
  width: min(112px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(121, 242, 197, 0.24), rgba(131, 216, 255, 0.16));
  border: 1px solid rgba(244, 239, 229, 0.18);
  font-weight: 1000;
  overflow: hidden;
}

.fighter span {
  font-size: 1.6rem;
}

.fighter span img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.versus {
  color: var(--rose);
  font-weight: 1000;
  font-size: 1.4rem;
}

.battle-log,
.empty-state,
.inline-message {
  min-height: 48px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.shop-grid,
.friend-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.shop-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.075);
  padding: 14px;
}

.shop-card h3,
.shop-card p {
  margin: 0;
}

.shop-card p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.shop-card strong {
  display: inline-block;
  margin-top: 8px;
  color: var(--mint);
}

.shop-card .ghost-action {
  min-width: 112px;
  padding: 0 12px;
}

.shop-card .ghost-action:disabled {
  cursor: default;
  opacity: 0.55;
}

.friend-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.friend-avatar {
  width: 48px;
  flex: 0 0 48px;
}

.friend-card div:last-child {
  display: grid;
  gap: 4px;
}

.friend-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.settings-panel label {
  margin-bottom: 14px;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(780px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px;
  border-radius: 22px;
}

.nav-button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
}

.nav-button.active {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
}

.nav-mark {
  width: 20px;
  height: 20px;
  position: relative;
  display: block;
}

.collection-mark {
  border-radius: 45% 55% 50% 50%;
  background: linear-gradient(145deg, var(--mint), rgba(255, 255, 255, 0.2));
}

.arena-mark::before,
.arena-mark::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 3px;
  top: 8px;
  left: 1px;
  border-radius: 999px;
  background: var(--rose);
}

.arena-mark::before {
  transform: rotate(35deg);
}

.arena-mark::after {
  transform: rotate(-35deg);
}

.friends-mark::before,
.friends-mark::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--cyan);
}

.friends-mark::before {
  width: 12px;
  height: 12px;
  left: 1px;
  top: 2px;
}

.friends-mark::after {
  width: 10px;
  height: 10px;
  right: 1px;
  bottom: 2px;
}

.shop-mark {
  border-radius: 6px;
  border: 2px solid var(--mint);
}

.shop-mark::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: -5px;
  height: 8px;
  border: 2px solid var(--mint);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.settings-mark {
  border: 3px solid var(--gold);
  border-radius: 50%;
}

.settings-mark::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: var(--gold);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 18px 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.game-view[hidden],
.auth-view[hidden],
.admin-private[hidden],
[hidden] {
  display: none;
}

.battle-stage.strike .fighter:first-child {
  animation: hitLeft 360ms ease;
}

.battle-stage.strike .fighter.enemy {
  animation: hitRight 360ms ease;
}

@keyframes hitLeft {
  50% {
    transform: translateX(12px) scale(1.03);
  }
}

@keyframes hitRight {
  50% {
    transform: translateX(-12px) scale(1.03);
  }
}

@media (max-width: 860px) {
  .auth-view,
  .hero,
  .workbench {
    grid-template-columns: 1fr;
  }

  .capture-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
    padding-bottom: 104px;
  }

  .auth-view {
    min-height: calc(100vh - 28px);
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
  }

  .hero {
    min-height: auto;
    padding-top: 18px;
  }

  .compact-hero {
    display: none;
  }

  .battle-preview {
    min-height: 210px;
  }

  .field-grid,
  .duel-selectors,
  .friend-form,
  .admin-form,
  .stats-row,
  .battle-stage {
    grid-template-columns: 1fr;
  }

  .shop-card {
    grid-template-columns: 1fr;
  }

  .stats-row div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stats-row div:last-child {
    border-bottom: 0;
  }

  .bottom-nav {
    bottom: 10px;
    width: min(100% - 14px, 680px);
    border-radius: 18px;
  }

  .nav-button {
    min-height: 54px;
    font-size: 0.68rem;
  }

  footer {
    display: grid;
  }
}

/* ── Közlemény sáv ─────────────────────────────────────────── */
.announcement-bar {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.2rem;
  text-align: center;
  letter-spacing: 0.01em;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── Superuser panel ────────────────────────────────────────── */
.super-nav .nav-mark {
  font-size: 1.1rem;
}

#superPage .shop-panel {
  background: rgba(255, 215, 0, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 14px;
  padding: 1rem;
}

#superPage h3 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
  color: #fbbf24;
}
