:root {
  --sky: #6ed2ff;
  --sun: #ffd166;
  --foam: #f7f4eb;
  --mint: #1bbf9b;
  --teal: #0a8ea0;
  --coral: #ff6f61;
  --navy: #10364d;
  --panel: rgba(247, 244, 235, 0.88);
  --shadow: rgba(16, 54, 77, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--navy);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.8), transparent 26%),
    linear-gradient(140deg, #7ad8ff 0%, #38b6c5 55%, #0f7288 100%);
}

body.modal-open {
  overflow: hidden;
}

.background-orb {
  position: fixed;
  border-radius: 50%;
  opacity: 0.32;
  filter: blur(2px);
  pointer-events: none;
}

.orb-a {
  top: -80px;
  right: -40px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #fff1b2 0%, rgba(255, 241, 178, 0) 72%);
}

.orb-b {
  bottom: -180px;
  left: -40px;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(255, 111, 97, 0.42) 0%, rgba(255, 111, 97, 0) 70%);
}

.title-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.28), transparent 24%),
    radial-gradient(circle at bottom right, rgba(255, 111, 97, 0.24), transparent 26%),
    linear-gradient(145deg, rgba(8, 70, 94, 0.74), rgba(16, 54, 77, 0.82));
  backdrop-filter: blur(10px);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.title-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.title-panel {
  position: relative;
  width: min(760px, 100%);
  padding: 36px 34px 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 32px;
  overflow: hidden;
  color: var(--foam);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    linear-gradient(150deg, rgba(16, 54, 77, 0.92), rgba(10, 142, 160, 0.76));
  box-shadow: 0 28px 70px rgba(6, 31, 43, 0.42);
}

.title-panel::before,
.title-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.title-panel::before {
  top: -80px;
  right: -36px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.48), rgba(255, 209, 102, 0));
}

.title-panel::after {
  bottom: -120px;
  left: -54px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 111, 97, 0.32), rgba(255, 111, 97, 0));
}

.title-kicker,
.title-logo,
.title-summary,
.title-actions,
.title-pills,
.title-hint {
  position: relative;
  z-index: 1;
}

.title-kicker {
  color: rgba(247, 244, 235, 0.82);
}

.title-logo {
  font-size: clamp(3.2rem, 10vw, 6.6rem);
  line-height: 0.9;
  text-transform: uppercase;
}

.title-summary {
  max-width: 580px;
  margin: 18px 0 0;
  font-size: 1.08rem;
  line-height: 1.6;
  color: rgba(247, 244, 235, 0.92);
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.title-actions .ghost-button {
  background: rgba(247, 244, 235, 0.9);
}

.title-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.title-pills span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.title-hint {
  margin: 22px 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(255, 209, 102, 0.94);
}

.page-shell {
  position: relative;
  max-width: 1380px;
  margin: 0 auto;
  padding: 34px 22px 40px;
}

.page-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  padding: 10px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.8), transparent 26%),
    linear-gradient(140deg, #7ad8ff 0%, #38b6c5 55%, #0f7288 100%);
}

.page-shell:fullscreen .hero,
.page-shell:fullscreen .info-column {
  display: none;
}

.page-shell:fullscreen .game-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.page-shell:fullscreen .game-panel {
  min-height: calc(100vh - 20px);
  border-radius: 32px;
}

.page-shell:fullscreen .panel-topline {
  display: none;
}

.page-shell:fullscreen .build-toolbar {
  padding: 10px 12px 0;
}

