/* ---------- Reset & theme ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d2b23;
  --bg-2: #114134;
  --felt: radial-gradient(120% 100% at 50% 0%, #16523f 0%, #0d2b23 70%);
  --card-face: #f7f3e9;
  --ink: #eef5f1;
  --ink-dim: #9dbdb1;
  --accent: #f4b942;
  --accent-2: #e2704a;
  --danger: #c74a4a;
  --radius: 14px;
  --shadow: 0 4px 14px rgba(0, 0, 0, .35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  background-image: var(--felt);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

img { max-width: 100%; }

/* ---------- Screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}
.screen[hidden] { display: none; }

/* ---------- Bars & buttons ---------- */
.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  min-height: 52px;
}
.bar-title { font-size: 1.15rem; font-weight: 600; }
.bar-spacer { flex: 1; }

.icon-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s;
}
.icon-btn:active { background: rgba(255, 255, 255, .2); }

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 600;
  background: rgba(255, 255, 255, .12);
  color: var(--ink);
  cursor: pointer;
  transition: transform .1s, background .15s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--accent); color: #33240a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-small { padding: 8px 14px; font-size: .85rem; }

/* ---------- Modals & toast ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, .55);
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal[hidden] { display: none; }

.modal-panel {
  width: min(400px, 100%);
  background: var(--bg-2);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}
.modal-panel h2 { font-size: 1.3rem; }
.modal-buttons { display: flex; gap: 12px; justify-content: center; }

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  padding: 4px 6px;
}
.toggle-row input { width: 22px; height: 22px; accent-color: var(--accent); }

.about-text { font-size: .82rem; color: var(--ink-dim); line-height: 1.5; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1d3a32;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 14px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }
