/* petsimevent.fun - shared styles
   Look: Pet Simulator 99's own menus - white rounded panels with a thick navy outline and a
   chunky bottom edge, gradient title bars, outlined bubble text, green / blue / red buttons,
   all sitting on a bright sky. One light theme on purpose (it is the game's look). */

:root {
  /* colour */
  --sky-top: #7fd8ff;
  --sky-bottom: #3a8dff;
  --ink: #1b2440;            /* outlines, headings */
  --text: #2b3553;           /* body text */
  --muted: #6b7697;
  --panel: #ffffff;
  --panel-soft: #f2f6ff;     /* rows, inputs */
  --line: #dbe4f7;
  --blue-1: #5fd4ff;  --blue-2: #1f86ff;
  --green-1: #8cff5c; --green-2: #22c21c;
  --red-1: #ff7a7a;   --red-2: #e3262b;
  --gold-1: #ffe066;  --gold-2: #ff9f1c;
  --purple-1: #d59bff; --purple-2: #8a3cff;
  --good: #1fa51a;
  --warn: #e08a00;
  --bad: #e3262b;

  /* rarity (the game's colours) */
  --r-basic: #9aa3b5; --r-rare: #3fb8ff; --r-epic: #b65cff; --r-legendary: #ff9f1c;
  --r-mythical: #ff3b6b; --r-huge: #ffcc00; --r-titanic: #20e3c2; --r-garg: #ff5ad1;

  /* type */
  --font-display: "Fredoka", "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;

  /* shape */
  --radius: 22px;
  --radius-sm: 14px;
  --stroke: 4px;
  --edge: 0 6px 0 var(--ink);           /* the chunky bottom edge under panels */
  --edge-sm: 0 4px 0 var(--ink);
  --wrap: 1140px;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  min-height: 100vh;
  font: 500 16px/1.55 var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse at 15% -10%, rgba(255, 255, 255, .55), transparent 45%),
    radial-gradient(ellipse at 90% 10%, rgba(255, 255, 255, .35), transparent 40%),
    linear-gradient(180deg, var(--sky-top), var(--sky-bottom) 70%) fixed;
  background-color: var(--sky-bottom);
}

/* soft cloud texture */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .18) 2px, transparent 2.5px);
  background-size: 34px 34px;
}

img { max-width: 100%; }
a { color: var(--blue-2); }
:focus-visible { outline: 4px solid var(--gold-1); outline-offset: 3px; border-radius: 10px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- outlined bubble text (the game's titles) ---------- */
.bubble {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
  paint-order: stroke fill;
  -webkit-text-stroke: 6px var(--ink);
  text-shadow: 0 4px 0 var(--ink);
}

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; }

/* ---------- header + tabs ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  padding-block: 12px;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(58, 141, 255, .92), rgba(58, 141, 255, .75));
  backdrop-filter: blur(8px);
  border-bottom: var(--stroke) solid var(--ink);
  z-index: -1;
}
.header-row { display: flex; align-items: center; gap: 18px; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo img { width: 42px; height: 42px; }
.logo span { font-size: 1.6rem; }

.tabs {
  display: flex;
  gap: 10px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 4px 10px;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 18px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(180deg, #7cc6ff, #3c8fff);
  box-shadow: var(--edge-sm);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tab:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.tab:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tab[aria-current="page"] { background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); }

/* ---------- panels ---------- */
main { padding-block: 26px 60px; display: grid; gap: 26px; }

.panel {
  background: var(--panel);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--edge);
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: var(--stroke) solid var(--ink);
  border-radius: calc(var(--radius) - 4px) calc(var(--radius) - 4px) 0 0;
  background: linear-gradient(180deg, var(--blue-1), var(--blue-2));
}
.panel-head h2, .panel-head h3 { color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
.panel-head.gold { background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); }
.panel-head.green { background: linear-gradient(180deg, var(--green-1), var(--green-2)); }
.panel-head.purple { background: linear-gradient(180deg, var(--purple-1), var(--purple-2)); }
.panel-head.red { background: linear-gradient(180deg, var(--red-1), var(--red-2)); }
.panel-body { padding: 20px; display: grid; gap: 16px; }
.panel-note { font-size: .9rem; color: var(--muted); }