.page-shell:fullscreen .canvas-shell {
  min-height: calc(100vh - 20px);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-shell:fullscreen canvas {
  width: auto;
  max-width: 100%;
  height: calc(100vh - 40px);
  max-height: calc(100vh - 40px);
}

.page-shell:fullscreen .overlay {
  inset: 10px;
}

.page-shell:fullscreen .canvas-float-actions {
  top: 20px;
  right: 20px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(16, 54, 77, 0.78);
}

h1,
h2 {
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  letter-spacing: 0.03em;
}

h1 {
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.summary {
  margin: 14px 0 0;
  max-width: 640px;
  font-size: 1.08rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

.primary-button {
  color: #fff;
  background: linear-gradient(140deg, var(--coral), #ff9e4f);
  box-shadow: 0 14px 24px rgba(255, 111, 97, 0.28);
}

.ghost-button {
  color: var(--navy);
  background: rgba(247, 244, 235, 0.82);
  box-shadow: 0 12px 24px rgba(16, 54, 77, 0.12);
}

.ghost-button.accent {
  color: #fff;
  background: linear-gradient(140deg, var(--teal), var(--mint));
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 20px;
  align-items: start;
}

body.build-focus .page-shell {
  max-width: none;
  padding: 14px;
}

body.build-focus .hero,
body.build-focus .info-column {
  display: none;
}

body.build-focus .game-layout {
  grid-template-columns: minmax(0, 1fr);
}

body.build-focus .game-panel {
  border-radius: 30px;
}

body.build-focus .panel-topline {
  gap: 10px;
  padding: 12px 14px;
}

body.build-focus .metric-card {
  padding: 12px 14px;
}

body.build-focus .canvas-shell {
  padding: 10px;
}

body.build-focus canvas {
  height: min(82vh, 1100px);
  width: 100%;
  object-fit: fill;
}

body.build-focus .canvas-float-actions {
  top: 22px;
  right: 22px;
}

body.build-focus .build-toolbar {
  padding: 10px 14px 0;
}

.game-panel,
.info-card {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 40px var(--shadow);
}

.game-panel {
  border-radius: 28px;
  overflow: hidden;
}

.panel-topline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.18)),
    linear-gradient(90deg, rgba(27, 191, 155, 0.12), rgba(255, 209, 102, 0.2));
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.metric-label {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(16, 54, 77, 0.72);
}

.metric-card strong {
  font-size: clamp(1rem, 2vw, 1.3rem);
}

.canvas-shell {
  position: relative;
  padding: 18px;
}

.canvas-float-actions {
  position: absolute;
  top: 34px;
  right: 34px;
  z-index: 6;
  display: flex;
  gap: 10px;
  align-items: center;
}

.canvas-float-button {
  width: auto;
  padding: 12px 18px;
  background: rgba(247, 244, 235, 0.94);
  box-shadow: 0 14px 28px rgba(16, 54, 77, 0.18);
}

.build-toolbar {
  display: grid;
  gap: 10px;
  padding: 14px 20px 0;
}

.build-toolbar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: rgba(16, 54, 77, 0.86);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.build-toolbar-meta {
  display: grid;
  gap: 4px;
}

.build-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.build-toolbar-head strong {
  font-size: 0.78rem;
  color: var(--coral);
}

.build-toolbar-head .mini-button {
  width: auto;
  white-space: nowrap;
}

.build-quick-palette {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.build-chip {
  padding: 10px 9px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  font-size: 0.82rem;
}

.build-chip.active {
  color: #fff;
  background: linear-gradient(140deg, var(--teal), var(--mint));
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
  background: linear-gradient(180deg, #87e0ff 0%, #caf0ff 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.overlay {
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: 24px;
  background: rgba(16, 54, 77, 0.18);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-card {
  max-width: 440px;
  padding: 26px 28px;
  text-align: center;
  border-radius: 24px;
  background: rgba(247, 244, 235, 0.94);
  box-shadow: 0 20px 40px rgba(16, 54, 77, 0.2);
}

.overlay-kicker {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: rgba(16, 54, 77, 0.72);
}

.overlay-card h2 {
  margin-bottom: 14px;
  font-size: 2rem;
}

.overlay-card p {
  margin: 0;
  line-height: 1.6;
}

.overlay-results {
  display: grid;
  gap: 4px;
  margin: 16px 0 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  text-align: left;
}

.overlay-result {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.9rem;
  background: rgba(16, 54, 77, 0.06);
}

.overlay-result.is-self {
  background: rgba(27, 191, 155, 0.18);
  font-weight: 700;
}

.overlay-result-rank {
  font-weight: 700;
  color: var(--teal);
}

.overlay-result-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overlay-result-time {
  font-variant-numeric: tabular-nums;
  color: rgba(16, 54, 77, 0.72);
}

.overlay-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.overlay-hint {
  margin-top: 14px !important;
  color: var(--teal);
  font-weight: 700;
}

.info-column {
  display: grid;
  gap: 14px;
}

.info-card {
  border-radius: 24px;
  padding: 20px;
}

.info-card.small {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.66)),
    var(--panel);
}

.info-card h2 {
  margin-bottom: 14px;
  font-size: 1.55rem;
}

.info-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.info-card li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.64);
  font-size: 0.95rem;
}

.info-card li span {
  color: rgba(16, 54, 77, 0.72);
}

.info-card p {
  margin: 0;
  line-height: 1.6;
}

.course-name {
  margin-bottom: 8px !important;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.course-summary {
  margin-bottom: 14px !important;
  color: rgba(16, 54, 77, 0.78);
}

.map-lab {
  display: grid;
  gap: 12px;
}

.field-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(16, 54, 77, 0.7);
}

.text-field,
.json-field {
  width: 100%;
  border: 1px solid rgba(16, 54, 77, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--navy);
  font: inherit;
}

.text-field {
  padding: 12px 14px;
}

.json-field {
  min-height: 180px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.45;
}

.tool-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.wallet-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.wallet-pill {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.wallet-pill span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(16, 54, 77, 0.6);
}

.wallet-pill strong {
  font-size: 1.24rem;
}

.wallet-pill.trophy {
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.26), rgba(255, 255, 255, 0.74));
}

