/* =========================================================
   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); }

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); }

.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;
}
.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);
}

.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; }

.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); }

/* ---------- 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);
}

/* ---------- 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; }
  .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; }
}
