/* Copyright 2013 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file. */

html, body {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  --sky: linear-gradient(180deg, #eef7ff 0%, #f8fbff 54%, #ffffff 100%);
  --ink: #243243;
  --label-bg: rgba(255, 255, 255, .62);
  color: var(--ink);
  background: #eef7ff;
  font-family: 'Open Sans', sans-serif;
  overflow: hidden;
  transition: color 1.2s ease;
}

/* Account gateway */
.auth-page {
  min-height: 100%;
  overflow: auto;
  color: #172033;
  background: #0e1424;
  font-family: 'Manrope', 'Noto Sans KR', sans-serif;
}

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

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(430px, .95fr);
  min-height: 100vh;
}

.auth-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(44px, 7vw, 108px);
  color: #f8faff;
  background:
    radial-gradient(circle at 78% 18%, rgba(123, 97, 255, .42), transparent 28%),
    radial-gradient(circle at 20% 86%, rgba(38, 192, 205, .2), transparent 32%),
    linear-gradient(145deg, #10182d 0%, #12152a 52%, #201846 100%);
}

.auth-intro::before,
.auth-intro::after {
  position: absolute;
  content: '';
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
}

.auth-intro::before {
  width: 520px;
  height: 520px;
  right: -210px;
  top: -190px;
}

.auth-intro::after {
  width: 330px;
  height: 330px;
  right: -110px;
  top: -90px;
}

.auth-home {
  position: absolute;
  top: 36px;
  left: clamp(32px, 7vw, 108px);
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
}

.auth-home span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 11px;
  background: rgba(255,255,255,.08);
}

.auth-home svg,
.auth-features svg,
.auth-eyebrow svg,
.auth-switch svg,
.auth-form svg,
.auth-alert svg,
.auth-foot svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.auth-orbit {
  position: absolute;
  right: 11%;
  top: 15%;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  color: #c9beff;
  background: rgba(255,255,255,.07);
  box-shadow: 0 0 70px rgba(121, 92, 255, .45);
  animation: auth-float 4s ease-in-out infinite;
}

.auth-orbit svg {
  width: 34px;
  height: 34px;
}

.auth-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 24px;
  color: #b9adff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .15em;
}

.auth-intro h1 {
  max-width: 660px;
  margin: 0;
  font-size: clamp(40px, 5vw, 74px);
  line-height: 1.08;
  letter-spacing: -.055em;
}

.auth-intro h1 em {
  color: #a998ff;
  font-style: normal;
}

.auth-intro > p:not(.auth-eyebrow) {
  max-width: 580px;
  margin: 28px 0 0;
  color: #aeb9cf;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 16px;
  line-height: 1.85;
}

.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 44px;
}

.auth-features span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px;
  color: #d8deeb;
  background: rgba(255,255,255,.055);
  font-size: 12px;
  font-weight: 700;
}

.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 6vw, 100px);
  background: #f7f8fc;
  transition: background .35s ease;
}

.auth-page[data-auth-mode="register"] .auth-card {
  background: #fffaf5;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-width: 540px;
  margin-bottom: 38px;
  padding: 5px;
  border: 1px solid #e1e5ee;
  border-radius: 15px;
  background: #eceff5;
}

.auth-switch a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 11px;
  color: #7a8395;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: .2s ease;
}

.auth-switch a[aria-selected="true"] {
  color: #fff;
  background: #5b4bd8;
  box-shadow: 0 8px 24px rgba(91, 75, 216, .26);
}

.auth-page[data-auth-mode="register"] .auth-switch a[aria-selected="true"] {
  background: #e86f38;
  box-shadow: 0 8px 24px rgba(232, 111, 56, .24);
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 540px;
  margin: -18px 0 26px;
  padding: 13px 15px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #a82424;
  background: #fff1f1;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  line-height: 1.55;
}

.auth-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 28px;
}

.auth-heading-icon {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: #5b4bd8;
  box-shadow: 0 10px 24px rgba(91, 75, 216, .22);
}

.register-heading .auth-heading-icon {
  background: #e86f38;
  box-shadow: 0 10px 24px rgba(232, 111, 56, .22);
}

