/* Shared look for every page in the arcade: type, buttons and pop-up cards. */

:root {
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ink: #1d2340;
  --muted: #5d6685;
  --blue-1: #6d7cf7;
  --blue-2: #4d5be6;
  --blue-edge: #3b47c4;
  --red-1: #f2576d;
  --red-2: #d93a55;
  --red-edge: #a82540;
  --card: #fff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #b8d0f5 0%, #d5e4f8 50%, #e5edf8 100%);
  background-attachment: fixed;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button, input { font: inherit; color: inherit; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 14px 20px;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .06s;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--blue-1), var(--blue-2));
  box-shadow: 0 4px 0 var(--blue-edge), 0 10px 20px rgba(59, 71, 196, .25);
}
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-edge); }
.btn-soft { background: #eef2fb; color: var(--blue-2); box-shadow: 0 3px 0 #d3dbef; }
.btn-soft:active { transform: translateY(2px); box-shadow: 0 1px 0 #d3dbef; }

/* Pop-up cards */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-top) + 16px) 18px calc(var(--safe-bottom) + 16px);
  background: rgba(28, 38, 84, .38);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade .18s ease-out;
}
.overlay[hidden] { display: none; }
.card {
  width: min(360px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--card);
  border-radius: 26px;
  padding: 24px 20px 20px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(20, 30, 80, .3);
  animation: pop .26s cubic-bezier(.2, 1.4, .4, 1);
}
.card h2 { margin: 2px 0 8px; font-size: 26px; font-weight: 900; letter-spacing: -.01em; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 16px; line-height: 1.4; }
.card .actions { display: grid; gap: 10px; margin-top: 16px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Settings rows and switches */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #eef1f8;
  font-weight: 800;
  text-align: left;
}
.toggle {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 52px;
  height: 32px;
  border-radius: 99px;
  background: #d6dcea;
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex: none;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
  transition: transform .2s;
}
.toggle:checked { background: #34c759; }
.toggle:checked::after { transform: translateX(20px); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 112px);
  transform: translate(-50%, 16px);
  max-width: calc(100% - 40px);
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(29, 35, 64, .92);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 40;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
