/* ================= BASE ================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: white;
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 43, 214, 0.10), transparent 30%),
    radial-gradient(circle at 80% 90%, rgba(34, 211, 238, 0.12), transparent 35%),
    #050712;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;

  background-image:
    radial-gradient(white 1px, transparent 1px),
    radial-gradient(white 1px, transparent 1px);

  background-size: 90px 90px, 140px 140px;
  background-position: 0 0, 40px 60px;

  opacity: 0.16;
}

/* ================= TOP BAR ================= */

.top-bar {
  height: 58px;
  padding: 0 22px;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  border-bottom: 1px solid rgba(94, 234, 212, 0.28);

  background: rgba(5, 7, 18, 0.82);
  backdrop-filter: blur(12px);

  position: sticky;
  top: 0;
  z-index: 20;

  overflow: hidden;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.top-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.top-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ================= TOP BAR FX ================= */

.top-bar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0%;
  height: 1px;
  transform: translateX(-50%);

  background: linear-gradient(
    90deg,
    transparent,
    #22d3ee,
    #ff2bd6,
    transparent
  );

  opacity: 0;
  transition: all 0.35s ease;
}

.top-bar:hover::after {
  width: 100%;
  opacity: 1;

  box-shadow:
    0 0 10px rgba(34, 211, 238, 0.5),
    0 0 16px rgba(255, 43, 214, 0.35);
}

/* ================= LOGOS ================= */

.top-logo,
.top-logo-left {
  width: auto;
  object-fit: contain;
  opacity: 0.95;

  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.35));
  transition: all 0.25s ease;
}

.top-logo:hover,
.top-logo-left:hover {
  transform: scale(1.08);

  filter:
    drop-shadow(0 0 10px rgba(34, 211, 238, 0.6))
    drop-shadow(0 0 18px rgba(255, 43, 214, 0.45));
}

.top-logo-left:hover {
  transform: scale(1.1) rotate(-6deg);
}

.top-logo-left {
  height: 42px;
}

.top-logo {
  height: 34px;
}

/* ================= BUTTONS ================= */

button {
  background: rgba(5, 7, 18, 0.72);
  color: white;
  border: 2px solid #22d3ee;
  padding: 9px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
  transition: all 0.2s ease;
  box-shadow: none;
}

button:hover {
  border-color: #ff2bd6;
  background: rgba(255, 43, 214, 0.12);

  box-shadow:
    0 0 12px rgba(255, 43, 214, 0.65),
    0 0 26px rgba(255, 43, 214, 0.35);
}

button:active {
  transform: scale(0.97);
}

/* ================= APP ================= */

#app {
  min-height: calc(100vh - 58px);
  display: grid;
  place-items: center;
  padding: 30px 18px;
  position: relative;
  z-index: 1;
}

/* ================= HOME CARD ================= */

.home-card {
  width: min(430px, 92vw);
  min-height: 520px;
  border: 2px solid rgba(94, 234, 212, 0.82);
  border-radius: 28px;
  padding: 42px 34px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;

  background: rgba(5, 7, 18, 0.46);

  box-shadow:
    0 0 14px rgba(94, 234, 212, 0.22),
    inset 0 0 20px rgba(94, 234, 212, 0.05);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.home-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 43, 214, 0.55);

  box-shadow:
    0 0 18px rgba(255, 43, 214, 0.18),
    0 0 28px rgba(34, 211, 238, 0.12),
    inset 0 0 20px rgba(94, 234, 212, 0.05);
}

.home-logo {
  width: 190px;
  height: 190px;
  object-fit: contain;
  transform: scale(2.5);
  pointer-events: none;

  filter:
    drop-shadow(0 0 16px rgba(34, 211, 238, 0.5))
    drop-shadow(0 0 14px rgba(255, 43, 214, 0.25));
}

.home-title {
  margin-top: 6px;
  margin-bottom: -8px;
  font-size: 15px;
  opacity: 0.9;
}

/* ================= MENU ================= */

