:root {
  --primary: #7b6ef6;
  --error: #e14b4b;
  --text-dark: #181818;
  --title-color: #535d60;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Manrope', sans-serif;
  background: #000;
  overscroll-behavior: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.screen {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}

.hidden { display: none !important; }

/* ---------- Home screen ---------- */

.home-bg {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-size: cover;
  background-position: right center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 24px 0;
}

.home-header {
  text-align: center;
  padding: 0 24px;
}

.home-header h1 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 32px;
  color: var(--title-color);
  margin: 0 0 4px;
}

.subtitle {
  margin: 0 0 4px;
  font-size: 12px;
  color: #000;
}

.learn-more {
  font-size: 12px;
  color: var(--text-dark);
  text-decoration: underline;
}

.mode-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.mode-bubble {
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
  line-height: 0;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.mode-bubble img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  display: block;
}

.mode-bubble:active {
  transform: scale(0.97);
}

/* ---------- Game screen ---------- */

#game-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.game-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #2f3364;
  transition: background-image 0.3s ease;
  z-index: 0;
}

.game-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px 15px 20px;
  overflow-y: auto;
}

.top-row {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  margin-bottom: 10px;
}

.pill {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 10px 0 0;
  gap: 8px;
}

.pill img {
  width: 25px;
  height: 25px;
  border-radius: 24px;
  object-fit: cover;
}

.pill span {
  font-size: 14px;
  color: #000;
  padding: 10px 0;
}

.rappels {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 30px;
  flex-wrap: wrap;
  min-height: 70px;
}

.rappels img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
}

.btn {
  border: none;
  cursor: pointer;
  border-radius: 8px;
  height: 40px;
  padding: 0 16px;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}

.btn-primary {
  background: var(--primary);
  margin-bottom: 25px;
}

.btn-primary:active { filter: brightness(0.92); }

.action-box {
  width: 90%;
  max-height: 400px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 160px;
}

.action-title {
  font-size: 14px;
  color: #000;
  margin: 0 0 8px;
  text-align: center;
}

.action-desc-wrap {
  overflow-y: auto;
  flex: 1;
}

.action-desc {
  font-size: 14px;
  color: #000;
  white-space: pre-line;
  margin: 0;
  line-height: 1.5;
}

.btn-quit {
  background: var(--error);
  align-self: flex-start;
  margin-top: 15px;
}

/* ---------- Quit dialog ---------- */

.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.dialog-box {
  background: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  width: min(85%, 320px);
}

.dialog-box h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.dialog-box p {
  margin: 0 0 20px;
  font-size: 14px;
  color: #333;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.dialog-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 4px;
}

.dialog-cancel { color: #555; }
.dialog-confirm { color: var(--error); }