.profile-preview {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.profile-preview-copy {
  display: grid;
  gap: 4px;
}

.launcher-hub {
  display: grid;
  grid-column: 1 / -1;
  gap: 16px;
}

.launcher-hub-head {
  display: grid;
  gap: 6px;
}

.launcher-hub-head .eyebrow {
  margin: 0;
}

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.panel-icon-button {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 188px;
  padding: 20px 16px 18px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.76)),
    linear-gradient(180deg, rgba(255, 209, 102, 0.16), rgba(76, 201, 240, 0.08));
  box-shadow: 0 18px 30px rgba(16, 54, 77, 0.12);
  color: var(--navy);
  text-align: center;
}

.panel-icon-button strong {
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.panel-launcher-copy {
  font-size: 0.84rem;
  color: rgba(16, 54, 77, 0.72);
}

.panel-icon-frame {
  --icon-a: rgba(255, 143, 171, 0.24);
  --icon-b: rgba(255, 209, 102, 0.4);
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.5) 44%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(155deg, var(--icon-a), var(--icon-b));
  box-shadow: inset 0 0 0 1px rgba(16, 54, 77, 0.06);
}

.panel-icon {
  width: 76px;
  height: 76px;
  filter: drop-shadow(0 12px 18px rgba(16, 54, 77, 0.15));
}

.theme-chat .panel-icon-frame {
  --icon-a: rgba(76, 201, 240, 0.26);
  --icon-b: rgba(27, 191, 155, 0.34);
}

.theme-course .panel-icon-frame {
  --icon-a: rgba(76, 201, 240, 0.24);
  --icon-b: rgba(255, 209, 102, 0.34);
}

.theme-goal .panel-icon-frame {
  --icon-a: rgba(255, 111, 97, 0.24);
  --icon-b: rgba(255, 209, 102, 0.36);
}

.theme-profile .panel-icon-frame {
  --icon-a: rgba(255, 143, 171, 0.24);
  --icon-b: rgba(123, 97, 255, 0.28);
}

.theme-shop .panel-icon-frame {
  --icon-a: rgba(255, 143, 171, 0.24);
  --icon-b: rgba(255, 209, 102, 0.4);
}

.theme-mode .panel-icon-frame {
  --icon-a: rgba(255, 111, 97, 0.24);
  --icon-b: rgba(27, 191, 155, 0.3);
}

