:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --warn: #ffd166;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px;
  background: var(--bg-primary);
  border-bottom: 1px solid #23232f;
}
.topbar h1 { font-size: 26px; font-weight: 700; flex: 1; letter-spacing: 0.3px; }
.topbar .logo { font-size: 30px; }

/* ---- Nav bar ---- */
.navbar {
  display: flex; gap: 14px;
  padding: 16px 22px;
  background: var(--bg-primary);
  border-top: 1px solid #23232f;
}
.navbtn {
  flex: 1; min-height: 80px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 19px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.navbtn.small {
  flex: 0 0 auto; min-height: 44px;
  padding: 0 18px; font-size: 16px;
}

/* ---- Home stage / ball ---- */
.stage {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 26px; padding: 12px;
}
.ball {
  width: 300px; height: 300px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: radial-gradient(circle at 35% 28%, #2c2c42 0%, #14141f 46%, #0a0a0f 100%);
  box-shadow: inset -18px -18px 48px rgba(0,0,0,0.65), 0 12px 40px rgba(0,0,0,0.55);
}
.ball::before {
  content: ''; position: absolute; top: 26px; left: 56px;
  width: 92px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.20), transparent 70%);
  filter: blur(5px); pointer-events: none;
}
.ball:focus { box-shadow: inset -18px -18px 48px rgba(0,0,0,0.65), 0 0 26px var(--focus-glow); }

.ball-eight {
  width: 132px; height: 132px; border-radius: 50%;
  background: #f3f3f3; color: #111;
  display: flex; align-items: center; justify-content: center;
  font-size: 82px; font-weight: 800; line-height: 1;
  box-shadow: inset 0 -6px 14px rgba(0,0,0,0.25);
}
.ball-window {
  width: 214px; height: 214px; border-radius: 50%;
  padding: 22px; text-align: center;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, #11224d 0%, #060c1f 80%);
  box-shadow: inset 0 0 34px rgba(0,0,0,0.6);
}
.ball-answer { font-size: 24px; font-weight: 700; line-height: 1.25; color: var(--text-secondary); }
.ball-window.yes   .ball-answer { color: var(--accent-secondary); }
.ball-window.maybe .ball-answer { color: var(--warn); }
.ball-window.no    .ball-answer { color: var(--danger); }

.hint { color: var(--text-secondary); text-align: center; font-size: 18px; line-height: 1.45; }
.hint b { color: var(--accent); }

/* ---- Shake + think animations ---- */
@keyframes shake {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  15% { transform: translate(-9px, 5px) rotate(-3deg); }
  30% { transform: translate(9px, -5px) rotate(3deg); }
  45% { transform: translate(-7px, -3px) rotate(-2deg); }
  60% { transform: translate(7px, 4px) rotate(2deg); }
  75% { transform: translate(-4px, 2px) rotate(-1deg); }
}
.ball.shaking { animation: shake 0.6s ease-in-out; }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.ball-window.thinking { animation: pulse 0.5s ease-in-out infinite; }

/* ---- History list ---- */
.list {
  flex: 1; overflow-y: auto;
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.hrow {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 12px 14px; min-height: 44px;
  display: flex; align-items: center; gap: 12px;
}
.htag {
  font-weight: 800; font-size: 13px; letter-spacing: 0.5px;
  padding: 5px 11px; border-radius: 999px; flex: 0 0 auto;
}
.htag.yes   { color: #03110a; background: var(--accent-secondary); }
.htag.maybe { color: #1a1400; background: var(--warn); }
.htag.no    { color: #1a0008; background: var(--danger); }
.htext { font-size: 16px; color: var(--text-primary); line-height: 1.3; }
.empty { color: var(--text-muted); text-align: center; margin-top: 48px; font-size: 18px; }

/* ---- About ---- */
.about {
  flex: 1; overflow-y: auto;
  padding: 18px 22px;
  color: var(--text-secondary); font-size: 17px; line-height: 1.5;
}
.about b { color: var(--text-primary); }
.about h2 { color: var(--text-primary); font-size: 19px; margin: 16px 0 8px; }
.about ul { margin: 6px 0 6px 22px; }
.about li { margin: 5px 0; }
.about .muted { color: var(--text-muted); margin-top: 16px; font-size: 15px; }
.about .yes   { color: var(--accent-secondary); font-weight: 700; }
.about .maybe { color: var(--warn); font-weight: 700; }
.about .no    { color: var(--danger); font-weight: 700; }
