:root {
  --navy: #080b14;
  --cyan: #33e4ff;
  --violet: #8b2cff;
  --magenta: #ff3dc6;
  --ice: #f4fbff;
  --aqua: #4cf2c7;
  --muted: #c9d6e5;
  --ok: #4cf2a0;
  --bad: #ff5d86;
  --dim: #8996a9;
  --bay: min(52vw, 268px);
  color-scheme: dark;
  font-family: Roboto, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--navy);
  color: var(--ice);
}

button, input { font: inherit; }

button { cursor: pointer; }

button:disabled { cursor: default; }

#brine-root {
  min-height: 100%;
  min-height: 100dvh;
}

.brine-field {
  background-color: var(--navy);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.brine-field-calm { background-image: linear-gradient(180deg, rgba(5, 9, 20, .36), rgba(8, 11, 20, .78) 42%, rgba(8, 11, 20, .95)), url("../gfx/field-calm.webp"); }
.brine-field-surge { background-image: linear-gradient(180deg, rgba(5, 9, 20, .36), rgba(8, 11, 20, .78) 42%, rgba(8, 11, 20, .95)), url("../gfx/field-surge.webp"); }
.brine-field-vault { background-image: linear-gradient(180deg, rgba(5, 9, 20, .36), rgba(8, 11, 20, .78) 42%, rgba(8, 11, 20, .95)), url("../gfx/field-vault.webp"); }

.brine-frame {
  width: min(100%, 480px);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}

.brine-scroll {
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(92px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brine-oath {
  min-height: 100dvh;
  justify-content: center;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.brine-card {
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(24, 33, 49, .93), rgba(12, 17, 29, .91));
  border: 1px solid rgba(51, 228, 255, .28);
  box-shadow: 0 12px 28px rgba(51, 228, 255, .08);
}

.brine-card-title:empty { display: none; }

.brine-card-title, .brine-kicker, .brine-unit, .brine-meter-top span {
  margin: 0;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.brine-center { text-align: center; }

.brine-sum {
  margin: 6px 0;
  font-size: 38px;
  line-height: 1.1;
  font-weight: 900;
}

.brine-h, .brine-head h1, .brine-sheet h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.brine-p, .brine-muted, .brine-fine { color: var(--muted); line-height: 1.45; }

.brine-fine { margin: 4px 0 8px; text-align: center; font-size: 14px; }

.brine-ok { color: var(--ok); margin: 0; }

.brine-warn { color: var(--bad); font-weight: 700; text-align: center; margin: 0; }

.brine-cta, .brine-ghost, .brine-stop, .brine-chip, .brine-danger, .brine-text, .brine-switch, .brine-dial, .brine-back, .brine-hop {
  border-radius: 14px;
  border: 1px solid transparent;
}

.brine-cta, .brine-stop {
  background: var(--cyan);
  color: #06101a;
  font-weight: 900;
  letter-spacing: .04em;
  min-height: 48px;
  padding: 0 14px;
}

.brine-cta-block { width: 100%; }

.brine-stop { background: var(--bad); color: var(--ice); }

.brine-ghost, .brine-chip {
  background: rgba(18, 24, 36, .72);
  color: var(--cyan);
  border-color: rgba(51, 228, 255, .28);
  min-height: 48px;
  font-weight: 800;
}

.brine-chip { min-height: 36px; padding: 0 10px; font-size: 10px; letter-spacing: .08em; }

.brine-danger {
  background: transparent;
  color: var(--bad);
  border-color: rgba(255, 93, 134, .45);
  min-height: 48px;
  font-weight: 800;
}

.brine-text { background: transparent; color: var(--cyan); min-height: 40px; }

.brine-split { display: flex; gap: 8px; }

.brine-split > * { flex: 1; }

.brine-daily { display: flex; gap: 12px; align-items: center; }

.brine-daily-art { width: 72px; height: 72px; object-fit: contain; }

.brine-daily .brine-cta { min-height: 40px; margin-top: 8px; }

.brine-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.brine-head-copy { display: flex; align-items: center; gap: 10px; }

.brine-back {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(24, 33, 49, .78);
  color: var(--cyan);
  border: 1px solid rgba(51, 228, 255, .28);
  font-size: 21px;
}

.brine-pair {
  border-radius: 18px;
  padding: 10px 14px;
  min-height: 68px;
  background: linear-gradient(180deg, rgba(24, 33, 49, .93), rgba(12, 17, 29, .91));
  border: 1px solid rgba(51, 228, 255, .28);
  border-left: 4px solid var(--cyan);
}

.brine-pair-win { border-color: rgba(255, 61, 198, .35); border-left-color: var(--magenta); }

.brine-pair-label { display: block; color: var(--muted); font-size: 10px; letter-spacing: .08em; }

.brine-pair-value { font-size: 22px; }

.brine-banner-surge {
  margin: 0;
  text-align: center;
  font-weight: 900;
  background: rgba(139, 44, 255, .75);
  border-radius: 12px;
  padding: 8px;
}

.brine-meter-top { display: flex; justify-content: space-between; margin-bottom: 7px; }

.brine-meter-top b { font-size: 12px; }

.brine-segs { display: flex; gap: 4px; }

.brine-seg { flex: 1; height: 8px; border-radius: 8px; background: #273044; }

.brine-seg-on { background: linear-gradient(90deg, var(--cyan), var(--aqua)); }

.brine-seg-hot { background: linear-gradient(90deg, var(--cyan), var(--magenta)); }

.brine-grid {
  position: relative;
  display: flex;
  gap: 4px;
  height: var(--bay);
  box-sizing: border-box;
  padding: 6px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(14, 21, 34, .95), rgba(5, 8, 16, .98));
  border: 1px solid rgba(51, 228, 255, .48);
  overflow: hidden;
}

.brine-reel { flex: 1; overflow: hidden; height: 100%; border-radius: 12px; }

.brine-strip { display: flex; flex-direction: column; }

.brine-cell {
  height: calc((var(--bay) - 12px) / 3);
  margin: 0;
  border-radius: 12px;
  position: relative;
  background: linear-gradient(180deg, rgba(26, 34, 50, .9), rgba(13, 20, 33, .9));
  border: 1px solid rgba(255, 255, 255, .06);
  display: grid;
  place-items: center;
}

.brine-cell img { width: 100%; height: 100%; object-fit: contain; }

.brine-cell-hot { border: 2px solid var(--magenta); }

.brine-cell-hot img { transform: scale(1.06); }

.brine-tag {
  position: absolute;
  bottom: 2px;
  font-size: 8px;
  font-weight: 900;
  background: rgba(8, 11, 20, .84);
  border-radius: 5px;
  padding: 1px 4px;
}

.brine-wires { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); pointer-events: none; }

.brine-status {
  margin: 0 auto;
  min-height: 28px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(14, 21, 34, .7);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-align: center;
}

.brine-status-win { color: var(--ok); }

.brine-bet { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.brine-step { display: flex; align-items: center; gap: 8px; }

.brine-step button {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: transparent;
  color: var(--ice);
  border: 1px solid rgba(51, 228, 255, .35);
  font-size: 19px;
}

.brine-step b { min-width: 58px; text-align: center; font-size: 24px; }

.brine-dial {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 0;
  color: var(--ice);
  font-weight: 900;
  letter-spacing: .06em;
  background: url("../gfx/dial.webp") center/cover no-repeat;
}

.brine-dial-off { opacity: .42; }

.brine-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(24, 33, 49, .93), rgba(12, 17, 29, .91));
  border: 1px solid rgba(90, 100, 118, .7);
  color: var(--ice);
}

.brine-switch b { display: block; }

.brine-switch small { color: var(--muted); }

.brine-switch-on { border-color: rgba(51, 228, 255, .45); }

.brine-switch-on small { color: var(--cyan); }

.brine-switch i {
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: #3a4458;
  position: relative;
}

.brine-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d5deea;
}

.brine-switch-on i { background: var(--cyan); }

.brine-switch-on i::after { left: 21px; }

.brine-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(24, 33, 49, .93), rgba(12, 17, 29, .91));
  border: 1px solid rgba(139, 44, 255, .35);
}

