:root {
  --bg: #08111f;
  --bg-alt: #10203c;
  --surface: rgba(14, 24, 43, 0.85);
  --surface-soft: rgba(24, 37, 63, 0.82);
  --ink: #ecf2ff;
  --muted: #b0c0df;
  --line: rgba(180, 203, 255, 0.25);
  --accent: #42d6a4;
  --accent-2: #ffbf5f;
  --danger: #ff6e7a;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(3, 7, 18, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans Thai", "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 20% -10%, #203a70 0%, rgba(32, 58, 112, 0) 55%),
    radial-gradient(800px 620px at 95% 0%, #214059 0%, rgba(33, 64, 89, 0) 65%),
    linear-gradient(160deg, var(--bg) 0%, #0b1529 45%, #0f1c31 100%);
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(9, 17, 31, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.2px;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

a,
button {
  font: inherit;
}

.topbar a,
.ghost {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px 30px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.hero-card {
  background: linear-gradient(135deg, rgba(69, 123, 230, 0.25), rgba(66, 214, 164, 0.12));
}

.hero-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--muted);
}

.library-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.library-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.library-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

input::placeholder,
textarea::placeholder {
  color: #98adcf;
}

textarea {
  min-height: 180px;
  font-family: Consolas, Monaco, monospace;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #49d9aa, #2bb489);
  color: #05231d;
  font-weight: 700;
  cursor: pointer;
}

.btn.warn {
  background: linear-gradient(180deg, #ffcc7a, #f5ad35);
  color: #2b1a00;
}

.btn.danger {
  background: linear-gradient(180deg, #ff8992, #ef5966);
  color: #2d0f14;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.tag {
  display: inline-block;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  margin-right: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.choice-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 10px;
  min-height: 92px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
}

.choice-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(130, 181, 255, 0.7);
}

.choice-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.choice-btn img {
  max-width: 72px;
  max-height: 72px;
  display: block;
  margin: 0 auto 6px;
}

.pill-ok {
  color: #65f0bf;
  font-weight: 700;
}

.pill-bad {
  color: #ff93a0;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  overflow: hidden;
}

th,
td {
  border: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
}

th {
  background: rgba(255, 255, 255, 0.06);
}

.item-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-cell img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.hidden {
  display: none;
}

@media (max-width: 700px) {
  .topbar h1 {
    font-size: 17px;
  }

  .topbar a,
  .ghost {
    padding: 6px 10px;
    font-size: 14px;
  }

  main {
    padding: 10px;
  }
}