.theme-controls .panel-icon-frame {
  --icon-a: rgba(76, 201, 240, 0.24);
  --icon-b: rgba(255, 143, 171, 0.28);
}

.theme-map .panel-icon-frame {
  --icon-a: rgba(255, 209, 102, 0.26);
  --icon-b: rgba(76, 201, 240, 0.28);
}

.panel-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 209, 102, 0.22), transparent 28%),
    linear-gradient(180deg, rgba(16, 54, 77, 0.36), rgba(16, 54, 77, 0.52));
  backdrop-filter: blur(10px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.panel-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.panel-modal-panel {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
}

.panel-modal-panel.wide-panel {
  width: min(1080px, calc(100vw - 32px));
}

.panel-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.panel-modal-copy {
  display: grid;
  gap: 6px;
}

.panel-modal-copy .eyebrow {
  margin: 0;
}

.panel-close-button {
  width: auto;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.88);
}

.panel-modal-panel.chat-card .chat-log {
  max-height: 420px;
}

.skin-preview {
  width: 68px;
  height: 82px;
  border-radius: 34px 34px 28px 28px;
  border: 4px solid var(--mint);
  background: linear-gradient(145deg, var(--navy), var(--teal));
  box-shadow: inset 0 -12px 0 rgba(255, 255, 255, 0.16);
}

.nickname-preview {
  font-size: 1.08rem;
  line-height: 1.1;
}

.mini-button {
  padding: 11px 12px;
  font-size: 0.88rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.mini-button.accent {
  color: #fff;
  background: linear-gradient(140deg, var(--teal), var(--mint));
}

.mini-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.editor-hint {
  font-size: 0.94rem;
  color: rgba(16, 54, 77, 0.82);
}

.online-room-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(16, 54, 77, 0.08);
}

.online-room-row,
.online-room-actions {
  align-items: stretch;
}

.online-room-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.online-room-panel .editor-hint {
  margin: 0;
}

.shop-card {
  display: grid;
  gap: 16px;
}

.shop-section {
  display: grid;
  gap: 12px;
}

.shop-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
}

.shop-section-head strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.shop-section:first-of-type .shop-section-head strong::before,
.shop-section:nth-of-type(2) .shop-section-head strong::before,
.shop-section:nth-of-type(3) .shop-section-head strong::before {
  content: "";
  flex: 0 0 auto;
  box-shadow: 0 8px 16px rgba(16, 54, 77, 0.12);
}

.shop-section:first-of-type .shop-section-head strong::before {
  width: 16px;
  height: 18px;
  border-radius: 7px 7px 5px 5px;
  background: linear-gradient(145deg, var(--coral), var(--mint));
}

.shop-section:nth-of-type(2) .shop-section-head strong::before {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(145deg, #577590, #7b61ff);
}

.shop-section:nth-of-type(3) .shop-section-head strong::before {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  transform: rotate(45deg);
  background: linear-gradient(145deg, #ff8fab, #ffd166);
}

.shop-section-head span {
  color: rgba(16, 54, 77, 0.68);
  font-weight: 700;
}

.shop-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 10px;
}

.shop-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 146px;
  padding: 18px 12px 14px;
  border-radius: 24px;
  border: 1px solid rgba(16, 54, 77, 0.08);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.7)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.58));
  box-shadow: 0 16px 26px rgba(16, 54, 77, 0.1);
  color: var(--navy);
  text-align: center;
  overflow: hidden;
}

.shop-item::after {
  content: "";
  position: absolute;
  inset: auto 14px 10px;
  height: 36px;
  border-radius: 999px;
  background: rgba(16, 54, 77, 0.04);
  filter: blur(10px);
  opacity: 0.65;
}

.shop-item:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 20px 28px rgba(16, 54, 77, 0.14);
}

.shop-item:active:not(:disabled) {
  transform: translateY(-1px);
}

.shop-item strong,
.shop-item .shop-state,
.shop-swatch {
  position: relative;
  z-index: 1;
}

