/* PanGUYa: bright, round, PangYa colours (sky, fairway, sun, pink). */
:root {
  --sky-top: #5ec8ff;
  --sky-bottom: #c9f0ff;
  --grass: #5fd16b;
  --grass-dark: #2f9e45;
  --navy: #1d3f8f;
  --ink: #213052;
  --muted: #5a6b8c;
  --card: #ffffff;
  --card-edge: #bfe6ff;
  --sun: #ffd23f;
  --orange: #ff8a1f;
  --pink: #ff5fb8;
  --online: #22c55e;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(29, 63, 143, 0.18), 0 14px 30px rgba(29, 63, 143, 0.12);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: 'Fredoka', 'Baloo 2', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 55%, #e9fbe6 80%, var(--grass) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.cloud {
  position: absolute; background: #fff; border-radius: 999px; opacity: 0.85;
  animation: drift 60s linear infinite;
}
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.c1 { width: 160px; height: 46px; top: 12%; left: -200px; }
.c1::before { width: 70px; height: 70px; top: -34px; left: 26px; }
.c1::after { width: 54px; height: 54px; top: -22px; left: 82px; }
.c2 { width: 220px; height: 56px; top: 30%; left: -260px; animation-duration: 85s; animation-delay: -30s; }
.c2::before { width: 90px; height: 90px; top: -46px; left: 40px; }
.c2::after { width: 70px; height: 70px; top: -30px; left: 116px; }
.c3 { width: 130px; height: 38px; top: 52%; left: -160px; animation-duration: 70s; animation-delay: -50s; }
.c3::before { width: 56px; height: 56px; top: -28px; left: 20px; }
.c3::after { width: 44px; height: 44px; top: -16px; left: 66px; }
@keyframes drift { to { transform: translateX(calc(100vw + 300px)); } }
@media (prefers-reduced-motion: reduce) { .cloud { animation: none; } }

header.top, main, footer { position: relative; z-index: 1; }

header.top {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 14px 16px 6px;
}
.brand img { height: 64px; display: block; filter: drop-shadow(0 4px 0 rgba(29, 63, 143, 0.25)); }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
nav a {
  text-decoration: none; color: var(--navy); font-weight: 600; font-size: 18px;
  padding: 8px 18px; border-radius: 999px; background: rgba(255, 255, 255, 0.75);
  border: 3px solid #fff; box-shadow: 0 3px 0 rgba(29, 63, 143, 0.2);
  transition: transform 0.12s;
}
nav a:hover { transform: translateY(-2px); }
nav a.active { background: var(--sun); border-color: #fff3b0; }
.status {
  margin-left: auto; font-weight: 600; color: var(--navy);
  background: rgba(255, 255, 255, 0.8); padding: 6px 14px; border-radius: 999px;
}
.status .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--online);
  margin-right: 6px; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

main { max-width: 1180px; margin: 0 auto; padding: 8px 16px 40px; }

.card {
  background: var(--card); border-radius: var(--radius); border: 4px solid var(--card-edge);
  box-shadow: var(--shadow); padding: 18px 20px;
}

h1, h2, h3 { margin: 0 0 8px; color: var(--navy); }
.guy { color: var(--pink); }
.muted { color: var(--muted); }

