/* Reflecting Pool — style.css */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --stone:      #ede9e2;
  --stone-mid:  #d8d4cc;
  --stone-dark: #a8a49c;
  --stone-rule: #c4c0b8;
  --navy:       #0C1F3F;
  --text:       #1a2540;
  --text-faint: #5c6272;
  --font-serif: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
  --font-mono:  'IBM Plex Mono', 'Courier New', Courier, monospace;
}

html, body {
  height: 100%;
}

body {
  background: var(--stone);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 0 20px;
}

/* ── Header — deep navy government banner ── */

header {
  width: calc(100% + 40px);
  margin-left: -20px;
  margin-right: -20px;
  max-width: none;
  background: var(--navy);
  text-align: center;
  padding: 20px 24px 18px;
  border-bottom: none;
  margin-bottom: 16px;
}

.report-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7a9bbf;
  margin-bottom: 8px;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(18px, 3.2vw, 30px);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f2ede4;
  text-transform: none;
  line-height: 1.2;
  margin-bottom: 12px;
}

.header-meta {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4e6a8a;
  margin-bottom: 12px;
}

.follow-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5a7fa0;
  text-decoration: none;
  border: 1px solid #2a4a6a;
  padding: 5px 12px;
  transition: color 0.15s, border-color 0.15s;
}

.follow-link:hover {
  color: #9ab8d4;
  border-color: #4a6a8a;
}

/* ── Main layout — pool only ── */

main {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
}

/* ── Pool ── */

.pool-wrapper {
  width: min(400px, 68vw);
  aspect-ratio: 1 / 0.98;
  align-self: center;
  position: relative;
  background: #d0ccc4;
  box-shadow:
    2px  0   0 #b4b0a8,
    4px  0   0 #a4a09a,
    0    4px 0 #b4b0a8,
    0    10px 40px rgba(0,0,0,0.18);
}

#pool {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Control band — second navy band below pool ── */

.control-band {
  width: calc(100% + 40px);
  margin-left: -20px;
  margin-right: -20px;
  background: var(--navy);
  padding-top: 4px;
  padding-bottom: 40px;
}

.control-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Status bar on navy */
.control-band .status-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: 100%;
  border-top: 2px solid rgba(255,255,255,0.18);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 6px 0;
  color: #8ab0cc;
}

.control-band .status-label {
  background: #f2ede4;
  color: var(--navy);
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 0.16em;
  padding: 6px 14px;
  margin: -6px 0;
  flex-shrink: 0;
}

.control-band #status-text {
  color: #d8eaf8;
  transition: opacity 0.32s ease;
}

/* Controls header on navy */
.control-band .controls-header {
  width: 100%;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: #5a80a4;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 10px;
  text-align: left;
}

/* Controls layout */
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

/* Tool buttons on navy */
.tool-btn {
  --sharpie-barrel: #bec4ca;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 13px 16px 11px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.20);
  color: #c8dce8;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  user-select: none;
  min-width: 88px;
  border-radius: 0;
}

.tool-btn span:first-of-type {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.tool-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.42);
  color: #f0f6fc;
}

.tool-btn.active {
  --sharpie-barrel: #909aa4;
  background: rgba(255,255,255,0.14);
  color: #ffffff;
  border-color: rgba(255,255,255,0.55);
}

.tool-btn svg {
  opacity: 0.90;
}

/* Contamination display on navy */
.control-band .contamination-display {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #5a7a9a;
  width: 100%;
}

.control-band .contam-label {
  white-space: nowrap;
  flex-shrink: 0;
  color: #8ab0cc;
  font-weight: 700;
}

.control-band .contam-bar-outer {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.10);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.control-band .contam-bar-inner {
  height: 100%;
  width: 0%;
  background: #6aaa7a;
  transition: width 1.2s linear;
}

.control-band .contam-value {
  min-width: 28px;
  text-align: right;
  color: #8ab0cc;
  font-size: 9px;
}

/* ── Cursor states ── */

body.tool-paint   #pool {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38' height='38' viewBox='0 0 38 38'%3E%3Cg transform='rotate(-40%2C19%2C19)'%3E%3Crect x='22' y='0' width='2' height='22' rx='1' fill='%23909aa4'/%3E%3Cellipse cx='23' cy='22.5' rx='1.6' ry='1.3' fill='%237a8490'/%3E%3Crect x='12' y='2' width='12' height='9' rx='4.5' fill='%23111'/%3E%3Crect x='13' y='10.5' width='10' height='2.5' fill='%23111' opacity='0.72'/%3E%3Crect x='13.5' y='13' width='8.5' height='16' rx='1' fill='%23bec4ca'/%3E%3Crect x='14.5' y='13' width='1.8' height='16' rx='0.8' fill='white' opacity='0.32'/%3E%3Cpolygon points='13.5%2C29 22%2C29 20%2C35 16%2C35' fill='%23111'/%3E%3Cellipse cx='18' cy='36.5' rx='2.2' ry='1.5' fill='%23111'/%3E%3C/g%3E%3C/svg%3E") 4 34, crosshair;
}

body.tool-peroxide #pool {
  cursor: cell;
}

body.tool-police  #pool {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='28' viewBox='0 0 42 28'%3E%3Crect x='1' y='9' width='20' height='9' rx='1' fill='%23111'/%3E%3Crect x='11' y='5' width='10' height='6' rx='1' fill='%23111'/%3E%3Crect x='19' y='10' width='21' height='5' rx='1' fill='%23111'/%3E%3Cpolygon points='4,18 13,18 11,27 3,27' fill='%23111'/%3E%3C/svg%3E") 40 12, crosshair;
}

/* ── Responsive ── */

@media (max-width: 520px) {
  header { padding: 28px 16px 24px; margin-bottom: 20px; }
  .pool-wrapper { width: min(280px, 68vw); }
  .controls { gap: 8px; }
  .tool-btn { padding: 10px 12px 9px; min-width: 76px; }
  .control-band .contamination-display { flex-wrap: wrap; }
  .control-inner { padding: 0 16px; }
}
