:root {
  --bg: #050505;
  --bg-panel: rgba(17, 24, 39, 0.6);
  --neon-cyan: #00f3ff;
  --neon-violet: #bf00ff;
  --text-main: #e2e8f0;
  --text-sub: #94a3b8;
  --adaptive-accent-a: 70 132 255;
  --adaptive-accent-b: 28 223 255;
  --adaptive-base-top: 18 31 67;
  --adaptive-base-mid: 12 22 50;
  --adaptive-base-bottom: 22 36 68;
}

html {
  background-color: rgb(var(--adaptive-base-top));
}

body {
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  color: var(--text-main);
  background-color: rgb(var(--adaptive-base-top));
  min-height: 100dvh;
  overscroll-behavior-y: none;
}

.font-display {
  font-family: "Exo 2", "Segoe UI", sans-serif;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  height: 38px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 10px rgba(76, 184, 255, 0.28));
}

.brand-logo-login {
  height: 84px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 14px rgba(76, 184, 255, 0.3));
}

@media (max-width: 640px) {
  .brand-logo {
    height: 32px;
  }

  .brand-logo-login {
    height: 68px;
  }
}

.page-bg {
  min-height: 100dvh;
  background-color: rgb(var(--adaptive-base-bottom));
  background:
    radial-gradient(circle at 12% 8%, rgb(var(--adaptive-accent-a) / 0.3) 0%, rgb(var(--adaptive-accent-a) / 0) 38%),
    radial-gradient(circle at 88% 12%, rgb(var(--adaptive-accent-b) / 0.22) 0%, rgb(var(--adaptive-accent-b) / 0) 34%),
    linear-gradient(
      180deg,
      rgb(var(--adaptive-base-top)) 0%,
      rgb(var(--adaptive-base-mid)) 45%,
      rgb(var(--adaptive-base-bottom)) 100%
    );
}

.glass-card {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(5, 5, 5, 0.16), rgba(5, 5, 5, 0.72));
}


.game-btn {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.game-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.game-select-grid .game-btn-media {
  flex: 0 1 clamp(180px, 24vw, 260px);
  width: clamp(180px, 24vw, 260px);
}

.game-btn-media {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.game-bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.5;
  z-index: 0;
}

.game-btn-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(2, 6, 23, 0.35), rgba(2, 6, 23, 0.55));
  z-index: 1;
}

.game-label {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}

.game-btn:hover {
  border-color: rgba(0, 243, 255, 0.45);
}

.game-btn.active {
  border-color: rgba(0, 243, 255, 0.9);
  color: var(--neon-cyan);
  box-shadow: 0 0 18px rgba(0, 243, 255, 0.2);
}

.char-item.active {
  border-color: rgba(0, 243, 255, 0.7);
  box-shadow: 0 0 14px rgba(0, 243, 255, 0.2);
}

.char-item:hover {
  border-color: rgba(191, 0, 255, 0.5);
}

.chip {
  border: 1px solid rgba(0, 243, 255, 0.35);
  background: linear-gradient(to right, rgba(0, 243, 255, 0.2), rgba(191, 0, 255, 0.12));
}

.chip-x {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.selected-avatar {
  position: relative;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.selected-avatar .chip-x {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 17px;
  height: 17px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.account-role-list {
  --account-role-gap: 4px;
  --account-role-row-height: 74px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: var(--account-role-gap);
  max-height: calc((var(--account-role-row-height) * 3) + (var(--account-role-gap) * 2));
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.account-role-item {
  min-width: 68px;
}

.status-pill {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
}

.status-available {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.13);
}

.status-issued {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.13);
}

.status-locked {
  color: #f87171;
  background: rgba(248, 113, 113, 0.14);
}

.flash {
  border-left: 3px solid;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 14px;
}

.flash.success {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.flash.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.copy-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.copy-btn:hover {
  border-color: rgba(0, 243, 255, 0.7);
}

.account-action-btn {
  width: 58px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1.1;
}

.lang-dropdown {
  position: relative;
}

.lang-dropdown-trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #dbeafe;
  width: fit-content;
  min-width: 0;
  cursor: pointer;
}

.lang-dropdown-trigger img {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.lang-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: fit-content;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(10, 16, 36, 0.95);
  backdrop-filter: blur(10px);
  padding: 6px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.lang-dropdown-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.lang-dropdown-item img {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lang-dropdown-item.active {
  color: #67e8f9;
  background: rgba(0, 243, 255, 0.08);
}

.lang-dropdown summary::-webkit-details-marker {
  display: none;
}

.role-grid {
  --role-col-min: 68px;
  --role-gap: 6px;
  --role-img-size: 52px;
  --role-name-size: 0.7rem;
  --role-row-height: 88px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--role-col-min), 1fr));
  gap: var(--role-gap);
  max-height: calc((var(--role-row-height) * 3) + (var(--role-gap) * 2));
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  align-content: start;
}

.char-item {
  padding: 0.32rem 0.14rem !important;
  min-height: var(--role-row-height);
}

.char-item img {
  width: var(--role-img-size) !important;
  height: var(--role-img-size) !important;
}

.role-name {
  font-size: var(--role-name-size);
  line-height: 1.1;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 820px) and (max-width: 1366px) and (pointer: coarse) {
  .role-grid {
    --role-col-min: 86px;
    --role-gap: 8px;
    --role-img-size: 62px;
    --role-name-size: 0.82rem;
    --role-row-height: 104px;
  }

  .char-item {
    padding: 0.4rem 0.18rem !important;
  }
}

@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
  .role-grid {
    --role-col-min: 108px;
    --role-gap: 10px;
    --role-img-size: 78px;
    --role-name-size: 0.95rem;
    --role-row-height: 132px;
  }

  .char-item {
    padding: 0.5rem 0.22rem !important;
  }
}

@media (max-width: 640px) {
  .game-select-grid {
    justify-content: stretch;
  }

  .game-select-grid .game-btn-media {
    flex: 1 1 calc(50% - 6px);
    width: calc(50% - 6px);
    min-width: 0;
  }

  .role-grid {
    --role-col-min: 68px;
    --role-gap: 6px;
    --role-img-size: 52px;
    --role-name-size: 0.7rem;
    --role-row-height: 88px;
  }

  .char-item {
    padding: 0.32rem 0.14rem !important;
  }

  .lang-dropdown-trigger {
    padding: 6px 8px;
    font-size: 12px;
    width: fit-content;
    min-width: 0;
  }
}