.home-menu {
  width: 100%;
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.home-menu button {
  width: 100%;
  height: 52px;
  font-size: 16px;
  border-radius: 13px;
}

/* ================= SCREEN ================= */

.screen {
  width: min(1050px, 95vw);
  background: rgba(5, 7, 18, 0.5);
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 22px;
  padding: 24px;
}

/* ================= HUD GAME ================= */

.hud-pill {
  min-width: 92px;
  height: 44px;
  padding: 6px 12px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  border: 2px solid #22d3ee;
  border-radius: 14px;
  background: rgba(5, 7, 18, 0.72);

  box-shadow:
    0 0 10px rgba(34, 211, 238, 0.28),
    inset 0 0 10px rgba(34, 211, 238, 0.05);
}

.hud-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #67e8f9;
  line-height: 1;
}

.hud-value {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 900;
  color: white;
  line-height: 1;
  text-align: center;
}

.hud-pill:hover {
  border-color: #ff2bd6;
  background: rgba(255, 43, 214, 0.10);

  box-shadow:
    0 0 12px rgba(255, 43, 214, 0.45),
    0 0 22px rgba(34, 211, 238, 0.20);
}

/* ================= GAME ================= */

.game-layout {
  width: min(900px, 96vw);
  display: grid;
  gap: 18px;
  position: relative;
}

.game-canvas-wrap {
  display: grid;
  place-items: center;
}

canvas {
  width: min(100%, 760px);
  aspect-ratio: 1 / 1;
  background: #030712;
  border: 2px solid rgba(94, 234, 212, 0.7);
  border-radius: 24px;
  box-shadow: 0 0 18px rgba(94, 234, 212, 0.18);
}

.game-over-panel {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(360px, 90%);
  padding: 24px;
  border: 2px solid rgba(94, 234, 212, 0.82);
  border-radius: 22px;
  background: rgba(5, 7, 18, 0.92);

  box-shadow:
    0 0 20px rgba(34, 211, 238, 0.28),
    0 0 35px rgba(255, 43, 214, 0.18);

  text-align: center;
  z-index: 5;
}

.game-over-panel.hidden {
  display: none;
}

.game-over-panel h2 {
  margin: 0 0 10px;
  color: #ff2bd6;
}

.game-over-panel input {
  width: 100%;
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid #22d3ee;
  background: rgba(5, 7, 18, 0.8);
  color: white;
  font-weight: 800;
  text-align: center;
  outline: none;
}

.game-over-actions {
  display: flex;
  gap: 10px;
}

.game-over-actions button {
  flex: 1;
}

/* ================= LEADERBOARD PRO ================= */

.leaderboard-panel {
  width: min(980px, 94vw);
  padding: 30px;
  border: 1px solid rgba(94, 234, 212, 0.42);
  border-radius: 26px;

  background:
    linear-gradient(180deg, rgba(5, 7, 18, 0.82), rgba(5, 7, 18, 0.55));

  box-shadow:
    0 0 18px rgba(34, 211, 238, 0.12),
    inset 0 0 24px rgba(94, 234, 212, 0.04);
}

.leaderboard-title-row {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.leaderboard-title-box {
  padding: 12px 30px;
  border: 2px solid #22d3ee;
  border-radius: 16px;
  background: rgba(5, 7, 18, 0.72);

  box-shadow:
    0 0 10px rgba(34, 211, 238, 0.28),
    inset 0 0 10px rgba(34, 211, 238, 0.05);
}

.leaderboard-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1px;
  text-align: center;
  color: white;
}

.leaderboard-control-row {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "actions actions"
    "modes filters";
  gap: 14px 18px;
  margin-bottom: 24px;
}

.leaderboard-left {
  grid-area: actions;
  display: flex;
  gap: 12px;
  align-items: center;
}

.leaderboard-middle {
  grid-area: modes;
  display: flex;
  gap: 12px;
  align-items: center;
}

.leaderboard-tabs {
  grid-area: filters;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
}

.leaderboard-tabs button.active-filter {
  border-color: #ff2bd6;
  background: rgba(255, 43, 214, 0.16);
  color: white;

  box-shadow:
    0 0 14px rgba(255, 43, 214, 0.65),
    0 0 26px rgba(255, 43, 214, 0.35),
    inset 0 0 10px rgba(255, 43, 214, 0.16);
}

