/* --- Light & Punchy Dark Themes + Mobile-first layout ---
   Background image path: update url("assets/wolf-bg.jpg") if you use a different filename/path.
*/

/* Light theme vars */
:root {
  --bg: #f7f7fb;
  --text: #1f2937;         /* gray-800 */
  --muted: #6b7280;        /* gray-500 */
  --accent: #2563eb;       /* blue-600 */
  --accent-contrast: #ffffff;
  --danger: #dc2626;       /* red-600 */
  --border: #e5e7eb;       /* gray-200 */
  --card: rgba(255,255,255,0.9);
  --card-border: rgba(0,0,0,0.06);
  --btn-surface: #ffffff;
  --minus-bg: #fee2e2;     /* red-100 */
  --minus-border: #fecaca; /* red-200 */
  --plus-bg: #e0f2fe;      /* sky-100 */
  --plus-border: #bae6fd;  /* sky-200 */
  --appbar-h: 64px;        /* used when footer is fixed; here we keep it for sizing */
}

/* Dark theme — high contrast */
html[data-theme="dark"] {
  --bg: #0b1220;                 /* deep navy */
  --text: #e5e7eb;               /* gray-200 */
  --muted: #94a3b8;              /* slate-400 */
  --accent: #22d3ee;             /* cyan-400 */
  --accent-contrast: #041015;
  --danger: #ef4444;             /* red-500 */
  --border: #1f2937;             /* gray-800 */
  --card: rgba(17,24,39,0.9);    /* gray-900 glass */
  --card-border: rgba(255,255,255,0.06);
  --btn-surface: rgba(68,70,77,0.92);  /* match score cards */
  --minus-bg: #3b0b0b;           /* dark red tint */
  --minus-border: #7f1d1d;
  --plus-bg: #0b2a3b;            /* dark blue tint */
  --plus-border: #0e7490;
}
/* Prevent double-tap zoom on iOS and keep 16px sizing */
html { -webkit-text-size-adjust: 100%; }
button, input { touch-action: manipulation; }

html, body { height: 100%; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

/* Flex page wrapper so footer sits at bottom when content is short, but scrolls with page */
.page { min-height: 100dvh; display: flex; flex-direction: column; }
.main { flex: 1; }

/* Wolf background (works for both themes) */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    radial-gradient(ellipse at 30% 10%, rgba(255,255,255,0.85), rgba(255,255,255,0.35) 40%, rgba(255,255,255,0) 60%),
    url("assets/wolf-bg.jpg");
  background-size: cover; background-position: center; background-attachment: fixed;
  filter: saturate(110%) contrast(105%);
  z-index: -2;
}
html[data-theme="dark"] body::before {
  background-image:
    radial-gradient(ellipse at 30% 10%, rgba(0,0,0,0.35), rgba(0,0,0,0.65) 50%, rgba(0,0,0,0.8) 70%),
    url("assets/wolf-bg.jpg");
  filter: saturate(120%) contrast(112%) brightness(0.9);
}

/* Subtle overlay for readability */
body::after {
  content: ""; position: fixed; inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.25), rgba(255,255,255,0.05));
  pointer-events: none; z-index: -1;
}
html[data-theme="dark"] body::after {
  background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.2));
}

.container { max-width: 560px; margin: 0 auto; padding: 12px; width: 95%; }
header h1 { margin: 8px 0 12px; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
html[data-theme="dark"] header h1 { text-shadow: none; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 12px;
  box-shadow: 0 10px 24px rgba(31,41,55,0.08);
}

.hidden { display: none; }
.center { text-align: center; }
.muted { color: var(--muted); }
.mt { margin-top: 12px; }
.mt-small { margin-top: 6px; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.gap { gap: 8px; }
.mobile-stack { flex-direction: column; gap: 10px; align-items: stretch; }

/* Setup fields: keep inputs a percentage of the card to prevent overflow */
#setup .field { display: flex; flex-direction: column; align-items: center; }
#setup .field input { width: 92%; max-width: 92%; margin: 0 auto; }

label { display: block; font-weight: 650; margin-bottom: 6px; color: #111827; width: 92%; }
html[data-theme="dark"] label { color: var(--text); }

input, button {
  background: var(--btn-surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;               /* comfortable touch size */
  font-size: 16px;
}
input { width: 100%; }

/* Buttons */
button { cursor: pointer; transition: transform 0.05s ease, box-shadow 0.15s ease; }
button:active { transform: translateY(1px); }
button:hover { box-shadow: 0 2px 10px rgba(37,99,235,0.12); }

button.primary { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }
button.secondary { background: #f3f4f6; }
html[data-theme="dark"] button.secondary {
  background: var(--btn-surface);
  color: var(--text);
  border-color: #3a3d43;
}
button.danger { background: var(--danger); border-color: transparent; color: #fff; }
button.small { font-size: 14px; padding: 10px 12px; }

.linklike { background: transparent; border: none; color: var(--accent); padding: 4px 8px; border-radius: 8px; }
.linklike:hover { text-decoration: underline; box-shadow: none; }

/* Footer toggle: white text */
.footer-toggle { color: #ffffff !important; }

/* Hole pill */
.pill {
  display: inline-block;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
html[data-theme="dark"] .pill { background: #0b1220; }

/* Score list */
.list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto; /* prevent overflow */
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffffd9;
  backdrop-filter: blur(2px);
}
html[data-theme="dark"] .item { background: rgba(68,70,77,0.92); }

.name {
  font-weight: 800; padding-left: 2px; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[data-theme="dark"] .name { color: var(--text); }

.score {
  min-width: 3.5ch; text-align: center;
  font-variant-numeric: tabular-nums; font-weight: 800; color: #0f172a;
}
html[data-theme="dark"] .score { color: var(--text); }

/* Big colored +/- buttons for both themes */
.btn {
  min-width: 52px; min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 20px; line-height: 1;
}
.btn.minus { background: var(--minus-bg); border-color: var(--minus-border); color: #7f1d1d; }
.btn.plus  { background: var(--plus-bg);  border-color: var(--plus-border);  color: #0e7490; }
html[data-theme="dark"] .btn.minus { color: #fecaca; }
html[data-theme="dark"] .btn.plus  { color: #67e8f9; }

/* Bottom bar IN NORMAL FLOW (not fixed, not overlaying content) */
.footbar {
/*  margin-top: 8px;*/
/*  padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0));*/
/*  background: rgba(255,255,255,0.85);*/
/*  border-top: 1px solid var(--card-border);*/
/*  backdrop-filter: blur(8px);*/
/*  -webkit-backdrop-filter: blur(8px);*/
}
html[data-theme="dark"] .footbar {
/*  background: rgba(17,24,39,0.88);*/
}
.footbar .container {
  display: flex; align-items: center; justify-content: space-between;
  width: 95%;
}

