body {
  min-height: 100vh;
  background:
    repeating-linear-gradient(0deg, #0000 0 22px, #ffffff06 22px 24px),
    radial-gradient(circle at 50% -20%, #1a4d85, var(--bg) 60%);
}
main { max-width: 960px; margin: 0 auto; padding: 8px 16px 48px; }
h1 { color: var(--accent); text-shadow: 3px 3px 0 #000; letter-spacing: 1px; margin: 16px 0 12px; }
h2 { margin: 24px 0 12px; letter-spacing: 1px; }
.panel h2 { margin-top: 0; }
h3 { margin: 16px 0 6px; font-size: 15px; color: var(--dim); }
.small { font-size: 13px; }
.wide { width: 100%; margin-top: 12px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; max-width: 960px; margin: 0 auto;
}
.logo {
  font-size: 22px; font-weight: bold; color: var(--text); text-decoration: none; letter-spacing: 3px;
  text-shadow: 3px 3px 0 #000;
}
.logo span { color: var(--accent); margin-left: 4px; }
.top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top-right .button { padding: 4px 10px; }

.intro { text-align: center; margin: 24px 0 20px; }
.intro p { color: var(--dim); max-width: 34em; margin: 0 auto; }
.signin { width: min(400px, 100%); margin: 0 auto; }

.hello { margin-top: 8px; }
.earn { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.earn .big { font-size: 28px; }
.earn > div { flex: 1 1 220px; }

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.game {
  display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 3px solid var(--border);
  box-shadow: 4px 4px 0 2px #0006; padding: 14px;
}
.game .head { display: flex; gap: 12px; align-items: center; }
.game .icon {
  width: 56px; height: 56px; flex: none; image-rendering: pixelated; border: 2px solid #000;
  background: var(--panel-2); display: grid; place-items: center; font-size: 30px;
}
.game .name { font-weight: bold; font-size: 17px; }
.game p { margin: 0; color: var(--dim); font-size: 14px; flex: 1; }
.game .button, .game button { width: 100%; }
.game.soon { opacity: .75; border-style: dashed; }

.back { display: inline-block; margin-top: 8px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.big { font-size: 30px; font-weight: bold; color: var(--accent); }
.history { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.history li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed #ffffff22; }
.history .plus { color: var(--good); font-weight: bold; }
.history .minus { color: var(--arcade); font-weight: bold; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.badge {
  text-align: center; font-size: 12px; padding: 8px 4px; border: 2px solid var(--border); background: var(--panel-2);
}
.badge .emoji { font-size: 28px; display: block; }
.badge.locked { filter: grayscale(1); opacity: .4; border-style: dashed; }

@media (max-width: 480px) {
  .logo { font-size: 18px; }
  h1 { font-size: 24px; }
}

.tag.staff { color: var(--accent); font-size: 14px; vertical-align: middle; text-shadow: none; }

.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-head h2 { margin: 0; }
.request { border-top: 2px dashed #ffffff22; padding: 12px 0; display: grid; gap: 8px; }
.req-reason { margin-top: 4px; }
.req-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.req-actions label { margin: 0; }
.req-actions input[type=number] { width: 6em; }
.req-actions .error { flex-basis: 100%; margin: 0; }

/* Subject shelves sit side by side (each as wide as its games need) and wrap on small screens. */
#games { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: stretch; }
.shelf { flex: var(--n, 1) 1 calc(var(--n, 1) * 260px); min-width: min(260px, 100%); display: flex; flex-direction: column; }
.shelf .games { flex: 1; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.shelf .game { height: 100%; }
.shelf h3 { color: var(--text); font-size: 20px; margin: 24px 0 12px; letter-spacing: 1px; }
.wide-panel { grid-column: 1 / -1; }
.days { display: flex; gap: 4px; align-items: flex-end; height: 64px; margin: 6px 0 10px; border-bottom: 2px solid var(--dim); }
.day { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.day .col { width: 100%; background: #24497f; display: flex; align-items: flex-end; min-height: 2px; }
.day .right { width: 100%; background: var(--good); }
.totals { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.skills { width: 100%; border-collapse: collapse; font-size: 14px; }
.skills th { text-align: left; color: var(--dim); font-weight: normal; border-bottom: 1px solid #ffffff33; }
.skills td { padding: 4px 6px 4px 0; border-bottom: 1px dashed #ffffff18; }
.acc { display: inline-block; width: 60px; height: 8px; background: #0b1a33; border: 1px solid #000; vertical-align: middle; }
.acc div { height: 100%; background: var(--good); }
