/* =========================================================
   CoralMood — Ocean & Coral themed stylesheet
   ========================================================= */

:root {
  --coral: #ff6f59;
  --coral-dark: #e5533f;
  --coral-light: #ffb199;
  --teal: #0fa3b1;
  --teal-dark: #086b76;
  --teal-light: #6fe4ec;
  --deep-sea: #033f5c;
  --deep-sea-darker: #022638;
  --sand: #fdf3e0;
  --foam: #f4fbfc;
  --ink: #0b2b36;
  --muted: #4d6b74;
  --success: #2ecc71;
  --danger: #e74c3c;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --shadow-sm: 0 2px 8px rgba(3, 63, 92, 0.12);
  --shadow-md: 0 8px 24px rgba(3, 63, 92, 0.18);
  --shadow-lg: 0 20px 48px rgba(3, 63, 92, 0.25);
  --header-h: 72px;
  --max-width: 1180px;
  --font-heading: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--foam);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--deep-sea-darker);
}

p { margin: 0 0 1em; color: var(--muted); }
.developer-note {
  color: #a7655a;
  font-family: "Kalam", cursive;
  font-size: 0.9rem;
  line-height: 1.65;
}

a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: var(--coral-dark); }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: var(--shadow-md); color: #fff; transform: translateY(-2px); }

.btn-secondary {
  background: #fff;
  color: var(--teal-dark);
  border-color: var(--teal-light);
}
.btn-secondary:hover { background: var(--teal-light); color: var(--deep-sea-darker); }

.storage-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.storage-dialog { width:min(620px, calc(100% - 32px)); max-height:80vh; padding:24px; border:0; border-radius:16px; color:var(--deep-sea-darker); box-shadow:var(--shadow-lg); }
.storage-dialog[open] { display:block; position:fixed; top:10%; left:50%; z-index:1000; transform:translateX(-50%); overflow:auto; }
.storage-dialog::backdrop { background:rgba(4, 34, 43, .58); }
.storage-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.storage-dialog-actions { margin-bottom:18px; }
.storage-dialog h3 { margin:0; }
.storage-dialog-close { width:36px; height:36px; border:0; border-radius:50%; background:var(--teal-light); color:var(--deep-sea-darker); font-size:1.4rem; line-height:1; cursor:pointer; }
.storage-dialog dl { margin:0; }
.storage-dialog dt { margin-top:14px; font-weight:700; overflow-wrap:anywhere; }
.storage-dialog dt label { display:flex; align-items:flex-start; gap:8px; cursor:pointer; }
.storage-dialog dt input { flex:0 0 auto; margin-top:4px; }
.storage-dialog dd { margin:4px 0 0; padding:10px; background:#f4fbfc; border-radius:6px; white-space:pre-wrap; overflow-wrap:anywhere; font-family:monospace; font-size:.85rem; }

.btn-ghost {
  background: transparent;
  color: var(--foam);
  border-color: rgba(255,255,255,0.6);
}
.btn-ghost:hover { background: rgba(255,255,255,0.15); color: #fff; }

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(3, 63, 92, 0.92);
  backdrop-filter: blur(10px);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-md); background: rgba(3, 63, 92, 0.98); }

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff;
  margin-right: auto;
}
.brand .wave-emoji { font-size: 1.5rem; }
.brand span.mood { color: var(--coral-light); }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav a {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
  position: relative;
}
.nav a:hover, .nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}
.nav a.nav-blog {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 111, 89, 0.28);
}
.nav a.nav-blog:hover {
  background: var(--coral-light);
  color: var(--deep-sea-darker);
}
.nav a.active::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
}

.theme-toggle {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.5); }
.theme-toggle:focus-visible { outline: 2px solid var(--coral-light); outline-offset: 2px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 26px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: #fff;
  padding: 120px 0 90px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--deep-sea) 0%, var(--teal-dark) 100%);
}
.hero-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  z-index: 0;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,111,89,0.25), transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(111,228,236,0.25), transparent 45%);
  z-index: 1;
}
.hero .container { position: relative; z-index: 2; }
.hero-inner { max-width: 680px; }
.hero-kicker {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
  font-weight: 600;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 0.3em;
}
.hero p.lead {
  color: rgba(255,255,255,0.85);
  font-size: 1.15rem;
  max-width: 560px;
}
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