.leaderboard-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(94, 234, 212, 0.24);
  background: rgba(3, 7, 18, 0.42);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 14px 18px;
  text-align: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.leaderboard-table th {
  color: #67e8f9;
  font-size: 13px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.leaderboard-table td {
  font-size: 15px;
  font-weight: 800;
}

.leaderboard-table tr:hover td {
  background: rgba(34, 211, 238, 0.05);
}

/* ================= MOBILE ================= */

@media (max-width: 900px) {
  .leaderboard-title-row {
    justify-content: center;
  }

  .leaderboard-control-row {
    justify-content: center;
  }

  .leaderboard-left,
.leaderboard-middle,
.leaderboard-tabs {
  justify-content: center;
}
}

@media (max-width: 760px) {
  .top-bar {
    height: auto;
    min-height: 58px;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .top-left,
  .top-right {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ================= DROPDOWN SMOOTH ================= */

.dropdown-wrap {
  position: relative;
}

.dropdown-btn {
  min-width: 170px;
  position: relative;
  z-index: 5;
}

/* zone invisible qui évite la coupure hover */
.dropdown-wrap::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 14px;
}

.dropdown-menu {
  position: absolute;

  top: calc(100% + 2px);
  left: 0;

  min-width: 100%;

  padding: 8px;

  display: flex;
  flex-direction: column;
  gap: 8px;

  border:
    2px solid rgba(94, 234, 212, 0.75);

  border-radius: 16px;

  background:
    rgba(5, 7, 18, 0.96);

  backdrop-filter: blur(16px);

  opacity: 0;
  pointer-events: none;

  transform:
    translateY(-6px)
    scale(0.97);

  transition:
    opacity 0.16s ease,
    transform 0.16s ease;

  z-index: 40;

  box-shadow:
    0 0 16px rgba(34, 211, 238, 0.18),
    0 0 28px rgba(255, 43, 214, 0.10);
}

.dropdown-wrap:hover .dropdown-menu {
  opacity: 1;
  pointer-events: auto;

  transform:
    translateY(0)
    scale(1);
}

.dropdown-menu button {
  width: 100%;
  border-radius: 12px;
}

/* ================= ARENA SELECT ================= */

.arena-select-card {
  width: min(430px, 92vw);
  min-height: 520px;
  padding: 42px 34px;
  padding-top: 14px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  border: 2px solid rgba(94, 234, 212, 0.82);
  border-radius: 28px;

  background: rgba(5, 7, 18, 0.58);

  box-shadow:
    0 0 18px rgba(34, 211, 238, 0.22),
    0 0 34px rgba(255, 43, 214, 0.10),
    inset 0 0 28px rgba(94, 234, 212, 0.05);
}

.arena-select-logo {
  width: 190px;
  height: 190px;
  object-fit: contain;
  margin-bottom: 6px;

  filter:
    drop-shadow(0 0 16px rgba(34, 211, 238, 0.45))
    drop-shadow(0 0 18px rgba(255, 43, 214, 0.35));
}

.arena-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  text-align: center;

  color: #22d3ee;

  text-shadow:
    0 0 10px rgba(34, 211, 238, 0.65),
    0 0 18px rgba(255, 43, 214, 0.22);
}

.arena-subtitle {
  margin: 4px 0 12px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.arena-subtitle span {
  width: 42px;
  height: 2px;
  background: #22d3ee;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.7);
}

.arena-subtitle p {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ff2bd6;

  text-shadow:
    0 0 10px rgba(255, 43, 214, 0.65);
}

.arena-mode-list {
  width: 100%;
  display: grid;
  gap: 14px;
}

.arena-mode-list button {
  width: 100%;
  height: 52px;

  font-size: 16px;
  font-weight: 900;

  border-radius: 13px;
}

.arena-back-btn {
  margin-top: 22px;
  min-width: 135px;
  height: 44px;

  font-size: 13px;
  font-weight: 900;

  border-radius: 12px;
}


.arena-select-card:hover {
  transform: translateY(-3px);

  border-color: rgba(255, 43, 214, 0.55);

  box-shadow:
    0 0 18px rgba(255, 43, 214, 0.18),
    0 0 28px rgba(34, 211, 238, 0.12),
    inset 0 0 20px rgba(94, 234, 212, 0.05);
}

.dropdown-wrap {
  position: relative;
  z-index: 100;
}

.dropdown-wrap:hover {
  z-index: 10000;
}

.dropdown-menu {
  z-index: 99999;
  pointer-events: auto;
}

.dropdown-menu button {
  pointer-events: auto;
}