.ribbon {
  display: inline-block; margin: 26px 0 14px; padding: 6px 26px; font-size: 26px; color: #fff;
  background: linear-gradient(180deg, #4aa8ff, var(--navy)); border-radius: 999px;
  border: 4px solid #fff; box-shadow: var(--shadow); letter-spacing: 0.5px;
}

.hero { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(135deg, #fff 0%, #fff 60%, #fff6c9 100%); }
.hero h1 { font-size: 34px; }
.hero p { margin: 0; font-size: 18px; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-bubble {
  text-align: center; min-width: 110px; padding: 10px 14px; border-radius: 18px;
  background: linear-gradient(180deg, #eaf7ff, #cdeaff); border: 3px solid #fff;
}
.stat-bubble b { display: block; font-size: 28px; color: var(--navy); }

.news { display: grid; gap: 14px; }
.news article h3 { font-size: 22px; }
.news article .date { font-size: 14px; color: var(--muted); }
.news article p { white-space: pre-wrap; margin: 8px 0 0; line-height: 1.45; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
input, select {
  font: inherit; padding: 8px 14px; border-radius: 999px; border: 3px solid var(--card-edge);
  background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 3px solid var(--sun); outline-offset: 1px; }
.toolbar input { flex: 1; min-width: 180px; }

.players-layout { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .players-layout { grid-template-columns: 1fr; } }

.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 72vh; overflow: auto; }
.roster li button {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: inherit;
  background: #fff; border: 3px solid var(--card-edge); border-radius: 18px; padding: 8px 12px; cursor: pointer;
  box-shadow: 0 3px 0 rgba(29, 63, 143, 0.12);
}
.roster li button:hover, .roster li button[aria-current="true"] { border-color: var(--sun); background: #fffbe6; }
.roster img, .roster .noicon { width: 40px; height: 40px; border-radius: 12px; background: #e6f4ff; flex: none; }
.roster .who { flex: 1; min-width: 0; }
.roster .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster .who span { font-size: 14px; color: var(--muted); }
.roster .on { width: 12px; height: 12px; border-radius: 50%; background: var(--online); flex: none; }

.player-card.empty { display: grid; place-items: center; min-height: 300px; color: var(--muted); }
.player-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.player-head h3 { font-size: 30px; }
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px; font-weight: 600; font-size: 14px;
  background: var(--sun); color: var(--navy);
}
.badge.online { background: var(--online); color: #fff; }
.player-body { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 18px; margin-top: 10px; }
@media (max-width: 980px) { .player-body { grid-template-columns: 1fr; } }
.stage {
  position: relative; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #ffffff 0%, #d6f0ff 45%, #8fd3ff 100%);
  border: 3px solid #fff; box-shadow: inset 0 -40px 0 rgba(95, 209, 107, 0.55);
}
.stage canvas { width: 100% !important; height: 100% !important; display: block; }
.stage .portrait { position: absolute; inset: 0; margin: auto; width: 60%; image-rendering: auto; }
.stage .loading { position: absolute; inset: auto 0 12px; text-align: center; color: var(--navy); font-weight: 600; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
table.modes { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
table.modes th, table.modes td { padding: 6px 8px; text-align: right; border-bottom: 2px solid #eef6ff; }
table.modes th:first-child, table.modes td:first-child { text-align: left; }
.gear { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gear li { display: flex; gap: 8px; align-items: center; background: #f4fbff; border-radius: 14px; padding: 6px 8px; }
.gear img, .gear .noicon { width: 36px; height: 36px; border-radius: 10px; background: #e0f1ff; flex: none; }
.gear small { display: block; color: var(--muted); font-size: 12px; }

.btn {
  font: inherit; font-weight: 700; color: #fff; cursor: pointer; border: 4px solid #fff;
  background: linear-gradient(180deg, #ffb347, var(--orange)); border-radius: 999px; padding: 10px 26px;
  box-shadow: 0 5px 0 #c4570a; transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #c4570a; }
.btn:disabled { filter: grayscale(0.7); cursor: default; opacity: 0.7; }
.btn.big { font-size: 24px; padding: 12px 44px; }
.btn.small { font-size: 14px; padding: 4px 14px; box-shadow: 0 3px 0 #c4570a; }
.btn.ghost { background: #eaf6ff; color: var(--navy); box-shadow: 0 3px 0 #9cc3e6; }

.login { max-width: 420px; }
.login form { display: grid; gap: 10px; }
.login label { display: grid; gap: 4px; font-weight: 600; }
.error { color: #d6247f; min-height: 1.2em; margin: 0; }

.me { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.wallet { margin-left: auto; font-size: 20px; }
.cookie-ico {
  display: inline-block; width: 22px; height: 22px; border-radius: 50%; vertical-align: -4px; margin-right: 6px;
  background: radial-gradient(circle at 30% 30%, #ffe1a3, #e0a54b 60%, #b77a2a);
  box-shadow: inset 3px 3px 0 rgba(90, 50, 10, 0.35);
}
.earn-grid { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .earn-grid { grid-template-columns: 1fr; } }
.wheel-card { text-align: center; }
.wheel-wrap { position: relative; width: min(320px, 100%); margin: 8px auto 14px; }
.wheel-wrap canvas { width: 100%; height: auto; display: block; }
.pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent;
  border-top: 30px solid var(--pink); filter: drop-shadow(0 3px 0 var(--navy));
}
.result { font-size: 22px; font-weight: 700; color: var(--pink); min-height: 1.4em; margin: 10px 0 0; }
.milestones { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.milestones li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  background: #f4fbff; border-radius: 14px; padding: 8px 12px; }
.milestones .bar { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: #dbeeff; overflow: hidden; }
.milestones .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--grass), var(--sun)); }
.milestones .done { color: var(--grass-dark); font-weight: 700; }

footer { text-align: center; color: var(--navy); padding: 20px 16px 30px; font-size: 14px; }