.page-hero {
  padding: 90px 0 60px;
}

/* floating bubbles */
.bubbles { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.bubble {
  position: absolute;
  bottom: -60px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(255,255,255,0.05));
  animation: rise linear infinite;
}
@keyframes rise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.8; }
  100% { transform: translateY(-620px) translateX(20px); opacity: 0; }
}

.wave-divider {
  display: block;
  width: 100%;
  line-height: 0;
  margin-top: -6px;
}
.wave-divider svg { width: 100%; height: 70px; display: block; }

/* ---------- Sections ---------- */
section { padding: 70px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head .kicker {
  color: var(--coral-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.games-library {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(244,251,252,0.9), rgba(224,246,244,0.96)),
    url("../img/hero-coral.jpg") center / cover;
}
.games-library::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.7;
  background:
    radial-gradient(ellipse at 8% 8%, rgba(255,111,89,0.22) 0 11%, transparent 32%),
    radial-gradient(ellipse at 95% 78%, rgba(15,163,177,0.2) 0 13%, transparent 34%),
    repeating-linear-gradient(115deg, transparent 0 54px, rgba(255,255,255,0.28) 55px 57px, transparent 58px 108px);
}
.games-library .container { position: relative; }
.games-library .card {
  border-color: rgba(15,163,177,0.16);
  box-shadow: 0 8px 24px rgba(3,63,92,0.12);
}

.home-link-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.home-link-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.7;
  background:
    radial-gradient(ellipse at 8% 12%, rgba(255,111,89,0.16) 0 12%, transparent 34%),
    radial-gradient(ellipse at 92% 82%, rgba(15,163,177,0.14) 0 14%, transparent 35%),
    repeating-linear-gradient(115deg, transparent 0 70px, rgba(255,255,255,0.3) 71px 73px, transparent 74px 140px);
}
.home-new { background: #f4fbfc; }
.home-popular { background: linear-gradient(180deg, #e8f7f6, #f4fbfc); }
.home-link-section .container { position: relative; }
.home-link-grid { align-items: stretch; }
.home-link-card { display: flex; flex-direction: column; }
.home-link-card .icon-badge { margin-bottom: 14px; }
.home-link-card p { font-size: 0.9rem; }
.home-link-launch {
  margin-top: auto;
  align-self: flex-start;
  color: var(--coral-dark);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.grid {
  display: grid;
  gap: 28px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(3,63,92,0.06);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

.icon-badge {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: linear-gradient(135deg, var(--teal-light), var(--teal));
  color: #fff;
  margin-bottom: 18px;
}

.link-card {
  display: block;
  color: inherit;
}
.link-card:hover { color: inherit; }
.meditation-card {
  display: flex;
  flex-direction: column;
}
.meditation-card p { font-size: 0.9rem; }
.link-card .meditation-launch,
.link-card:hover .meditation-launch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  align-self: flex-start;
  color: var(--coral-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--coral-dark);
  margin-bottom: 10px;
}
.tag.teal { background: rgba(15,163,177,0.12); color: var(--teal-dark); }
.tag.games { background: rgba(255,111,89,0.14); color: var(--coral-dark); }
.tag.relax { background: rgba(214,140,30,0.14); color: #8a5510; }
.tag.meditate { background: rgba(150,60,115,0.12); color: #8a3a6a; }
.tag.utility { background: rgba(15,163,177,0.12); color: var(--teal-dark); }
.tag.devtool { background: rgba(107,76,154,0.12); color: #5a3f86; }


/* ---------- Feature strip / stats ---------- */
.strip {
  background: var(--deep-sea);
  color: #fff;
  padding: 40px 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}
.stats .num { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; color: var(--teal-light); }
.stats .label { font-size: 0.85rem; color: rgba(255,255,255,0.7); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--deep-sea-darker);
  color: rgba(255,255,255,0.75);
  padding: 60px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-grid h4 { color: #fff; font-size: 0.95rem; margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: rgba(255,255,255,0.65); }
.footer-grid a:hover { color: var(--coral-light); }
.footer-disclaimer {
  max-width: 860px;
  margin: 0 0 24px;
  color: rgba(255,255,255,0.62);
  font-size: 0.82rem;
}
.footer-disclaimer strong { color: rgba(255,255,255,0.84); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
}

/* ---------- Forms / tool panels ---------- */
.tool-panel {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
  border: 1px solid rgba(3,63,92,0.06);
}
.tool-panel h3 { display: flex; align-items: center; gap: 10px; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--deep-sea);
}
.field small { color: var(--muted); display: block; margin-top: 4px; }

input[type="text"], input[type="number"], input[type="password"],
textarea, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #dcebee;
  background: var(--foam);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15,163,177,0.15);
}
textarea { resize: vertical; min-height: 140px; font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.85rem; }

.input-row { display: flex; gap: 14px; flex-wrap: wrap; }
.input-row > * { flex: 1; min-width: 160px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; font-weight: 500; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

.output-box {
  background: var(--deep-sea-darker);
  color: #d7f5f8;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 60px;
  max-height: 340px;
  overflow: auto;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(15,163,177,0.1);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 1rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--deep-sea-darker);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 999;
  font-size: 0.9rem;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.tab-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid #dcebee;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s ease;
}
.tab-btn.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* strength meter */
.strength-meter { height: 8px; border-radius: 999px; background: #e6f3f4; overflow: hidden; margin-top: 10px; }
.strength-meter > div { height: 100%; width: 0%; transition: width 0.3s ease, background 0.3s ease; }

/* ---------- Game catalog ---------- */
.catalog-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 32px;
}
.catalog-search {
  max-width: 420px;
}
.catalog-search input {
  width: 100%;
}
.catalog-count {
  color: var(--muted);
  font-size: 0.85rem;
}
#game-filters { margin-bottom: 0; }

.game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  color: inherit;
}
.game-tile:hover { color: inherit; }
.game-tile h3 { font-size: 1.05rem; }
.game-tile p { font-size: 0.88rem; margin-bottom: 8px; }
.game-launch {
  margin-top: auto;
  align-self: flex-start;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--coral-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  display: none;
}

/* ---------- Music library ---------- */
.music-library {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(244,251,252,0.9), rgba(224,246,244,0.96)),
    url("../img/hero-coral.jpg") center / cover;
}
.music-library::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.7;
  background:
    radial-gradient(ellipse at 8% 8%, rgba(255,111,89,0.22) 0 11%, transparent 32%),
    radial-gradient(ellipse at 95% 78%, rgba(15,163,177,0.2) 0 13%, transparent 34%),
    repeating-linear-gradient(115deg, transparent 0 54px, rgba(255,255,255,0.28) 55px 57px, transparent 58px 108px);
}
.music-library .container { position: relative; }
.music-card { display: flex; flex-direction: column; }
.music-card .icon-badge { margin-bottom: 14px; }
.music-card p { font-size: 0.9rem; }
.music-launch {
  margin-top: auto;
  align-self: flex-start;
  color: var(--coral-dark);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.music-source { margin: 36px 0 0; text-align: center; font-size: 0.85rem; }
.music-source a { color: var(--teal-dark); font-weight: 600; }

/* ---------- Extended developer tools ---------- */
.dev-tools-shelf {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(244,251,252,0.92), rgba(230,247,246,0.96)),
    url("../img/hero-reef2.jpg") center / cover;
}
.dev-tools-shelf::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.65;
  background:
    radial-gradient(ellipse at 12% 18%, rgba(255,111,89,0.2) 0 10%, transparent 32%),
    radial-gradient(ellipse at 88% 82%, rgba(15,163,177,0.2) 0 13%, transparent 34%);
}
.dev-tools-shelf .container { position: relative; }
.dev-tool-card { display: flex; flex-direction: column; }
.dev-tool-card .icon-badge { margin-bottom: 14px; }
.dev-tool-card p { font-size: 0.9rem; }
.dev-tool-launch {
  margin-top: auto;
  align-self: flex-start;
  color: var(--coral-dark);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dev-tools-source { margin: 36px 0 0; text-align: center; font-size: 0.85rem; }
.dev-tools-source a { color: var(--teal-dark); font-weight: 600; }

/* ---------- Extended utility tools ---------- */
.utility-tools-shelf {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(244,251,252,0.92), rgba(230,247,246,0.96)),
    url("../img/hero-turtle.jpg") center / cover;
}
.utility-tools-shelf::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.65;
  background:
    radial-gradient(ellipse at 10% 20%, rgba(255,111,89,0.2) 0 10%, transparent 32%),
    radial-gradient(ellipse at 90% 78%, rgba(15,163,177,0.2) 0 13%, transparent 34%);
}
.utility-tools-shelf .container { position: relative; }
.utility-tool-card { display: flex; flex-direction: column; }
.utility-tool-card .icon-badge { margin-bottom: 14px; }
.utility-tool-card p { font-size: 0.9rem; }
.utility-tool-launch {
  margin-top: auto;
  align-self: flex-start;
  color: var(--coral-dark);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.utility-tools-source { margin: 36px 0 0; text-align: center; font-size: 0.85rem; }
.utility-tools-source a { color: var(--teal-dark); font-weight: 600; }

/* ---------- Utility list page components ---------- */
.value-list { list-style: none; padding: 0; margin: 0; }
.value-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed #dcebee;
  font-size: 0.9rem;
}
.value-list li span:first-child { color: var(--muted); }
.value-list li span:last-child { font-weight: 700; color: var(--deep-sea); }

