
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #0d0b16;
  --panel: #171326;
  --panel2: #211a35;
  --line: #33294d;
  --text: #f7f3ff;
  --muted: #aaa0bd;
  --purple: #a855f7;
  --pink: #f05bd5;
  --green: #8bff83;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 50% -20%, #39205d 0%, var(--bg) 55%);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  min-height: 100vh;
}

.app {
  max-width: 760px;
  margin: auto;
  padding: 22px 16px 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: #c69aff;
  font-weight: 800;
}

.topbar h1 {
  font-size: clamp(22px, 5vw, 30px);
  margin: 5px 0 0;
  font-weight: 900;
}

.topbar h1 span {
  font-size: 12px;
  background: #392454;
  color: #e6c9ff;
  border: 1px solid #7042a0;
  padding: 5px 8px;
  border-radius: 8px;
  vertical-align: middle;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #1b1629;
  border: 1px solid var(--line);
  padding: 8px 11px;
  border-radius: 14px;
  min-width: 0;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #392454;
  border-radius: 11px;
}

.profile-chip small,
.stat small,
.rating-card small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 800;
}

.profile-chip strong {
  font-size: 12px;
  display: block;
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  background: linear-gradient(145deg, #211a35, #171326);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.stat strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 14px;
}

.tab {
  border: 1px solid var(--line);
  background: #171326;
  color: #b9afca;
  border-radius: 11px;
  padding: 11px 5px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.tab.active {
  background: linear-gradient(135deg, #793bd0, #a344d0);
  border-color: #bb79ff;
  color: white;
  box-shadow: 0 5px 22px #8a39c744;
}

.panel {
  display: none;
  background: rgba(23, 19, 38, .94);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.panel.active {
  display: block;
}

.game-heading,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.game-heading h2,
.section-head h2 {
  font-size: 19px;
  margin: 0 0 4px;
}

.game-heading p,
.section-head p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.score-pill,
.coin-badge {
  background: #2a2040;
  border: 1px solid #4a356c;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #d6b5ff;
  white-space: nowrap;
}

.score-pill b {
  font-size: 16px;
  color: white;
  margin-left: 5px;
}

.canvas-wrap {
  position: relative;
  max-width: 400px;
  margin: auto;
  border: 1px solid #5d3c83;
  border-radius: 14px;
  overflow: hidden;
  background: #0c1119;
  box-shadow: 0 0 35px #9c42ff1c;
  touch-action: none;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #080610b9;
  padding: 18px;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  text-align: center;
  background: #1b1530ed;
  border: 1px solid #65428b;
  border-radius: 18px;
  padding: 22px 18px;
  max-width: 290px;
  width: 100%;
  box-shadow: 0 12px 40px #0008;
}

.big-emoji {
  font-size: 42px;
}

.overlay-card h2 {
  margin: 8px 0;
  font-size: 21px;
}

.overlay-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.primary,
.secondary {
  border: 0;
  border-radius: 11px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
}

.primary {
  background: linear-gradient(135deg, #a855f7, #e052c9);
  color: white;
  width: 100%;
  margin-top: 8px;
}

.controls {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 6px;
  margin: 13px auto 6px;
}

.controls > div {
  display: flex;
  gap: 7px;
}

.control {
  width: 48px;
  height: 42px;
  border: 1px solid #5b4079;
  background: #281d3d;
  color: #f4eaff;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 900;
  touch-action: manipulation;
}

.hint,
.muted {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.skin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.skin {
  background: #211a35;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
}

.skin.selected {
  border-color: #be79ff;
  box-shadow: 0 0 0 1px #be79ff55;
}

.skin-preview {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 8px;
}

.skin h3 {
  font-size: 13px;
  margin: 0 0 4px;
}

.skin p {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 10px;
}

.skin button {
  width: 100%;
  border: 1px solid #634581;
  background: #38234f;
  color: white;
  border-radius: 9px;
  padding: 9px;
  font-weight: 700;
  font-size: 11px;
}

.skin button:disabled {
  opacity: .55;
}

.quest-list {
  display: grid;
  gap: 10px;
}

.quest {
  background: #211a35;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px;
}

.quest-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
}

.quest-desc {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 9px;
}

.progress {
  height: 7px;
  background: #100d1b;
  border-radius: 99px;
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #9b4de7, #e35bd2);
  border-radius: 99px;
}

.quest-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
  font-size: 11px;
  color: #d8c6ee;
}

.claim {
  border: 0;
  background: #8b4ad1;
  color: white;
  padding: 7px 10px;
  border-radius: 8px;
  font-weight: 700;
}

.claim:disabled {
  background: #393044;
  color: #93899e;
}

.rating-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #211a35;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 17px;
}

.rank-icon {
  font-size: 32px;
}

.rating-card strong {
  font-size: 20px;
  display: block;
  margin-top: 5px;
}

.notice {
  background: #201a2d;
  border-left: 3px solid #a855f7;
  padding: 12px;
  border-radius: 8px;
  color: #bcb1ca;
  font-size: 11px;
  line-height: 1.5;
  margin-top: 14px;
}

.secondary {
  background: #2a2040;
  border: 1px solid #61427e;
  color: #e9d7ff;
  margin-top: 18px;
}

footer {
  text-align: center;
  color: #766b89;
  font-size: 10px;
  margin-top: 18px;
}

@media (max-width: 480px) {
  .app {
    padding: 16px 11px 26px;
  }

  .profile-chip {
    padding: 6px 8px;
  }

  .profile-chip strong {
    max-width: 75px;
  }

  .stats {
    gap: 7px;
  }

  .stat {
    padding: 10px;
  }

  .stat strong {
    font-size: 15px;
  }

  .tab {
    font-size: 10px;
    padding: 10px 2px;
  }

  .panel {
    padding: 12px;
  }

  .skin-grid {
    gap: 8px;
  }
}