.auth-heading-icon svg {
  width: 24px;
  height: 24px;
}

.auth-heading p {
  margin: 0 0 5px;
  color: #8d96a8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
}

.auth-heading h2 {
  margin: 0;
  color: #172033;
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -.035em;
}

.auth-form {
  display: grid;
  gap: 18px;
  max-width: 540px;
}

.auth-form label > span {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #485267;
  font-size: 12px;
  font-weight: 800;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid #d9deea;
  border-radius: 12px;
  outline: 0;
  color: #172033;
  background: #fff;
  font: 500 14px 'Noto Sans KR', sans-serif;
  transition: border .2s ease, box-shadow .2s ease;
}

.auth-form input:focus {
  border-color: #7262e5;
  box-shadow: 0 0 0 4px rgba(91, 75, 216, .11);
}

.register-form input:focus {
  border-color: #e86f38;
  box-shadow: 0 0 0 4px rgba(232, 111, 56, .1);
}

.readonly-score {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 15px;
  border: 1px dashed #e5a17f;
  border-radius: 12px;
  color: #8b3f20;
  background: #fff4eb;
}

.readonly-score strong {
  font-size: 20px;
}

.readonly-score small {
  color: #a76c53;
  font-size: 12px;
}

.readonly-score svg {
  margin-left: auto;
  color: #d75d28;
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 56px;
  margin-top: 5px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  font: 800 14px 'Noto Sans KR', sans-serif;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.auth-submit:hover {
  transform: translateY(-2px);
}

.login-submit {
  background: linear-gradient(135deg, #5b4bd8, #7867eb);
  box-shadow: 0 12px 30px rgba(91, 75, 216, .25);
}

.register-submit {
  background: linear-gradient(135deg, #de622c, #ef8b48);
  box-shadow: 0 12px 30px rgba(222, 98, 44, .23);
}

.auth-foot {
  max-width: 540px;
  margin: 24px 0 0;
  color: #8992a4;
  text-align: center;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
}

.auth-foot a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #5544cb;
  font-weight: 700;
  text-decoration: none;
}

.auth-page[data-auth-mode="register"] .auth-foot a {
  color: #d75d28;
}

/* Signed-in player HUD */
.player-bar {
  position: fixed;
  top: 16px;
  right: 18px;
  left: 18px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.player-home,
.player-account,
.player-best,
.player-upgrade,
.player-logout button {
  border: 1px solid rgba(255,255,255,.52);
  border-radius: 13px;
  color: var(--ink);
  background: var(--label-bg);
  box-shadow: 0 8px 28px rgba(23, 34, 54, .1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.player-home,
.player-account,
.player-best,
.player-upgrade,
.player-logout,
.player-logout button {
  pointer-events: auto;
}

.player-home {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-decoration: none;
}

.player-home svg,
.player-account svg,
.player-best svg,
.player-logout svg {
  width: 17px;
  height: 17px;
}

.player-account,
.player-best {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 6px 12px;
}

.player-account {
  margin-left: auto;
}

.player-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: #6857dc;
}

.player-account span:last-child,
.player-best span {
  display: grid;
  gap: 1px;
}

.player-account small,
.player-best small {
  opacity: .58;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .1em;
}

.player-account strong,
.player-best strong {
  font-size: 12px;
  line-height: 1.15;
}

.player-best > svg {
  color: #d39419;
}

.player-best b {
  font-size: 15px;
}

.player-best.is-updated {
  animation: best-score-pop 1.1s ease;
}

.player-upgrade {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 48px;
  padding: 0 14px;
  border-color: rgba(255, 217, 118, .75);
  color: #60420a;
  background: linear-gradient(135deg, rgba(255, 242, 193, .9), rgba(255, 207, 92, .82));
  font: 800 11px 'Noto Sans KR', sans-serif;
  cursor: pointer;
}

.player-upgrade svg {
  width: 17px;
  height: 17px;
}

.player-logout {
  margin: 0;
}

.player-logout button {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 48px;
  padding: 0 14px;
  border-color: rgba(255,255,255,.52);
  font: 700 11px 'Noto Sans KR', sans-serif;
  cursor: pointer;
}

.paywall[hidden] {
  display: none;
}

.paywall {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 12, 24, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.paywall-card {
  position: relative;
  width: min(100%, 480px);
  padding: 42px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 28px;
  color: #1b2334;
  background:
    radial-gradient(circle at 92% 4%, rgba(255, 207, 93, .32), transparent 30%),
    linear-gradient(160deg, #fff 0%, #fffaf0 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
  text-align: center;
  animation: paywall-enter .48s cubic-bezier(.2,.8,.2,1) both;
}

.paywall-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #e5e8ef;
  border-radius: 50%;
  color: #697386;
  background: #fff;
  cursor: pointer;
}

.paywall-close svg {
  width: 17px;
  height: 17px;
}

.paywall-icon {
  display: grid;
  width: 70px;
  height: 70px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 22px;
  color: #6a4804;
  background: linear-gradient(135deg, #ffeaa7, #ffc84d);
  box-shadow: 0 14px 34px rgba(232, 167, 28, .28);
}

.paywall-icon svg {
  width: 34px;
  height: 34px;
}

.paywall-eyebrow {
  margin: 0 0 8px !important;
  color: #c0820c;
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: .17em;
}

.paywall h2 {
  margin: 0;
  font: 800 clamp(27px, 4vw, 36px)/1.22 'Manrope', 'Noto Sans KR', sans-serif;
  letter-spacing: -.045em;
}

.paywall-card > p:not(.paywall-eyebrow):not(.payment-status) {
  margin: 16px auto 0;
  color: #70798a;
  font: 400 13px/1.7 'Noto Sans KR', sans-serif;
}

.paywall-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 26px 0 20px;
}

.paywall-benefits span {
  display: grid;
  gap: 7px;
  place-items: center;
  padding: 13px 6px;
  border: 1px solid #ece8dc;
  border-radius: 13px;
  background: rgba(255,255,255,.68);
}

.paywall-benefits svg {
  width: 20px;
  height: 20px;
  color: #c38714;
}

.paywall-benefits b {
  font: 700 10px 'Noto Sans KR', sans-serif;
}

.paywall-price {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 15px 17px;
  border-radius: 14px;
  color: #574425;
  background: #fff2d3;
  font: 700 12px 'Noto Sans KR', sans-serif;
}

.paywall-price strong {
  color: #1d2532;
  font: 800 27px 'Manrope', sans-serif;
}

.paywall-price small {
  margin-left: 3px;
  font: 700 13px 'Noto Sans KR', sans-serif;
}

.purchase-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #2f6df6, #1853df);
  box-shadow: 0 14px 28px rgba(33, 91, 226, .25);
  font: 800 14px 'Noto Sans KR', sans-serif;
  cursor: pointer;
}

.purchase-button:disabled {
  opacity: .65;
  cursor: wait;
}

.purchase-button svg {
  width: 19px;
  height: 19px;
}

.payment-status {
  margin: 12px 0 0 !important;
  color: #7b8494;
  font: 500 11px 'Noto Sans KR', sans-serif;
}

.payment-status.is-error {
  color: #c43d3d;
}

.payment-toast {
  position: fixed;
  top: 78px;
  left: 50%;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  font: 700 12px 'Noto Sans KR', sans-serif;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  animation: toast-enter .45s ease both;
}

.payment-toast.success { background: #17835a; }
.payment-toast.failure { background: #b64040; }
.payment-toast svg { width: 18px; height: 18px; }

@keyframes paywall-enter {
  from { opacity: 0; transform: translateY(24px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-enter {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes auth-float {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-13px) rotate(5deg); }
}

@keyframes best-score-pop {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.09); box-shadow: 0 0 0 7px rgba(255, 193, 65, .18); }
}

.theme-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--sky);
  transition: background 1.2s ease;
}

.theme-stars,
.theme-celestial,
.theme-terrain,
.theme-weather {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease, transform 1.2s ease, background 1.2s ease;
}

.theme-celestial {
  inset: auto 13vw 65vh auto;
  width: clamp(76px, 9vw, 132px);
  height: clamp(76px, 9vw, 132px);
  border-radius: 50%;
  transform: translateY(35px) scale(.8);
}

.theme-stars {
  background-image:
    radial-gradient(circle at 8% 18%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 19% 37%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 32% 12%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 45% 29%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 58% 9%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 69% 35%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 81% 14%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 92% 31%, #fff 0 1.5px, transparent 2.5px);
  background-size: 330px 230px;
  animation: star-drift 18s linear infinite;
}

.theme-terrain {
  inset: auto 0 0;
  height: 38vh;
  transform: translateY(16%);
}

.theme-weather {
  z-index: 2;
}

.world-theme-label {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  padding: 8px 15px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  color: var(--ink);
  background: var(--label-bg);
  box-shadow: 0 8px 28px rgba(23, 34, 54, .12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  white-space: nowrap;
  transition: color 1.2s ease, background 1.2s ease;
}

.world-theme-label.is-changing {
  animation: theme-label-pop .75s ease both;
}

#messageBox,
.interstitial-wrapper {
  position: relative;
  z-index: 3;
}

#messageBox h1 {
  margin: 0;
  padding-top: clamp(76px, 13vh, 130px);
  text-align: center;
  font-family: 'Open Sans', sans-serif;
  font-size: clamp(20px, 3vw, 32px);
  letter-spacing: -.025em;
  text-shadow: 0 2px 18px rgba(255, 255, 255, .5);
}

.runner-canvas,
.icon-offline {
  transition: filter 1.1s ease;
}

/* 0–99: clear morning */
body[data-world-theme="default"] .theme-celestial {
  opacity: .72;
  background: radial-gradient(circle at 36% 32%, #fff 0 8%, #ffe8a7 35%, #ffd16a 70%);
  box-shadow: 0 0 55px rgba(255, 208, 111, .65);
  transform: translateY(0) scale(1);
}

body[data-world-theme="default"] .theme-terrain {
  opacity: .6;
  background:
    radial-gradient(ellipse at 12% 110%, #cbe6d2 0 43%, transparent 44%),
    radial-gradient(ellipse at 52% 116%, #e0efdd 0 48%, transparent 49%),
    radial-gradient(ellipse at 91% 108%, #c8dfcf 0 44%, transparent 45%);
}

/* 100–199: sunset */
body[data-world-theme="sunset"] {
  --sky: linear-gradient(180deg, #38265f 0%, #a34572 37%, #f28b69 69%, #ffd59a 100%);
  --ink: #382044;
  --label-bg: rgba(255, 225, 207, .62);
}

body[data-world-theme="sunset"] .theme-celestial {
  opacity: 1;
  background: #ffdb83;
  box-shadow: 0 0 72px #ff9f73;
  transform: translateY(28px) scale(1.08);
}

body[data-world-theme="sunset"] .theme-terrain {
  opacity: .68;
  background:
    radial-gradient(ellipse at 15% 118%, #6d375c 0 46%, transparent 47%),
    radial-gradient(ellipse at 64% 122%, #4f315c 0 54%, transparent 55%),
    linear-gradient(0deg, #332441 0 20%, transparent 21%);
}

/* 200–299: night */
body[data-world-theme="night"] {
  --sky: linear-gradient(180deg, #081329 0%, #142b52 55%, #315276 100%);
  --ink: #eaf3ff;
  --label-bg: rgba(17, 37, 67, .65);
}

body[data-world-theme="night"] .theme-stars,
body[data-world-theme="space"] .theme-stars {
  opacity: .9;
}

body[data-world-theme="night"] .theme-celestial {
  opacity: .95;
  background: #f5f1d5;
  box-shadow: inset -24px -8px 0 #cbd7e8, 0 0 45px rgba(220, 235, 255, .55);
  transform: translateY(0) scale(.78);
}

body[data-world-theme="night"] .theme-terrain {
  opacity: .74;
  background:
    radial-gradient(ellipse at 18% 115%, #162942 0 46%, transparent 47%),
    radial-gradient(ellipse at 68% 120%, #102039 0 55%, transparent 56%),
    linear-gradient(0deg, #091426 0 18%, transparent 19%);
}

/* 300–399: city */
body[data-world-theme="city"] {
  --sky: linear-gradient(180deg, #10162d 0%, #273760 52%, #d67878 100%);
  --ink: #f4f6ff;
  --label-bg: rgba(19, 26, 51, .68);
}

body[data-world-theme="city"] .theme-stars {
  opacity: .35;
}

body[data-world-theme="city"] .theme-terrain,
body[data-world-theme="rain"] .theme-terrain {
  opacity: 1;
  height: 36vh;
  transform: translateY(3%);
  background:
    repeating-linear-gradient(90deg, transparent 0 16px, #ffd97a 17px 20px, transparent 21px 35px) 0 38% / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, #11182a 0 42px, #1c2740 42px 74px, #0b1221 74px 112px);
  clip-path: polygon(0 42%, 4% 42%, 4% 15%, 9% 15%, 9% 31%, 14% 31%, 14% 4%, 20% 4%, 20% 38%, 27% 38%, 27% 20%, 33% 20%, 33% 46%, 39% 46%, 39% 10%, 45% 10%, 45% 35%, 51% 35%, 51% 0, 57% 0, 57% 39%, 63% 39%, 63% 18%, 70% 18%, 70% 44%, 77% 44%, 77% 7%, 83% 7%, 83% 34%, 91% 34%, 91% 17%, 96% 17%, 96% 40%, 100% 40%, 100% 100%, 0 100%);
}

/* 400–499: desert */
body[data-world-theme="desert"] {
  --sky: linear-gradient(180deg, #67b9dc 0%, #bfe6e7 57%, #ffe2a8 100%);
  --ink: #4f3528;
  --label-bg: rgba(255, 239, 194, .66);
}

body[data-world-theme="desert"] .theme-celestial {
  opacity: .95;
  background: #fff2a5;
  box-shadow: 0 0 60px rgba(255, 222, 111, .85);
  transform: translateY(-12px) scale(.92);
}

body[data-world-theme="desert"] .theme-terrain {
  opacity: 1;
  height: 43vh;
  background:
    radial-gradient(ellipse at 8% 110%, #d9964e 0 44%, transparent 45%),
    radial-gradient(ellipse at 53% 118%, #f2bd6b 0 54%, transparent 55%),
    radial-gradient(ellipse at 102% 105%, #c77d42 0 43%, transparent 44%),
    linear-gradient(0deg, #e5a457 0 20%, transparent 21%);
}

/* 500–599: space */
body[data-world-theme="space"] {
  --sky: radial-gradient(circle at 72% 22%, #3e1f75 0%, #131640 35%, #050816 76%);
  --ink: #f3efff;
  --label-bg: rgba(20, 17, 57, .68);
}

body[data-world-theme="space"] .theme-stars {
  opacity: 1;
  background-color: transparent;
  filter: drop-shadow(0 0 4px #9ed8ff);
}

body[data-world-theme="space"] .theme-celestial {
  opacity: 1;
  width: clamp(110px, 14vw, 190px);
  height: clamp(110px, 14vw, 190px);
  background: radial-gradient(circle at 35% 28%, #d1b2ff 0 5%, #6f5bb8 24%, #273678 68%, #111637 100%);
  box-shadow: -18px 18px 0 -10px rgba(102, 75, 171, .4), 0 0 70px rgba(117, 95, 209, .58);
  transform: translateY(-5px) scale(1);
}

body[data-world-theme="space"] .theme-terrain {
  opacity: .65;
  height: 24vh;
  background: radial-gradient(ellipse at 50% 130%, #25265d 0 58%, transparent 59%);
}

/* 600–699: rain */
body[data-world-theme="rain"] {
  --sky: linear-gradient(180deg, #192635 0%, #40566a 56%, #738695 100%);
  --ink: #edf7ff;
  --label-bg: rgba(25, 42, 57, .7);
}

body[data-world-theme="rain"] .theme-terrain {
  filter: blur(.2px);
  opacity: .82;
}

body[data-world-theme="rain"] .theme-weather {
  opacity: .62;
  background: repeating-linear-gradient(108deg, transparent 0 22px, rgba(195, 226, 255, .68) 23px 24px, transparent 25px 44px);
  background-size: 80px 120px;
  animation: rain-fall .52s linear infinite;
}

/* 700+: snow */
body[data-world-theme="snow"] {
  --sky: linear-gradient(180deg, #8ca9c0 0%, #d9e7ef 57%, #f8fbfd 100%);
  --ink: #263d50;
  --label-bg: rgba(244, 251, 255, .72);
}

body[data-world-theme="snow"] .theme-celestial {
  opacity: .5;
  background: #f8fdff;
  box-shadow: 0 0 70px rgba(255, 255, 255, .95);
  transform: translateY(-8px) scale(.85);
}

body[data-world-theme="snow"] .theme-terrain {
  opacity: 1;
  height: 42vh;
  background:
    linear-gradient(145deg, transparent 50%, #b8cedd 51% 62%, #f8fcff 63%) 6% 100% / 38% 76% no-repeat,
    linear-gradient(215deg, transparent 50%, #a9c1d2 51% 62%, #f2f9fc 63%) 92% 100% / 48% 86% no-repeat,
    linear-gradient(0deg, #eff7fa 0 23%, transparent 24%);
}

body[data-world-theme="snow"] .theme-weather {
  opacity: .9;
  background-image:
    radial-gradient(circle, #fff 0 2px, transparent 2.5px),
    radial-gradient(circle, rgba(255,255,255,.82) 0 3px, transparent 3.5px),
    radial-gradient(circle, rgba(255,255,255,.66) 0 1.5px, transparent 2px);
  background-position: 0 0, 38px 20px, 12px 46px;
  background-size: 72px 72px, 104px 104px, 54px 54px;
  animation: snow-fall 7s linear infinite;
}

body[data-world-theme="night"] .runner-canvas,
body[data-world-theme="night"] .icon-offline,
body[data-world-theme="city"] .runner-canvas,
body[data-world-theme="city"] .icon-offline,
body[data-world-theme="space"] .runner-canvas,
body[data-world-theme="space"] .icon-offline,
body[data-world-theme="rain"] .runner-canvas,
body[data-world-theme="rain"] .icon-offline {
  filter: invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, .18));
}

@keyframes theme-label-pop {
  0% { transform: translateX(-50%) scale(.84); opacity: .25; }
  50% { transform: translateX(-50%) scale(1.07); }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

@keyframes star-drift {
  from { background-position: 0 0; }
  to { background-position: -330px 0; }
}

@keyframes rain-fall {
  from { background-position: 0 -120px; }
  to { background-position: -24px 120px; }
}

@keyframes snow-fall {
  from { background-position: 0 -72px, 38px -84px, 12px -54px; }
  to { background-position: 36px 72px, 0 104px, 38px 54px; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-stars,
  .theme-weather,
  .world-theme-label {
    animation: none !important;
  }
}

@media (max-width: 920px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: 42vh;
    padding: 112px 30px 48px;
  }

  .auth-intro h1 {
    max-width: 620px;
    font-size: clamp(38px, 8vw, 62px);
  }

  .auth-orbit {
    right: 8%;
    top: 17%;
  }

  .auth-home {
    left: 30px;
  }

  .auth-card {
    min-height: 58vh;
    padding: 48px 30px 64px;
  }

  .auth-switch,
  .auth-form,
  .auth-alert,
  .auth-foot {
    width: 100%;
    max-width: 620px;
    margin-right: auto;
    margin-left: auto;
  }

  .auth-heading {
    width: 100%;
    max-width: 620px;
    margin-right: auto;
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  .auth-intro {
    min-height: 390px;
    padding: 105px 22px 40px;
  }

  .auth-home {
    top: 26px;
    left: 22px;
  }

  .auth-orbit {
    top: 25px;
    right: 22px;
    width: 66px;
    height: 66px;
  }

  .auth-orbit svg {
    width: 27px;
    height: 27px;
  }

  .auth-intro h1 {
    font-size: 38px;
  }

  .auth-intro > p:not(.auth-eyebrow) {
    margin-top: 20px;
    font-size: 14px;
  }

  .auth-features {
    gap: 7px;
    margin-top: 28px;
  }

  .auth-features span {
    padding: 8px 10px;
    font-size: 10px;
  }

  .auth-card {
    padding: 34px 20px 50px;
  }

  .auth-switch {
    margin-bottom: 30px;
  }

  .player-bar {
    top: 10px;
    right: 10px;
    left: 10px;
    gap: 6px;
  }

  .player-home,
  .player-account,
  .player-best,
  .player-upgrade,
  .player-logout button {
    height: 42px;
    min-height: 42px;
    border-radius: 11px;
  }

  .player-home span,
  .player-account,
  .player-upgrade span,
  .player-logout span {
    display: none;
  }

  .player-home,
  .player-upgrade,
  .player-logout button {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .player-best {
    margin-left: auto;
    padding: 5px 10px;
  }

  .world-theme-label {
    top: 66px;
  }

  #messageBox h1 {
    padding-top: 120px;
  }

  .paywall {
    padding: 12px;
  }

  .paywall-card {
    padding: 34px 20px 25px;
    border-radius: 22px;
  }

  .paywall-benefits {
    gap: 5px;
  }
}

.icon {
  -webkit-user-select: none;
  user-select: none;
  display: inline-block;
}

.icon-offline {
  content: -webkit-image-set( url(assets/default_100_percent/100-error-offline.png) 1x, url(assets/default_200_percent/200-error-offline.png) 2x);
  position: relative;
}

.hidden {
  display: none;
}


/* Offline page */

.offline .interstitial-wrapper {
  color: #2b2b2b;
  font-size: 1em;
  line-height: 1.55;
  margin: 0 auto;
  max-width: 600px;
  padding-top: 100px;
  width: 100%;
}

.offline .runner-container {
  height: 150px;
  max-width: 600px;
  overflow: hidden;
  position: absolute;
  top: 35px;
  width: 44px;
}

.offline .runner-canvas {
  height: 150px;
  max-width: 600px;
  opacity: 1;
  overflow: hidden;
  position: absolute;
  top: 0;
  z-index: 2;
}

.offline .controller {
  background: rgba(247, 247, 247, .1);
  height: 100vh;
  left: 0;
  position: absolute;
  top: 0;
  width: 100vw;
  z-index: 1;
}

#offline-resources {
  display: none;
}

@media (max-width: 420px) {
  .suggested-left > #control-buttons, .suggested-right > #control-buttons {
    float: none;
  }
  .snackbar {
    left: 0;
    bottom: 0;
    width: 100%;
    border-radius: 0;
  }
}

@media (max-height: 350px) {
  h1 {
    margin: 0 0 15px;
  }
  .icon-offline {
    margin: 0 0 10px;
  }
  .interstitial-wrapper {
    margin-top: 5%;
  }
  .nav-wrapper {
    margin-top: 30px;
  }
}

@media (min-width: 600px) and (max-width: 736px) and (orientation: landscape) {
  .offline .interstitial-wrapper {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (min-width: 420px) and (max-width: 736px) and (min-height: 240px) and (max-height: 420px) and (orientation:landscape) {
  .interstitial-wrapper {
    margin-bottom: 100px;
  }
}

@media (min-height: 240px) and (orientation: landscape) {
  .offline .interstitial-wrapper {
    margin-bottom: 90px;
  }
  .icon-offline {
    margin-bottom: 20px;
  }
}

@media (max-height: 320px) and (orientation: landscape) {
  .icon-offline {
    margin-bottom: 0;
  }
  .offline .runner-container {
    top: 10px;
  }
}

@media (max-width: 240px) {
  .interstitial-wrapper {
    overflow: inherit;
    padding: 0 8px;
  }
}

.arcade-mode,
.arcade-mode .runner-container,
.arcade-mode .runner-canvas {
  image-rendering: pixelated;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode #buttons,
.arcade-mode #main-content {
  opacity: 0;
  overflow: hidden;
}

.arcade-mode .interstitial-wrapper {
  height: 100vh;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode .runner-container {
  left: 0;
  margin: auto;
  right: 0;
  transform-origin: top center;
  transition: transform 250ms cubic-bezier(0.4, 0, 1, 1) 400ms;
  z-index: 2;
}