.brine-stat-label { color: var(--muted); }

.brine-stat-value { font-size: 18px; }

.brine-sub { margin: 8px 0 0; color: var(--cyan); font-size: 16px; }

.brine-pay { display: flex; gap: 10px; align-items: center; padding: 6px 0; }

.brine-pay img { width: 52px; height: 52px; object-fit: contain; }

.brine-pay p, .brine-lines { margin: 0; color: var(--muted); }

.brine-age {
  display: inline-block;
  margin: 0 auto 8px;
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--magenta);
  border: 1px solid rgba(255, 61, 198, .55);
  background: rgba(255, 61, 198, .14);
  font-weight: 900;
}

.brine-dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 480px);
  display: flex;
  background: rgba(11, 16, 27, .98);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 4;
}

.brine-dock-away { display: none; }

.brine-hop {
  flex: 1;
  background: transparent;
  color: var(--dim);
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 52px;
  font-size: 10px;
  font-weight: 600;
}

.brine-hop-lit {
  color: var(--cyan);
  font-weight: 800;
  background: rgba(47, 230, 255, .2);
  border-radius: 16px;
}

.brine-hop-svg { width: 22px; height: 22px; }

.brine-veil {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, .72);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 6;
}

.brine-sheet {
  width: min(100%, 420px);
  background: #141822;
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.brine-vault { width: 150px; height: 150px; object-fit: contain; margin: 0 auto; }

.brine-capsules { display: flex; justify-content: space-evenly; }

.brine-capsules button { background: transparent; border: 0; padding: 0; }

.brine-capsules img { width: 82px; height: 82px; border-radius: 16px; object-fit: cover; }

.brine-toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(92%, 440px);
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #1c2433;
  color: var(--ice);
  text-align: center;
  z-index: 7;
}