.shop-item strong {
  display: block;
  max-width: 100%;
  font-size: 0.86rem;
  line-height: 1.12;
  word-break: keep-all;
}

.shop-item.owned {
  border-color: rgba(27, 191, 155, 0.3);
}

.shop-item.affordable {
  border-color: rgba(255, 111, 97, 0.24);
  box-shadow: 0 18px 30px rgba(255, 111, 97, 0.12);
}

.shop-item.equipped {
  border-color: rgba(76, 201, 240, 0.3);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.95), rgba(222, 251, 246, 0.84)),
    linear-gradient(180deg, rgba(242, 253, 255, 0.92), rgba(214, 248, 236, 0.88));
  box-shadow: 0 20px 32px rgba(76, 201, 240, 0.18);
}

.shop-item.color {
  min-height: 136px;
}

.shop-item:disabled {
  opacity: 0.66;
  cursor: default;
  transform: none;
}

.shop-item.equipped:disabled {
  opacity: 1;
}

.shop-swatch {
  width: 58px;
  height: 66px;
  border-radius: 26px 26px 18px 18px;
  border: 4px solid rgba(16, 54, 77, 0.14);
  background: linear-gradient(145deg, var(--navy), var(--teal));
  box-shadow:
    inset 0 10px 16px rgba(255, 255, 255, 0.24),
    0 12px 18px rgba(16, 54, 77, 0.14);
}

.shop-swatch.color {
  width: 54px;
  height: 54px;
  border-radius: 999px;
}

.shop-swatch.badge {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 6px rgba(16, 54, 77, 0.28);
}

.shop-state {
  position: absolute;
  top: 10px;
  right: 10px;
  max-width: calc(100% - 20px);
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(16, 54, 77, 0.09);
  color: rgba(16, 54, 77, 0.82);
  font-size: 0.69rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-item.equipped .shop-state {
  background: linear-gradient(140deg, var(--teal), var(--mint));
  color: #fff;
}

.shop-item.owned:not(.equipped) .shop-state {
  background: rgba(27, 191, 155, 0.14);
  color: #0f6c56;
}

.tool-palette {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tool-chip {
  padding: 11px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
}

.tool-chip.active {
  color: #fff;
  background: linear-gradient(140deg, var(--coral), #ff9e4f);
}

.mode-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.leaderboard-list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.leaderboard-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(16, 54, 77, 0.08);
  background: transparent;
  border-radius: 0;
}

.leaderboard-list li:last-child {
  border-bottom: none;
}

.leaderboard-list span {
  color: rgba(16, 54, 77, 0.72);
}

.chat-card {
  display: grid;
  gap: 12px;
}

.chat-log {
  min-height: 220px;
  max-height: 300px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.chat-message {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.chat-message.self {
  background: rgba(27, 191, 155, 0.16);
}

.chat-message.system {
  background: rgba(16, 54, 77, 0.1);
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(16, 54, 77, 0.66);
}

.chat-text {
  line-height: 1.45;
  word-break: break-word;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

@media (max-width: 980px) {
  .panel-topline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .build-quick-palette {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tool-row {
    grid-template-columns: 1fr;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .profile-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .info-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 20px 14px 28px;
  }

  .title-panel {
    padding: 28px 22px 24px;
  }

  .title-actions {
    flex-direction: column;
  }

  .hero {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-topline,
  .info-column {
    grid-template-columns: 1fr;
  }

  .canvas-shell {
    padding: 10px;
  }

  .canvas-float-actions {
    top: 20px;
    right: 20px;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .canvas-float-button {
    width: auto;
    padding: 10px 14px;
  }

  .build-toolbar {
    padding: 10px 10px 0;
  }

  .build-toolbar-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .build-toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .overlay {
    inset: 10px;
  }

  .panel-modal {
    padding: 12px;
  }

  .panel-modal-panel {
    width: min(100vw - 12px, 100%);
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .panel-modal-head {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    width: 100%;
  }
}
