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

:root {
  --bg-widget: #17181a;
  --bg-card: #1f2123;
  --text-primary: #f5f5f3;
  --border-soft: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.12);
  /* Same green used on meanwaile-website (--accent-1/--accent-2). */
  --accent: oklch(0.72 0.19 150);
  --accent-wash: oklch(0.72 0.19 150 / 0.12);
}

/* The BrowserWindow (main.ts) is deliberately bigger than the visible card
   (POPOVER_MARGIN) and stays fully transparent out here - macOS draws its
   own native frameless-window decoration at the window's actual edges
   (that's the "double border" bug), so keeping this margin empty puts that
   decoration outside the visible card instead of ringing it. Also: no CSS
   box-shadow anywhere in this file - inside a transparent Electron window it
   doesn't blend as a soft blur, it paints as a solid black block. */
body {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  user-select: none;
  -webkit-app-region: no-drag;
}

#root {
  width: 440px;
  height: 540px;
  background: var(--bg-widget);
  border-radius: 28px;
  border: 1px solid var(--border-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 14px 24px;
}

#header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

#brand,
#game-name {
  color: var(--text-primary);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

#back-btn,
#settings-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#settings-btn {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.65);
  font-size: 16px;
}

#back-btn:hover,
#settings-btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

#back-btn[hidden] {
  display: none;
}

/* ─── Hub screen ──────────────────────────────────────────────────────── */

#hub-screen {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

#carousel {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(23, 24, 26, 0.85);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arrow-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.arrow-btn:disabled {
  color: rgba(255, 255, 255, 0.2);
  cursor: default;
}

.arrow-btn:disabled:hover {
  background: rgba(23, 24, 26, 0.85);
}

#prev-btn {
  left: 8px;
}

#next-btn {
  right: 8px;
}

#carousel-viewport {
  overflow: hidden;
  touch-action: pan-y;
}

#carousel-track {
  display: flex;
  gap: 16px;
}

#dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  flex-shrink: 0;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.2s;
}

.dot--active {
  width: 8px;
  height: 8px;
  background: var(--text-primary);
}

.game-card {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 18px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.game-card__eyebrow {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  align-self: flex-start;
}

.game-card__preview {
  width: 100%;
  max-width: 150px;
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
}

.game-card__preview--empty {
  border: 2px dashed rgba(255, 255, 255, 0.2);
}

.game-card__info {
  text-align: center;
}

.game-card__title {
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 2px;
}

.game-card__tagline {
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
}

.game-card__start {
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 26px;
  border-radius: 11px;
  cursor: pointer;
  font-family: inherit;
}

.game-card__start:hover {
  background: var(--accent-wash);
}

/* ─── Game screen ─────────────────────────────────────────────────────── */

#game-screen {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

#game-area {
  height: 100%;
  position: relative;
}

#game {
  width: 100%;
  height: 100%;
  border: none;
}

#overlay {
  position: absolute;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

#overlay-msg {
  color: var(--text-primary);
  font-size: 19px;
  font-weight: 600;
}

#continue-btn {
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 34px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
}

#continue-btn:hover {
  background: var(--accent-wash);
}

#placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px;
}

#placeholder[hidden] {
  display: none;
}

#placeholder-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
}

#placeholder-title {
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
}

#placeholder-text {
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  text-align: center;
  max-width: 220px;
}
