:root {
  --bg0: #070708;
  --bg1: #0d0e10;
  --card: rgba(17, 18, 20, 0.72);
  --border: rgba(255, 255, 255, 0.09);
  --text: rgba(255, 255, 255, 0.93);
  --muted: rgba(255, 255, 255, 0.62);
  --accent: #f5a000;
  --accent2: #ffcc33;
  --good: #25d366;
  --bad: #ff3b3b;
  --shadow: rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--text);
  background: radial-gradient(1200px 700px at 20% 20%, rgba(245, 160, 0, 0.10), transparent 60%),
    radial-gradient(1000px 700px at 80% 80%, rgba(255, 204, 51, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow: hidden;
}

#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  height: 100%;
}

.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.99);
  transition: opacity 420ms ease, transform 420ms ease;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.splash-card,
.auth-card {
  width: min(680px, calc(100% - 48px));
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 30px 90px var(--shadow);
  border-radius: 18px;
  padding: 28px 28px 26px;
  position: relative;
  overflow: hidden;
}

.splash-card::before,
.auth-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(90deg, rgba(245, 160, 0, 0.0), rgba(245, 160, 0, 0.35), rgba(255, 204, 51, 0.0));
  opacity: 0.22;
  transform: translateX(-60%);
  animation: sweep 2.2s linear infinite;
}

@keyframes sweep {
  0% {
    transform: translateX(-60%);
  }
  100% {
    transform: translateX(60%);
  }
}

.logo-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: 14px;
}

#brand-logo {
  width: min(520px, 80vw);
  filter: drop-shadow(0 14px 35px rgba(0, 0, 0, 0.6));
  animation: pop 800ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.logo-glow {
  position: absolute;
  width: 78%;
  height: 68%;
  background: radial-gradient(circle at 50% 50%, rgba(245, 160, 0, 0.24), transparent 60%);
  filter: blur(16px);
  animation: glow 2.6s ease-in-out infinite;
}