/* ---------- About page ---------- */
.timeline { border-left: 3px solid var(--teal-light); margin-left: 12px; padding-left: 24px; }
.timeline .item { margin-bottom: 28px; position: relative; }
.timeline .item::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(255,111,89,0.2);
}

.section-plain { background: #fff; }

/* ---------- Night mode ----------
   Dim, low-glare palette: no pure white, softened images, warmer accents. */
html[data-theme="night"] {
  color-scheme: dark;
  --coral-dark: #e88a76;
  --coral-light: #f2b8a6;
  --teal-dark: #7cc7cd;
  --teal-light: #3f8f96;
  --sand: #2b2320;
  --foam: #0b171d;
  --ink: #cdd8da;
  --muted: #8fa4a9;
  --night-surface: #12232b;
  --night-surface-2: #172c35;
  --night-border: rgba(160, 200, 205, 0.12);
  --night-heading: #e3e9e6;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
}
[data-theme="night"] h1, [data-theme="night"] h2,
[data-theme="night"] h3, [data-theme="night"] h4 { color: var(--night-heading); }
[data-theme="night"] a:hover { color: var(--coral-light); }
[data-theme="night"] img { filter: brightness(0.82) saturate(0.9); }

[data-theme="night"] .site-header,
[data-theme="night"] .site-header.scrolled { background: rgba(6, 18, 24, 0.96); }
[data-theme="night"] .brand,
[data-theme="night"] .nav a:hover,
[data-theme="night"] .nav a.active { color: var(--night-heading); }
[data-theme="night"] .nav a { color: rgba(220, 230, 228, 0.75); }
[data-theme="night"] .nav a.nav-blog { background: #b85a4a; color: #f3e6e1; box-shadow: none; }
[data-theme="night"] .nav a.nav-blog:hover { background: var(--coral-dark); color: #10181c; }

[data-theme="night"] .hero { background: linear-gradient(160deg, #06151d 0%, #0b2a31 100%); color: var(--night-heading); }
[data-theme="night"] .hero-bg-image { opacity: 0.18; filter: saturate(0.7); }
[data-theme="night"] .hero::before { opacity: 0.5; }
[data-theme="night"] .hero p.lead { color: rgba(220, 230, 228, 0.78); }
[data-theme="night"] .bubble { opacity: 0.35; }
[data-theme="night"] .wave-divider path { fill: var(--foam); }
[data-theme="night"] .btn-primary { background: linear-gradient(135deg, #d0705e, #b85a4a); color: #f7ece8; }
[data-theme="night"] .btn-primary:hover { color: #fff5f1; }
[data-theme="night"] .btn-secondary { background: var(--night-surface-2); color: var(--teal-dark); border-color: var(--night-border); }
[data-theme="night"] .btn-secondary:hover { background: #21404a; color: var(--night-heading); }
[data-theme="night"] .btn-ghost { color: var(--ink); border-color: rgba(220, 230, 228, 0.35); }

[data-theme="night"] .card,
[data-theme="night"] .tool-panel,
[data-theme="night"] .tab-btn,
[data-theme="night"] .storage-dialog {
  background: var(--night-surface);
  border-color: var(--night-border);
  color: var(--ink);
}
[data-theme="night"] .games-library .card { border-color: var(--night-border); box-shadow: var(--shadow-sm); }
[data-theme="night"] .tab-btn.active { background: #1f6a72; border-color: #1f6a72; color: var(--night-heading); }
[data-theme="night"] .icon-badge { background: linear-gradient(135deg, #2c7a82, #185a63); color: var(--night-heading); }
[data-theme="night"] .tag.teal { background: rgba(124, 199, 205, 0.12); }
[data-theme="night"] .tag.games { background: rgba(232,138,118,0.14); color: #e88a76; }
[data-theme="night"] .tag.relax { background: rgba(224,179,106,0.14); color: #e0b36a; }
[data-theme="night"] .tag.meditate { background: rgba(214,156,192,0.14); color: #d69cc0; }
[data-theme="night"] .tag.utility { background: rgba(124,199,205,0.12); color: #7cc7cd; }
[data-theme="night"] .tag.devtool { background: rgba(185,163,222,0.14); color: #b9a3de; }
[data-theme="night"] .field label,
[data-theme="night"] .value-list li span:last-child { color: var(--ink); }
[data-theme="night"] .value-list li { border-bottom-color: var(--night-border); }
[data-theme="night"] input[type="text"], [data-theme="night"] input[type="number"],
[data-theme="night"] input[type="password"], [data-theme="night"] textarea,
[data-theme="night"] select { background: #0e1d24; border-color: #24404b; color: var(--ink); }
[data-theme="night"] .storage-dialog dd { background: #0e1d24; }
[data-theme="night"] .storage-dialog-close { background: #21404a; color: var(--night-heading); }

[data-theme="night"] .section-plain,
[data-theme="night"] .home-new { background: #0e1c23; }
[data-theme="night"] .home-popular { background: linear-gradient(180deg, #0b171d, #0e1c23); }
[data-theme="night"] .home-link-section::before,
[data-theme="night"] .games-library::before,
[data-theme="night"] .music-library::before,
[data-theme="night"] .dev-tools-shelf::before,
[data-theme="night"] .utility-tools-shelf::before { opacity: 0.18; }
/* Drop the diagonal stripe pattern at night, keeping only the soft glows */
[data-theme="night"] .home-link-section::before,
[data-theme="night"] .games-library::before,
[data-theme="night"] .music-library::before {
  background:
    radial-gradient(ellipse at 8% 8%, rgba(255,111,89,0.22) 0 11%, transparent 32%),
    radial-gradient(ellipse at 95% 78%, rgba(15,163,177,0.2) 0 13%, transparent 34%);
}
[data-theme="night"] .games-library,
[data-theme="night"] .music-library {
  background:
    linear-gradient(180deg, rgba(11,23,29,0.94), rgba(10,26,30,0.97)),
    url("../img/hero-coral.jpg") center / cover;
}
[data-theme="night"] .dev-tools-shelf {
  background:
    linear-gradient(180deg, rgba(11,23,29,0.94), rgba(10,26,30,0.97)),
    url("../img/hero-reef2.jpg") center / cover;
}
[data-theme="night"] .utility-tools-shelf {
  background:
    linear-gradient(180deg, rgba(11,23,29,0.94), rgba(10,26,30,0.97)),
    url("../img/hero-turtle.jpg") center / cover;
}

[data-theme="night"] .strip { background: #0a1f28; }
[data-theme="night"] .stats .num { color: #7cc7cd; }
[data-theme="night"] .site-footer { background: #050f14; }
[data-theme="night"] .timeline { border-left-color: #2a5a60; }
[data-theme="night"] .output-box { background: #06121a; color: #bfd9dc; }
[data-theme="night"] .toast { background: #1b323b; color: var(--night-heading); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--deep-sea);
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 4px;
    transform: translateY(-130%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  .nav.open { transform: translateY(0); opacity: 1; }
  [data-theme="night"] .nav { background: #081a22; }
  .nav a { padding: 14px 18px; }
  .nav-toggle { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 100px 0 70px; }
  .footer-grid { grid-template-columns: 1fr; }
}
