:root {
  color-scheme: dark;
  --bg: #03070d;
  --ink: #f8fbff;
  --muted: #98aabd;
  --blue: #45c9ff;
  --gold: #e7c470;
  --line: rgba(221, 238, 255, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(69, 201, 255, 0.2), transparent 28rem),
    linear-gradient(180deg, #07111d 0%, #03070d 42%, #020409 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 74px);
  opacity: 0.45;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid rgba(69, 201, 255, 0.5);
  outline-offset: 3px;
}

main {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 8px 0;
  background: linear-gradient(180deg, rgba(3, 7, 13, 0.96), rgba(3, 7, 13, 0.72));
  backdrop-filter: blur(18px);
}

.topbar p,
#focus-kicker {
  margin: 0;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 0.95;
}

h1 {
  font-size: clamp(1.45rem, 6vw, 2.35rem);
}

.topbar button,
.control {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.86rem;
  font-weight: 800;
}

.topbar button {
  color: #06111d;
  background: linear-gradient(135deg, #62d4ff, #e7c470);
}

.deck-card {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(231, 196, 112, 0.3);
  border-radius: 18px;
  background: #050a12;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.deck-card img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 8;
  object-fit: cover;
}

.deck-card::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(120deg, transparent 32%, rgba(255, 255, 255, 0.16) 46%, transparent 58%);
  opacity: 0;
  transform: translateX(-80%);
}

.deck-card:hover::after {
  opacity: 1;
  animation: glint 900ms ease;
}

.deck-card span {
  position: absolute;
  right: 8%;
  bottom: 5.4%;
  left: 8%;
  min-height: 38px;
  border: 1px solid rgba(231, 196, 112, 0.55);
  border-radius: 999px;
  padding: 9px 11px;
  color: #fff4d1;
  background: rgba(1, 4, 9, 0.7);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.44);
  font-size: clamp(0.68rem, 2.5vw, 0.84rem);
  font-weight: 900;
  letter-spacing: 0.07em;
  text-align: center;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.status {
  display: grid;
  grid-template-columns: auto minmax(0, auto) minmax(0, 1fr);
  gap: 8px 12px;
  align-items: baseline;
  padding: 4px 0 14px;
}

#focus-title {
  font-size: 1rem;
}

#focus-text {
  overflow: hidden;
  margin: 0;
  color: #c6d5e5;
  font-size: 0.94rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls {
  position: sticky;
  top: 54px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 0 10px;
  background: linear-gradient(180deg, rgba(3, 7, 13, 0.92), rgba(3, 7, 13, 0.68));
  backdrop-filter: blur(18px);
}

.control {
  min-width: 0;
  padding: 0 8px;
  color: var(--muted);
}

.control.active {
  color: #06111d;
  background: var(--gold);
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 30px;
}

.deck-card {
  padding: 0;
  transform: translateY(0) scale(1);
  animation: dealIn 420ms ease both;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.deck-card:hover,
.deck-card.active {
  border-color: rgba(69, 201, 255, 0.8);
  box-shadow: 0 24px 90px rgba(69, 201, 255, 0.18);
  transform: translateY(-3px) scale(1.01);
}

@keyframes glint {
  from {
    transform: translateX(-90%);
  }
  to {
    transform: translateX(90%);
  }
}

@keyframes dealIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 720px) {
  main {
    padding: 20px;
  }

  .deck-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1080px) {
  .deck-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .status {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  #focus-text {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