@keyframes glow {
  0%,
  100% {
    transform: scale(0.98);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@keyframes pop {
  0% {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.splash-title {
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.22em;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 0 18px rgba(245, 160, 0, 0.22);
}

.splash-sub {
  text-align: center;
  margin-top: 10px;
  color: var(--muted);
}

.progress {
  position: relative;
  margin-top: 18px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 18px rgba(245, 160, 0, 0.35);
  border-radius: 999px;
}

.progress-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  transform: translateX(-65%);
  animation: glare 1.6s linear infinite;
  mix-blend-mode: screen;
}

@keyframes glare {
  0% {
    transform: translateX(-65%);
  }
  100% {
    transform: translateX(65%);
  }
}

.progress-text {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.auth-header {
  display: flex;
  gap: 14px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.tiny-logo {
  width: 56px;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}

.auth-title {
  font-weight: 800;
  letter-spacing: 0.05em;
}

.auth-sub {
  color: var(--muted);
  margin-top: 4px;
  font-size: 14px;
}

.auth-form {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  position: relative;
  z-index: 1;
}

input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  padding: 12px 12px;
  border-radius: 12px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus {
  border-color: rgba(245, 160, 0, 0.6);
  box-shadow: 0 0 0 4px rgba(245, 160, 0, 0.12);
}

.btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn:active {
  transform: translateY(0px);
}

.btn.primary {
  background: linear-gradient(90deg, rgba(245, 160, 0, 0.95), rgba(255, 204, 51, 0.95));
  color: #111;
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 16px 40px rgba(245, 160, 0, 0.22);
  font-weight: 800;
}

.btn.primary:hover {
  box-shadow: 0 20px 60px rgba(245, 160, 0, 0.32);
}

.btn.danger {
  background: rgba(255, 59, 59, 0.10);
  border-color: rgba(255, 59, 59, 0.22);
}

.auth-status {
  margin-top: 12px;
  min-height: 20px;
  font-size: 14px;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.auth-status.good {
  color: var(--good);
}

.auth-status.bad {
  color: var(--bad);
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
  100% {
    transform: translateX(0);
  }
}

.shake {
  animation: shake 360ms ease;
}

.auth-foot {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  position: relative;
  z-index: 1;
}

.topbar {
  width: min(1200px, calc(100% - 42px));
  margin: 22px auto 0;
  padding: 14px 14px;
  border: 1px solid var(--border);
  background: rgba(10, 10, 12, 0.52);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  font-weight: 900;
  letter-spacing: 0.06em;
}

.brand-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.layout {
  width: min(1200px, calc(100% - 42px));
  margin: 14px auto 22px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  height: calc(100% - 120px);
}

.sidebar {
  border: 1px solid var(--border);
  background: rgba(10, 10, 12, 0.52);
  border-radius: 16px;
  padding: 14px;
  overflow: auto;
}

.sidebar-title {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.86);
  margin-bottom: 10px;
}

.game-list {
  display: grid;
  gap: 10px;
}

.game-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.game-item:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(245, 160, 0, 0.28);
}

.game-item.active {
  border-color: rgba(245, 160, 0, 0.42);
  box-shadow: 0 0 0 4px rgba(245, 160, 0, 0.08);
}

.game-item img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}

.game-meta {
  display: grid;
}

.game-name {
  font-weight: 800;
}

.content {
  overflow: hidden;
}

.panel {
  height: 100%;
  border: 1px solid var(--border);
  background: rgba(10, 10, 12, 0.52);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.panel-head {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-weight: 900;
  letter-spacing: 0.06em;
}

.panel-body {
  padding: 14px;
  overflow: auto;
}

.instructions {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  padding: 12px;
}

.instruction-item {
  display: flex;
  gap: 10px;
  padding: 8px 6px;
  color: rgba(255, 255, 255, 0.85);
}

.instruction-bullet {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 18px rgba(245, 160, 0, 0.32);
  flex: 0 0 auto;
}

.downloads-head {
  margin-top: 14px;
  display: grid;
  gap: 4px;
}

.downloads-title {
  font-weight: 800;
  letter-spacing: 0.06em;
}

.downloads-sub {
  color: var(--muted);
  font-size: 13px;
}

.downloads {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.file {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  transition: transform 160ms ease, border-color 160ms ease;
}

.file:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 160, 0, 0.26);
}

.file-title {
  font-weight: 900;
}

.file-desc {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  background: rgba(0, 0, 0, 0.2);
}

.badge.bad {
  border-color: rgba(255, 59, 59, 0.30);
  background: rgba(255, 59, 59, 0.10);
}

.badge.good {
  border-color: rgba(37, 211, 102, 0.30);
  background: rgba(37, 211, 102, 0.10);
}

@media (max-width: 940px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  body {
    overflow: auto;
  }

  #fx {
    position: absolute;
  }
}

.dm {
  position: fixed;
  inset: 0;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.dm.open {
  opacity: 1;
  pointer-events: auto;
}

.dm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}

.dm-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100% - 36px));
  max-height: calc(100% - 36px);
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 12, 0.86);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
  transform: translate(-50%, -50%) translateY(-10px) scale(0.99);
  transition: transform 220ms ease;
}

.dm.open .dm-panel {
  transform: translate(-50%, -50%) translateY(0) scale(1);
}

.dm-panel::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(90deg, rgba(245, 160, 0, 0.0), rgba(245, 160, 0, 0.25), rgba(255, 204, 51, 0.0));
  opacity: 0.22;
  transform: translateX(-60%);
  animation: sweep 2.2s linear infinite;
  pointer-events: none;
}

.dm-head {
  position: relative;
  z-index: 1;
  padding: 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-title {
  font-weight: 900;
  letter-spacing: 0.08em;
}

.dm-actions {
  display: flex;
  gap: 8px;
}

.dm-sub {
  position: relative;
  z-index: 1;
  padding: 10px 12px 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.dm-list {
  position: relative;
  z-index: 1;
  padding: 12px;
  display: grid;
  gap: 10px;
  overflow: auto;
  max-height: calc(100vh - 140px);
}

.dm-item {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.dm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dm-name {
  font-weight: 900;
}

.dm-meta {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.dm-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 18px rgba(245, 160, 0, 0.35);
}

.dm-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.20);
  color: rgba(255, 255, 255, 0.82);
}

.dm-pill.good {
  border-color: rgba(37, 211, 102, 0.30);
  background: rgba(37, 211, 102, 0.10);
}

.dm-pill.bad {
  border-color: rgba(255, 59, 59, 0.30);
  background: rgba(255, 59, 59, 0.10);
}
