:root {
  --bg: #151726;
  --panel: rgba(19, 24, 39, 0.86);
  --panel-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f7f7fb;
  --muted: #b8bfd5;
  --accent: #ff6f61;
  --accent-2: #ffd166;
  --good: #58e1a8;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 111, 97, 0.18), transparent 34%),
    radial-gradient(circle at 85% 12%, rgba(255, 209, 102, 0.18), transparent 24%),
    linear-gradient(180deg, #1b1d33 0%, #11131f 100%);
}

.app {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.hero,
.stats,
.panel,
.board-shell,
.tray-shell,
.actions,
.support-strip,
.result {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1;
}

.subtitle {
  margin: 10px 0 0;
  max-width: 620px;
  color: var(--muted);
  line-height: 1.6;
}

.hub-link,
.support-strip a,
button {
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.hub-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px;
  margin-top: 14px;
}

.stats div,
.tray-head {
  background: var(--panel-2);
  border-radius: 18px;
  padding: 12px 14px;
}

.stats span,
.tray-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.stats strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.panel,
.board-shell,
.tray-shell,
.actions,
.support-strip,
.result {
  margin-top: 14px;
}

.panel {
  padding: 16px;
}

.message {
  margin: 0;
  line-height: 1.65;
  color: var(--muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
}

.legend-chip {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.board-shell {
  padding: 18px;
}

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

.locker {
  position: relative;
  padding: 14px 12px 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(9, 12, 22, 0.78);
  min-height: 190px;
}

.locker-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tile {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 11px 10px;
  text-align: left;
  color: #171717;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.tile[disabled] {
  cursor: default;
  opacity: 0.35;
  filter: saturate(0.4);
}

.tile-top {
  outline: 2px solid rgba(255, 255, 255, 0.4);
}

.tile-title {
  display: block;
  font-size: 13px;
}

.tile-sub {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.75;
}

.empty-locker {
  display: grid;
  place-items: center;
  min-height: 126px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 13px;
}

.tray-shell {
  padding: 16px;
}

.tray-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tray {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.tray-slot {
  min-height: 74px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tray-card {
  width: 100%;
  min-height: 74px;
  border-radius: 18px;
  padding: 10px 8px;
  color: #151515;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22);
}

.tray-card small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.75;
}

.tray-card.pulse {
  animation: pulse 0.38s ease;
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px;
}

button {
  appearance: none;
  border: 0;
  min-height: 54px;
  border-radius: 16px;
  font-weight: 800;
  cursor: pointer;
}

button.primary {
  background: linear-gradient(135deg, var(--accent), #ff8a65);
  color: white;
}

button.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.support-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.support-strip a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.result {
  padding: 18px;
  text-align: center;
}

.result-label {
  margin: 0;
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 0.18em;
}

.result strong {
  display: block;
  margin-top: 10px;
  font-size: 42px;
}

.result p {
  color: var(--muted);
  line-height: 1.6;
}

button:hover,
.hub-link:hover,
.support-strip a:hover {
  transform: translateY(-1px);
}

@keyframes pulse {
  0% { transform: scale(0.95); }
  70% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@media (max-width: 720px) {
  .app {
    padding: 12px 10px 24px;
  }

  .hero {
    flex-direction: column;
    align-items: stretch;
  }

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

  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tray {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .support-strip {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .board {
    gap: 10px;
  }

  .locker {
    min-height: 172px;
    padding: 12px 10px 10px;
  }

  .tile {
    padding: 10px 8px;
  }

  .tile-title {
    font-size: 12px;
  }

  .tray {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
