: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;
  --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 rgba(0, 212, 255, 0.5);
}
.hidden { display: none !important; }

/* ---------- HOME ---------- */
.app-header {
  flex: 0 0 auto;
  padding: 56px 32px 24px;
  text-align: center;
}
.logo { font-size: 72px; line-height: 1; }
.app-header h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-top: 8px;
}
.tagline {
  color: var(--text-secondary);
  font-size: 20px;
  margin-top: 6px;
}
.menu {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 32px 32px;
  justify-content: center;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 88px;
  padding: 0 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 600;
  text-align: left;
}
.menu-icon { font-size: 32px; flex: 0 0 auto; }
.menu-label { flex: 1 1 auto; }
.menu-count {
  flex: 0 0 auto;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 19px;
  background: var(--bg-tertiary);
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- TOP BAR ---------- */
.bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
}
.bar-title { font-size: 24px; font-weight: 700; }
.bar-hint {
  font-size: 16px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- JOKE ---------- */
.joke-stage {
  flex: 1 1 auto;
  display: flex;
  padding: 24px;
  min-height: 0;
}
.joke-card {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: linear-gradient(160deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: 18px;
  overflow: hidden;
}
.joke-text {
  font-size: 30px;
  line-height: 1.4;
  font-weight: 600;
  text-align: center;
  max-height: 100%;
  overflow: auto;
}
.joke-text.sm { font-size: 23px; }
.joke-text.loading { color: var(--text-secondary); font-weight: 500; }

/* ---------- ACTION ROW ---------- */
.action-row {
  flex: 0 0 auto;
  display: flex;
  gap: 12px;
  padding: 16px 24px 24px;
}
.action-btn {
  flex: 1 1 0;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
}
.action-btn .ab-icon { font-size: 26px; }
.action-btn.primary {
  background: linear-gradient(135deg, #0a7ea4, #00d4ff);
  color: #001018;
}
.action-btn.saved { color: var(--accent-secondary); }

/* ---------- FAVORITES ---------- */
.fav-list {
  flex: 1 1 auto;
  overflow: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.35;
  text-align: left;
}
.fav-item .fav-txt { flex: 1 1 auto; }
.fav-item .fav-del {
  flex: 0 0 auto;
  font-size: 22px;
  color: var(--danger);
}
.fav-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 32px;
}
.fav-empty .fe-icon { font-size: 56px; }
.fav-empty p { font-size: 20px; }

/* ---------- ABOUT ---------- */
.about-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 24px;
  display: flex;
}
.about-card {
  flex: 1 1 auto;
  background: var(--bg-secondary);
  border-radius: 18px;
  padding: 28px;
}
.about-logo { font-size: 56px; text-align: center; }
.about-card h2 {
  font-size: 30px;
  text-align: center;
  margin: 8px 0 16px;
}
.about-card p {
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.about-keys {
  list-style: none;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.about-keys li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 18px;
  color: var(--text-primary);
}
.about-keys kbd {
  flex: 0 0 auto;
  min-width: 120px;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  text-align: center;
  color: var(--accent);
}
.about-src { font-size: 16px; color: var(--text-muted); margin-top: 8px; }

/* ---------- TOAST ---------- */
.toast {
  position: absolute;
  left: 50%;
  bottom: 124px;
  transform: translateX(-50%);
  padding: 14px 26px;
  background: var(--bg-tertiary);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
  pointer-events: none;
}
.toast.show { opacity: 1; }