/* ---------- buttons, chips, inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 700 1rem var(--font-display);
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--green-1), var(--green-2));
  box-shadow: var(--edge-sm);
  cursor: pointer;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.blue { background: linear-gradient(180deg, var(--blue-1), var(--blue-2)); }
.btn.gold { background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); }
.btn.red { background: linear-gradient(180deg, var(--red-1), var(--red-2)); }
.btn.small { padding: 6px 14px; font-size: .92rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 700 .82rem var(--font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 3px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--panel-soft);
  white-space: nowrap;
  justify-self: start;
  width: max-content;
}
.chip.good { background: #d9ffcf; color: #136b10; }
.chip.bad { background: #ffd9d9; color: #9b1116; }
.chip.warn { background: #fff0c7; color: #8a5400; }
.chip.live::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(31, 165, 26, .25);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(31, 165, 26, 0); } }

.field { display: grid; gap: 6px; min-width: 0; }
.field label { font: 700 .82rem var(--font-display); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.input, .select {
  width: 100%;
  font: 600 1rem var(--font-body);
  color: var(--ink);
  padding: 11px 14px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  box-shadow: inset 0 3px 0 rgba(27, 36, 64, .08);
}
.input::placeholder { color: #98a2c0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.toolbar .field { flex: 1 1 200px; }

.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented button {
  font: 700 .95rem var(--font-display);
  color: var(--ink);
  padding: 7px 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--panel-soft);
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.segmented button[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(180deg, var(--blue-1), var(--blue-2));
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
}

/* ---------- grids ---------- */
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.split { display: grid; gap: 26px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- stat tiles (stock) ---------- */
.stock-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  box-shadow: var(--edge-sm);
}
.stock-top { display: flex; align-items: center; gap: 12px; }
.pet-icon {
  width: 64px; height: 64px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fff, #dfe8fb);
  border: 3px solid var(--ink);
}
.pet-icon.ring-titanic { box-shadow: 0 0 0 4px var(--r-titanic); }
.pet-icon.ring-garg { box-shadow: 0 0 0 4px var(--r-garg); }
.pet-icon.ring-huge { box-shadow: 0 0 0 4px var(--r-huge); }
.stock-name { font: 700 1.2rem var(--font-display); color: var(--ink); }
.stock-sub { font-size: .9rem; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.stat b { display: block; font: 700 clamp(.95rem, 1.6vw, 1.15rem) var(--font-display); white-space: nowrap; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.meter {
  height: 16px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(180deg, var(--green-1), var(--green-2));
  border-right: 3px solid var(--ink);
  transition: width .9s cubic-bezier(.2, .8, .2, 1);
}
.meter.gold > i { background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); }
.meter.red > i { background: linear-gradient(180deg, var(--red-1), var(--red-2)); }
.meter-row { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 3px solid var(--ink); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; text-align: left; white-space: nowrap; }
th {
  font: 700 .8rem var(--font-display);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-soft);
  border-bottom: 3px solid var(--ink);
}
tbody tr:nth-child(even) td { background: #f8faff; }
tbody tr:hover td { background: #eaf3ff; }
td.num, th.num { text-align: right; }
td:first-child { white-space: normal; min-width: 190px; }
.name-cell { display: flex; align-items: center; gap: 10px; }
.name-cell img { width: 36px; height: 36px; flex-shrink: 0; object-fit: contain; }
@media (max-width: 640px) {
  th, td { padding: 9px 10px; }
  td:first-child { min-width: 150px; }
}
tr.chase td { background: #fff7d6 !important; font-weight: 700; }
tr.chase.titanic td { background: #dcfff8 !important; }
tr.chase.garg td { background: #ffe3f6 !important; }

/* ---------- egg cards ---------- */
.egg-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 12px 14px;
  text-align: center;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff, var(--panel-soft));
  box-shadow: var(--edge-sm);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.egg-card:hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--ink); }
.egg-card img { width: 86px; height: 86px; object-fit: contain; filter: drop-shadow(0 4px 0 rgba(27, 36, 64, .25)); }
.egg-card .egg-name { font: 700 1rem var(--font-display); color: var(--ink); line-height: 1.2; }
.egg-card .egg-best { font-size: .82rem; color: var(--muted); }
.egg-card .egg-best b { color: var(--ink); }

/* ---------- modal ---------- */
.modal {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}
.modal::backdrop { background: rgba(14, 22, 48, .55); backdrop-filter: blur(3px); }
.modal .panel { max-height: calc(100vh - 60px); display: flex; flex-direction: column; }
.modal .panel-body { overflow-y: auto; }
.modal-close { border: 3px solid var(--ink); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  padding: 26px;
}
@media (max-width: 860px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.hero p.lead { font-size: 1.08rem; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.countdown { display: flex; gap: 10px; flex-wrap: wrap; }
.countdown div {
  min-width: 74px;
  text-align: center;
  padding: 8px 10px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff, var(--panel-soft));
  box-shadow: var(--edge-sm);
}
.countdown b { display: block; font: 700 1.8rem var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.countdown span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.feature-card { display: grid; gap: 10px; padding: 18px; text-decoration: none; color: inherit; }
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--ink); }
.feature-card { transition: transform .12s ease, box-shadow .12s ease; }
.feature-card .icon-bubble {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  box-shadow: var(--edge-sm);
}
.feature-card .icon-bubble svg { width: 28px; height: 28px; }

.pet-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.pet-tile {
  display: grid; justify-items: center; gap: 6px; padding: 12px 8px; text-align: center;
  border: 3px solid var(--ink); border-radius: var(--radius-sm); background: var(--panel-soft); box-shadow: var(--edge-sm);
}
.pet-tile img { width: 72px; height: 72px; object-fit: contain; }
.pet-tile b { font: 700 .9rem var(--font-display); color: var(--ink); line-height: 1.2; }
.pet-tile span { font-size: .78rem; color: var(--muted); }

/* ---------- lists ---------- */
.tips { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.tips li {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-soft);
}
.tips li .dot {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 1rem var(--font-display); color: #fff;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, var(--blue-1), var(--blue-2));
}
.tips li.no .dot { background: linear-gradient(180deg, var(--red-1), var(--red-2)); }
.tips li.yes .dot { background: linear-gradient(180deg, var(--green-1), var(--green-2)); }
.tips b { color: var(--ink); }

/* ---------- code ---------- */
.code {
  display: flex; align-items: stretch; gap: 0;
  border: 3px solid var(--ink); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--edge-sm);
}
.code code {
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap;
  padding: 14px 16px; background: #141b33; color: #c9f3ff;
  font: 600 .92rem/1.5 ui-monospace, "Cascadia Code", Consolas, monospace;
}
.code button { border: none; border-left: 3px solid var(--ink); border-radius: 0; box-shadow: none; }
.code button:hover, .code button:active { transform: none; box-shadow: none; }

/* ---------- states ---------- */
.empty, .loading, .error {
  padding: 26px; text-align: center; color: var(--muted);
  border: 3px dashed var(--line); border-radius: var(--radius-sm);
}
.error { color: var(--bad); border-color: #ffc2c2; }
.loading::before {
  content: ""; display: block; width: 34px; height: 34px; margin: 0 auto 10px;
  border: 5px solid var(--line); border-top-color: var(--blue-2); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; font-family: var(--font-display); color: var(--ink); }

/* ---------- footer ---------- */
.site-footer { padding-block: 26px 40px; color: #eaf4ff; font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { color: #fff; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .header-row { flex-wrap: wrap; gap: 8px; }
  .tabs { margin-left: 0; width: 100%; }
  .logo span { font-size: 1.35rem; }
  .panel-body { padding: 16px; }
  .hero { padding: 18px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .countdown div { min-width: 62px; }
}
