*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #ffffff;
  --surface: #f7f7f7;
  --border:  #e0e0e0;
  --text:    #121212;
  --muted:   #777777;
  --green:   #538d4e;
  --streak:  #e05a00;
  --font:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

/* ── Hub layout ─────────────────────────────────────────────────────────────── */

.hub {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 2px solid var(--text);
  margin-bottom: 36px;
}

.hub-brand {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hub-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Sections ───────────────────────────────────────────────────────────────── */

.hub-section {
  margin-bottom: 44px;
}

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 3px;
}

.section-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 14px;
}

/* ── Tile grid ──────────────────────────────────────────────────────────────── */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 520px) {
  .tile-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Game tile ──────────────────────────────────────────────────────────────── */

.game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 14px 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  background: var(--bg);
  min-height: 110px;
}

.game-tile:hover {
  border-color: #999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.game-tile.completed {
  background: var(--surface);
}

.tile-emoji {
  font-size: 1.9rem;
  line-height: 1;
  display: block;
}

.tile-name {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.tile-tag {
  font-size: 0.7rem;
  color: var(--muted);
}

/* Streak badge (top-right) */
.tile-streak {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--streak);
}

/* Completion check (bottom-right) */
.tile-check {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
}

/* ── Create card ────────────────────────────────────────────────────────────── */

.create-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.create-card:hover {
  border-color: #999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.create-icon { font-size: 1.6rem; flex-shrink: 0; }

.create-title { font-size: 0.94rem; font-weight: 700; }

.create-sub { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }

.create-arrow { margin-left: auto; font-size: 1.2rem; color: var(--muted); }

/* ── Wizard overlay ─────────────────────────────────────────────────────────── */

.wizard {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.wizard.open { opacity: 1; pointer-events: all; }

.wizard-panel {
  width: 100%;
  max-width: 500px;
  padding: 44px 44px 44px;
  position: relative;
  background: var(--bg);
  border-radius: 4px;
  color: var(--text);
  margin: 20px;
}

.wizard-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0,0,0,0.06);
  border: none;
  color: rgba(0,0,0,0.45);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
}

.wizard-close:hover { background: rgba(0,0,0,0.12); color: #000; }

.wizard-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.wizard-track {
  height: 2px;
  background: rgba(0,0,0,0.08);
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 36px;
}

.wizard-fill {
  height: 100%;
  background: #000;
  border-radius: 1px;
  width: 0%;
  transition: width 0.4s ease;
}

.wizard-q {
  font-size: clamp(1.3rem, 3.5vw, 1.85rem);
  font-weight: 300;
  line-height: 1.3;
  margin-bottom: 24px;
  transition: opacity 0.2s, transform 0.2s;
}

/* Name step */
.wizard-input {
  width: 100%;
  border: none;
  border-bottom: 2px solid #ccc;
  padding: 8px 0;
  font-size: 1.15rem;
  font-family: var(--font);
  outline: none;
  background: transparent;
  color: var(--text);
  margin-bottom: 24px;
  transition: border-color 0.2s;
}

.wizard-input:focus { border-bottom-color: #000; }

.wizard-input::placeholder { color: var(--muted); }

.wizard-next-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 11px 26px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
}

.wizard-next-btn:hover { background: #333; transform: scale(1.02); }

.wizard-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.2s;
}

.wopt {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 3px;
  padding: 13px 16px;
  cursor: pointer;
  transition: all 0.13s;
  text-align: left;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
}

.wopt:hover { background: rgba(0,0,0,0.07); border-color: rgba(0,0,0,0.2); transform: translateX(4px); }

.wopt-icon { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }

/* Build phase */
#build-phase { text-align: center; }

.build-spinner {
  font-size: 2.4rem;
  display: inline-block;
  animation: spin 2s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.build-status {
  font-size: 0.96rem;
  font-weight: 300;
  margin-bottom: 20px;
  min-height: 1.4em;
  transition: opacity 0.3s;
}

.build-track {
  height: 2px;
  background: rgba(0,0,0,0.08);
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 20px;
}

.build-fill {
  height: 100%;
  background: #000;
  border-radius: 1px;
  width: 0%;
  transition: width 0.7s ease;
}

.build-log {
  font-size: 0.74rem;
  color: var(--muted);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  text-align: left;
  max-height: 120px;
  overflow-y: auto;
  background: rgba(0,0,0,0.04);
  border-radius: 3px;
  padding: 10px 14px;
  line-height: 1.9;
}

.log-line { animation: fadein 0.25s ease; }

@keyframes fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Respect the OS "reduce motion" setting: state changes still show, nothing moves */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
