:root {
  --ink: #172033;
  --ink-soft: #516072;
  --shell: #fff9f1;
  --glass: rgba(255, 255, 255, 0.72);
  --line: rgba(23, 32, 51, 0.12);
  --berry: #f64f78;
  --orange: #ff9f43;
  --lemon: #ffd166;
  --mint: #58d7b7;
  --sky: #48bdf5;
  --violet: #8c6cf7;
  --shadow: 0 18px 42px rgba(26, 40, 71, 0.18);
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

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

html {
  overflow: hidden;
}

body {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 209, 102, 0.42), transparent 24%),
    radial-gradient(circle at 84% 18%, rgba(72, 189, 245, 0.36), transparent 24%),
    radial-gradient(circle at 50% 92%, rgba(88, 215, 183, 0.34), transparent 30%),
    linear-gradient(155deg, #fff8e8 0%, #f8f0ff 43%, #e9fbff 100%);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

button,
a {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.game-shell {
  width: min(100%, 520px);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding:
    max(12px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(6px, 1.2dvh, 10px);
  overflow: hidden;
}

.title-screen {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 14px;
  padding:
    max(16px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 209, 102, 0.52), transparent 28%),
    radial-gradient(circle at 84% 22%, rgba(72, 189, 245, 0.42), transparent 28%),
    radial-gradient(circle at 52% 88%, rgba(88, 215, 183, 0.42), transparent 34%),
    linear-gradient(155deg, #fff8e8 0%, #f8f0ff 43%, #e9fbff 100%);
}

.title-screen.hidden {
  display: none;
}

.server-loader {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.18), transparent 34%),
    rgba(23, 32, 51, 0.18);
  backdrop-filter: blur(4px) saturate(1.05);
  -webkit-backdrop-filter: blur(4px) saturate(1.05);
  pointer-events: auto;
  cursor: wait;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

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

.game-shell.is-server-loading > :not(.server-loader) {
  filter: blur(1.5px) saturate(0.96);
  pointer-events: none;
}

.server-loader-card {
  width: min(236px, 100%);
  min-height: 52px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(196, 247, 255, 0.66));
  box-shadow: 0 22px 50px rgba(20, 32, 50, 0.24);
  transform: translateY(0) scale(1);
  transition: transform 0.18s ease;
}

.server-loader.hidden .server-loader-card {
  transform: translateY(10px) scale(0.96);
}

.server-loader-jelly {
  position: relative;
  width: 26px;
  height: 22px;
  border-radius: 13px 13px 10px 10px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.92) 0 12%, transparent 13%),
    linear-gradient(180deg, #ff7aa8, #f64f78);
  box-shadow:
    inset 0 -4px 0 rgba(201, 35, 86, 0.18),
    0 6px 12px rgba(246, 79, 120, 0.24);
  animation: serverJellyBounce 0.72s ease-in-out infinite;
}

.server-loader-jelly::before,
.server-loader-jelly::after {
  content: "";
  position: absolute;
  top: 11px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #1d2c3f;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
}

.server-loader-jelly::before {
  left: 8px;
}

.server-loader-jelly::after {
  right: 8px;
}

.server-loader-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.26)),
    rgba(72, 189, 245, 0.2);
  box-shadow:
    inset 0 2px 5px rgba(49, 64, 82, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.78);
}

.server-loader-fill {
  position: absolute;
  inset: 2px auto 2px 2px;
  width: 46%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 24% 35%, rgba(255, 255, 255, 0.92), transparent 18%),
    linear-gradient(90deg, #ff9f43, #f64f78 48%, #48bdf5);
  box-shadow:
    0 0 12px rgba(246, 79, 120, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  animation: serverJellySlide 0.98s ease-in-out infinite;
}

@keyframes serverJellyBounce {
  0%, 100% {
    transform: translateY(1px) scale(1.08, 0.92);
  }
  50% {
    transform: translateY(-3px) scale(0.94, 1.08);
  }
}

@keyframes serverJellySlide {
  0% {
    left: -46%;
    transform: scaleX(0.82);
  }
  45% {
    transform: scaleX(1.18);
  }
  100% {
    left: 100%;
    transform: scaleX(0.82);
  }
}

.title-brand {
  width: fit-content;
}

.title-hero {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  padding-bottom: clamp(20px, 4.8dvh, 42px);
  text-align: center;
}

.title-hero h1 {
  max-width: 100%;
  font-size: clamp(42px, 10vw, 66px);
}

.title-jelly-grid {
  width: min(88%, 360px);
  max-width: 100%;
  align-self: center;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(4px, 1dvh, 10px) clamp(6px, 2vw, 12px);
  padding: clamp(6px, 1.4dvh, 12px);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 18%, rgba(246, 79, 120, 0.16), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(255, 209, 102, 0.28), transparent 28%),
    radial-gradient(circle at 82% 76%, rgba(88, 215, 183, 0.18), transparent 34%),
    rgba(255, 255, 255, 0.46);
  overflow: visible;
}

.title-jelly-grid img {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(246, 79, 120, 0.18));
  pointer-events: none;
}

.title-actions {
  width: min(100%, 320px);
  max-width: 100%;
  display: grid;
  gap: 16px;
  align-self: end;
  justify-self: center;
  margin-bottom: clamp(10px, 3dvh, 28px);
}

.title-actions button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 17px;
  font-weight: 950;
  cursor: pointer;
}

.title-play {
  background: linear-gradient(180deg, #ff8b4a, #f25b73);
  box-shadow: 0 10px 0 #b94354, 0 20px 34px rgba(242, 91, 115, 0.22);
}

.title-rank {
  background: linear-gradient(180deg, #4cc8f5, #6675f7);
  box-shadow: 0 10px 0 #4350bb, 0 20px 34px rgba(76, 151, 245, 0.22);
}

.topbar {
  min-height: 76px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 82px;
  align-items: center;
  gap: 10px;
}

.brand-link {
  min-width: 0;
  color: #314052;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 24px rgba(49, 64, 82, 0.08);
}

.title-lockup {
  min-width: 0;
  text-align: center;
}

.kicker {
  margin: 0 0 2px;
  color: #7b6f90;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(29px, 7.4vw, 42px);
  line-height: 0.95;
  letter-spacing: 0;
  color: #1d2c3f;
  text-shadow:
    0 2px 0 #ffffff,
    0 10px 24px rgba(246, 79, 120, 0.18);
}

.icon-command {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #243348;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.55));
  box-shadow: 0 10px 24px rgba(49, 64, 82, 0.12);
  cursor: pointer;
}

.icon-command:active {
  transform: translateY(2px);
  box-shadow: 0 6px 18px rgba(49, 64, 82, 0.1);
}

.icon-command:focus-visible {
  outline: 3px solid rgba(246, 79, 120, 0.34);
  outline-offset: 2px;
}

.home-command {
  position: relative;
  justify-self: start;
}

.home-command::before {
  content: "";
  width: 18px;
  height: 18px;
  border-top: 4px solid #243348;
  border-left: 4px solid #243348;
  border-radius: 3px 0 0 0;
  transform: translateY(3px) rotate(45deg);
}

.home-command::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 22px;
  width: 18px;
  height: 14px;
  border: 4px solid #243348;
  border-top: 0;
  border-radius: 0 0 4px 4px;
  transform: translateX(-50%);
}

.sound-command {
  position: relative;
  justify-self: end;
}

.sound-command::before {
  content: "";
  width: 20px;
  height: 18px;
  background: currentColor;
  clip-path: polygon(0 34%, 30% 34%, 68% 4%, 68% 96%, 30% 66%, 0 66%);
}

.sound-command::after {
  content: "";
  position: absolute;
  right: 8px;
  width: 12px;
  height: 18px;
  border: 3px solid currentColor;
  border-left: 0;
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-radius: 0 999px 999px 0;
}

.sound-command[aria-pressed="false"] {
  color: #9b4c65;
}

.sound-command[aria-pressed="false"]::after {
  right: 11px;
  width: 20px;
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-45deg);
}

.score-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 360px);
  justify-self: center;
}

.score-tile {
  width: 100%;
  min-height: 54px;
  padding: 8px 14px 7px;
  border: 1px solid rgba(255,255,255,0.68);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(255,255,255,0.42));
  box-shadow: 0 12px 26px rgba(49, 64, 82, 0.09);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.score-tile span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.score-tile strong {
  margin-top: 2px;
  color: #1d2c3f;
  font-size: clamp(22px, 5.8vw, 30px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
}

.play-area {
  min-height: 0;
  display: grid;
  place-items: center;
}

.stage-frame {
  position: relative;
  width: min(100%, calc(100dvh - 240px));
  max-width: 492px;
  max-height: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.52), rgba(255,255,255,0.24)),
    linear-gradient(135deg, rgba(255, 209, 102, 0.45), rgba(72, 189, 245, 0.22) 44%, rgba(246, 79, 120, 0.25));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stage-frame::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 8px;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.28) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.22) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.28;
}

.pixi-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.pixi-stage canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  touch-action: none;
}

.pixi-stage canvas:focus {
  outline: none;
}

.pixi-stage canvas:focus-visible {
  outline: 4px solid rgba(246, 79, 120, 0.52);
  outline-offset: -5px;
  border-radius: 7px;
}

.quick-guide {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
}

.quick-guide.is-visible {
  opacity: 1;
}

.guide-hand {
  position: absolute;
  left: 60%;
  top: 56%;
  width: 46px;
  height: 46px;
  border-radius: 50% 50% 44% 44%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.92), transparent 16px),
    linear-gradient(145deg, #fff2cf, #ffb86b);
  box-shadow:
    0 8px 18px rgba(125, 67, 34, 0.2),
    inset 0 -5px 0 rgba(210, 121, 58, 0.2);
  transform: translate(-50%, -50%) rotate(-18deg);
  animation: handSwipe 1.32s cubic-bezier(.5,0,.2,1) infinite;
}

.guide-hand::after {
  content: "";
  position: absolute;
  left: 30px;
  top: 30px;
  width: 18px;
  height: 52px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe6ba, #ffac63);
  transform: rotate(-34deg);
  box-shadow: inset 0 -5px 0 rgba(210, 121, 58, 0.2);
}

@keyframes handSwipe {
  0% { transform: translate(42%, -50%) rotate(-18deg) scale(0.92); opacity: 0; }
  16% { opacity: 1; }
  72% { transform: translate(-160%, -50%) rotate(-18deg) scale(1); opacity: 1; }
  100% { transform: translate(-192%, -50%) rotate(-18deg) scale(0.92); opacity: 0; }
}

.message-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding:
    max(18px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  background: rgba(24, 33, 48, 0.28);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}

.message-modal.hidden {
  display: none;
}

.message-card {
  width: min(100%, 330px);
  max-height: calc(100dvh - 42px);
  overflow-y: auto;
  padding: 22px 18px 18px;
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 8px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,250,240,0.82)),
    radial-gradient(circle at 50% 0%, rgba(255,209,102,0.42), transparent 60%);
  box-shadow: 0 22px 52px rgba(20, 32, 50, 0.24);
  overscroll-behavior: contain;
}

.message-eyebrow {
  margin: 0 0 2px;
  color: #f24c70;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.message-card h2 {
  margin: 0;
  color: #1d2c3f;
  font-size: clamp(32px, 10vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.message-card p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.rank-submit-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(29, 44, 63, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.rank-submit-panel.hidden {
  display: none;
}

.rank-submit-panel.is-complete input,
.rank-submit-panel.is-complete .rank-submit-buttons {
  display: none;
}

.final-score-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.final-score-line strong {
  color: #f24c70;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

.rank-submit-panel input {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(29, 44, 63, 0.17);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  text-align: center;
}

.rank-submit-panel input:focus {
  outline: 2px solid rgba(72, 189, 245, 0.34);
  border-color: rgba(72, 189, 245, 0.72);
}

.rank-submit-buttons {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 0.84fr;
  gap: 8px;
}

.rank-submit-buttons button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  background: linear-gradient(180deg, #4cc8f5, #6675f7);
  box-shadow: 0 7px 0 #4350bb, 0 14px 24px rgba(76, 151, 245, 0.2);
  cursor: pointer;
}

.rank-submit-buttons button + button {
  color: #314052;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(49, 64, 82, 0.12);
}

.rank-submit-buttons button:disabled,
.rank-submit-panel input:disabled {
  opacity: 0.62;
  cursor: default;
}

.submit-status {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 850;
}

.submit-status.ok {
  color: #008f76;
}

.submit-status.fail {
  color: #d84462;
}

.message-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.message-actions.is-single {
  grid-template-columns: 1fr;
}

.message-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 950;
  background: linear-gradient(180deg, #ff8b4a, #f25b73);
  box-shadow: 0 9px 0 #b94354, 0 18px 32px rgba(242, 91, 115, 0.22);
  cursor: pointer;
}

.message-actions button + button {
  background: linear-gradient(180deg, #4cc8f5, #6675f7);
  box-shadow: 0 9px 0 #4350bb, 0 18px 32px rgba(76, 151, 245, 0.22);
}

.rank-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(24, 33, 48, 0.32);
  backdrop-filter: blur(8px);
}

.rank-modal.hidden {
  display: none;
}

.rank-card {
  width: min(100%, 354px);
  max-height: min(90%, 560px);
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,250,240,0.9)),
    radial-gradient(circle at 18% 4%, rgba(255,209,102,0.44), transparent 56%);
  box-shadow: 0 22px 52px rgba(20, 32, 50, 0.26);
}

.rank-card-head {
  display: grid;
  grid-template-columns: 1fr 38px;
  align-items: start;
  gap: 10px;
}

.rank-card-head p {
  margin: 0 0 2px;
  color: #f24c70;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.rank-card-head h2 {
  margin: 0;
  color: #1d2c3f;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.rank-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(29, 44, 63, 0.12);
  border-radius: 8px;
  color: #314052;
  background: rgba(255, 255, 255, 0.72);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.rank-content {
  margin-top: 14px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
}

.rank-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 8px;
  border: 1px solid rgba(29, 44, 63, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.rank-row.top1 {
  background: rgba(255, 238, 175, 0.86);
  border-color: rgba(255, 159, 67, 0.54);
}

.rank-row.top2 {
  background: rgba(236, 248, 255, 0.86);
  border-color: rgba(72, 189, 245, 0.4);
}

.rank-row.top3 {
  background: rgba(255, 231, 218, 0.86);
  border-color: rgba(246, 79, 120, 0.35);
}

.rank-row.me {
  outline: 2px solid rgba(246, 79, 120, 0.28);
}

.rank-pos {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 28px;
  border-radius: 999px;
  background: rgba(29, 44, 63, 0.08);
  color: #314052;
  font-size: 13px;
  font-weight: 950;
}

.rank-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  color: #f24c70;
  font-size: 14px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.rank-loading,
.rank-empty,
.rank-error {
  padding: 24px 12px;
  border: 1px dashed rgba(29, 44, 63, 0.14);
  border-radius: 8px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.46);
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

.control-dock {
  display: grid;
  place-items: center;
  min-height: 0;
  padding-bottom: clamp(18px, 3dvh, 28px);
}

.swipe-pad {
  position: relative;
  height: clamp(78px, 10.5dvh, 92px);
  width: min(174px, 45vw);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 5px;
  padding: 3px;
}

.swipe-pad::before {
  content: "";
  position: absolute;
  inset: 17% 21%;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 10px;
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.86), transparent 25%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.44), rgba(72, 189, 245, 0.16));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 22px rgba(49, 64, 82, 0.08);
}

.swipe-pad::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.34) 58%, rgba(72, 189, 245, 0.18));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 6px 14px rgba(49, 64, 82, 0.1);
  transform: translate(-50%, -50%);
}

.swipe-pad button {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 10px;
  color: #314052;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.56)),
    radial-gradient(circle at 50% 0%, rgba(88, 215, 183, 0.28), transparent 72%);
  box-shadow:
    0 5px 0 rgba(72, 189, 245, 0.18),
    0 10px 18px rgba(49, 64, 82, 0.1),
    inset 0 1px 0 rgba(255,255,255,0.82);
  font-size: 0;
  font-weight: 950;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.swipe-pad button::before {
  content: "";
  width: 11px;
  height: 11px;
  border-top: 3px solid #243348;
  border-right: 3px solid #243348;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.8));
}

.swipe-pad button:active {
  transform: translateY(3px) scale(0.96);
  box-shadow:
    0 2px 0 rgba(72, 189, 245, 0.2),
    0 5px 12px rgba(49, 64, 82, 0.09),
    inset 0 2px 6px rgba(49, 64, 82, 0.08);
}

.swipe-pad button:focus-visible {
  outline: 3px solid rgba(246, 79, 120, 0.34);
  outline-offset: 2px;
}

.swipe-pad button[data-dir="up"] {
  grid-column: 2;
  grid-row: 1;
}

.swipe-pad button[data-dir="up"]::before {
  transform: translateY(2px) rotate(-45deg);
}

.swipe-pad button[data-dir="left"] {
  grid-column: 1;
  grid-row: 2;
}

.swipe-pad button[data-dir="left"]::before {
  transform: translateX(2px) rotate(-135deg);
}

.swipe-pad button[data-dir="down"] {
  grid-column: 2;
  grid-row: 3;
}

.swipe-pad button[data-dir="down"]::before {
  transform: translateY(-2px) rotate(135deg);
}

.swipe-pad button[data-dir="right"] {
  grid-column: 3;
  grid-row: 2;
}

.swipe-pad button[data-dir="right"]::before {
  transform: translateX(-2px) rotate(45deg);
}

@media (min-width: 720px) {
  body {
    display: grid;
    place-items: center;
  }

  .game-shell {
    width: 520px;
    min-height: auto;
    height: min(100vh, 910px);
  }
}

@media (max-height: 720px) {
  .topbar {
    min-height: 54px;
  }

  .title-screen {
    gap: 8px;
  }

  .title-hero h1 {
    font-size: clamp(40px, 11vw, 58px);
  }

  .title-jelly-grid {
    width: min(78%, 280px);
    gap: 4px 7px;
    padding: 7px;
  }

  .score-tile {
    min-height: 46px;
  }

  .stage-frame {
    width: min(100%, calc(100dvh - 234px));
  }

  .control-dock {
    padding-bottom: 18px;
  }

  .swipe-pad {
    width: 150px;
    height: 78px;
    gap: 4px;
  }

  .swipe-pad::after {
    width: 18px;
    height: 18px;
  }
}

@media (max-height: 640px) {
  .control-dock {
    padding-bottom: 14px;
  }

  .swipe-pad {
    width: 138px;
    height: 72px;
  }
}

@media (max-width: 430px) {
  .game-shell {
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .topbar {
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    gap: 7px;
  }

  .title-screen {
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(26px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .title-hero {
    padding-bottom: clamp(28px, 7dvh, 58px);
  }

  .title-hero h1 {
    font-size: clamp(42px, 12vw, 56px);
  }

  .title-jelly-grid {
    width: min(86%, 310px);
  }

  .title-actions button {
    min-height: 50px;
    font-size: 16px;
  }

  .title-actions {
    width: min(100%, 292px);
    gap: 14px;
    margin-bottom: clamp(18px, 6dvh, 48px);
  }

  .message-modal {
    padding:
      max(12px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .message-card {
    max-height: calc(100dvh - 30px);
    padding: 16px 14px 12px;
  }

  .message-card h2 {
    font-size: clamp(28px, 8vw, 38px);
  }

  .rank-submit-panel {
    margin-top: 10px;
    padding: 10px;
  }

  .message-actions {
    margin-top: 10px;
  }

  .rank-submit-panel input {
    min-height: 38px;
    margin-top: 8px;
  }

  .rank-submit-buttons button,
  .message-actions button {
    min-height: 38px;
    box-shadow: 0 6px 0 #4350bb, 0 12px 22px rgba(76, 151, 245, 0.2);
  }

  .rank-submit-buttons button + button {
    box-shadow: inset 0 0 0 1px rgba(49, 64, 82, 0.12);
  }

  .message-actions button {
    box-shadow: 0 6px 0 #b94354, 0 12px 22px rgba(242, 91, 115, 0.2);
  }

  .message-actions button + button {
    box-shadow: 0 6px 0 #4350bb, 0 12px 22px rgba(76, 151, 245, 0.2);
  }

  .brand-link {
    padding: 9px 8px;
    font-size: 12px;
  }

  .icon-command {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  h1 {
    font-size: clamp(27px, 7vw, 32px);
  }

  .score-row {
    gap: 7px;
  }

  .score-tile {
    padding-inline: 6px;
  }

  .score-tile strong {
    font-size: clamp(18px, 5vw, 23px);
  }
}

/* ---------- 2026 title hero: a real Jelly Pang scene ---------- */
.title-screen {
  position: fixed;
  inset: 0;
  z-index: 12;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(4px, 1dvh, 10px);
  padding:
    max(10px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 202, 91, 0.56), transparent 30%),
    radial-gradient(circle at 89% 18%, rgba(84, 202, 255, 0.48), transparent 32%),
    radial-gradient(circle at 52% 96%, rgba(78, 231, 192, 0.42), transparent 38%),
    linear-gradient(145deg, #fff2c9 0%, #fff9f5 38%, #e9f7ff 70%, #dffbf2 100%);
}

.title-screen::before,
.title-screen::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.title-screen::before {
  width: min(70vw, 680px);
  aspect-ratio: 1;
  left: -18vw;
  bottom: -38vw;
  border-radius: 44% 56% 62% 38%;
  background: linear-gradient(135deg, rgba(255, 108, 147, 0.2), rgba(255, 185, 72, 0.08));
  filter: blur(2px);
}

.title-screen::after {
  width: min(62vw, 620px);
  aspect-ratio: 1;
  right: -24vw;
  top: -32vw;
  border-radius: 58% 42% 38% 62%;
  background: linear-gradient(145deg, rgba(72, 189, 245, 0.24), rgba(140, 108, 247, 0.08));
  filter: blur(3px);
}

.title-screen.hidden {
  display: none;
}

.title-bubbles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.title-bubbles span {
  position: absolute;
  display: block;
  width: clamp(24px, 6vw, 64px);
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.88);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.96) 0 8%, transparent 9%),
    linear-gradient(145deg, rgba(255,255,255,0.48), rgba(72,189,245,0.12) 48%, rgba(246,79,120,0.12));
  box-shadow: inset 0 -8px 18px rgba(140,108,247,0.08), 0 12px 24px rgba(49,64,82,0.08);
  opacity: 0.62;
  animation: titleBubbleFloat 6s ease-in-out infinite;
}

.title-bubbles span:nth-child(1) { left: 6%; top: 18%; animation-delay: -1.2s; }
.title-bubbles span:nth-child(2) { right: 8%; top: 12%; width: clamp(18px, 4vw, 44px); animation-delay: -3.8s; }
.title-bubbles span:nth-child(3) { left: 12%; bottom: 14%; width: clamp(16px, 3.5vw, 38px); animation-delay: -2.4s; }
.title-bubbles span:nth-child(4) { right: 5%; bottom: 20%; animation-delay: -4.6s; }
.title-bubbles span:nth-child(5) { left: 48%; top: 7%; width: clamp(12px, 2.4vw, 28px); animation-delay: -0.5s; }

.title-brand {
  position: relative;
  z-index: 3;
  width: fit-content;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,0.92);
  border-radius: 999px;
  color: #26364c;
  background: rgba(255,255,255,0.66);
  box-shadow: 0 10px 26px rgba(49,64,82,0.1), inset 0 1px 0 rgba(255,255,255,0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.title-hero {
  position: relative;
  z-index: 2;
  width: min(100%, 1120px);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 0 0 clamp(2px, 1dvh, 8px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "copy"
    "art"
    "actions";
  align-items: center;
  justify-items: center;
  gap: clamp(6px, 1.4dvh, 14px);
  text-align: center;
}

.title-copy {
  grid-area: copy;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: clamp(3px, 0.7dvh, 7px);
}

.title-copy .kicker {
  margin: 0;
  color: #b83d62;
  font-size: clamp(9px, 2.6vw, 12px);
  font-weight: 950;
  letter-spacing: 0.16em;
}

.title-hero h1 {
  max-width: 100%;
  margin: 0;
  color: #17283f;
  font-size: clamp(38px, 12vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.055em;
  text-shadow: 0 3px 0 rgba(255,255,255,0.94), 0 13px 28px rgba(246,79,120,0.2);
}

.title-tagline {
  margin: 0;
  color: #4b5d70;
  font-size: clamp(12px, 3.4vw, 15px);
  line-height: 1.38;
  font-weight: 800;
}

.title-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.title-badges span,
.title-art-chip {
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 999px;
  color: #6f587f;
  background: rgba(255,255,255,0.62);
  box-shadow: 0 5px 14px rgba(49,64,82,0.08);
  font-size: 8px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.title-art-shell {
  grid-area: art;
  position: relative;
  width: min(82vw, 42dvh, 380px);
  aspect-ratio: 1;
  align-self: center;
  justify-self: center;
  filter: drop-shadow(0 24px 30px rgba(86,65,104,0.2));
  animation: titleArtFloat 4.8s ease-in-out infinite;
}

.title-art-shell::before,
.title-art-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
}

.title-art-shell::before {
  width: 42%;
  height: 42%;
  left: -7%;
  top: 4%;
  background: rgba(255, 116, 153, 0.28);
}

.title-art-shell::after {
  width: 48%;
  height: 48%;
  right: -8%;
  bottom: 2%;
  background: rgba(72, 189, 245, 0.25);
}

.title-art {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  border: clamp(3px, 0.8vw, 7px) solid rgba(255,255,255,0.94);
  border-radius: clamp(24px, 7vw, 46px);
  background: rgba(255,255,255,0.5);
  box-shadow:
    0 0 0 2px rgba(246,79,120,0.12),
    0 26px 50px rgba(61,74,105,0.18),
    inset 0 1px 0 rgba(255,255,255,0.9);
}

.title-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.title-art-chip {
  position: absolute;
  left: 50%;
  bottom: -7px;
  z-index: 2;
  translate: -50% 0;
  width: max-content;
  padding: 7px 12px;
  color: #fff;
  border-color: rgba(255,255,255,0.92);
  background: linear-gradient(135deg, #f64f78, #ff9f43);
  box-shadow: 0 8px 16px rgba(246,79,120,0.22);
}

.title-actions {
  grid-area: actions;
  width: min(100%, 330px);
  max-width: 100%;
  margin: 0;
  display: grid;
  gap: clamp(9px, 1.4dvh, 13px);
  align-self: center;
  justify-self: center;
}

.title-actions button {
  position: relative;
  min-height: 52px;
  padding: 11px 18px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 17px;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.title-actions button::after {
  content: "";
  position: absolute;
  inset: 2px 8px auto;
  height: 42%;
  border-radius: 13px 13px 50% 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.24), transparent);
  pointer-events: none;
}

.title-play {
  background: linear-gradient(135deg, #ff9448, #f64f78 62%, #e84175);
  box-shadow: 0 8px 0 #b63b58, 0 18px 30px rgba(242,91,115,0.24);
}

.title-rank {
  background: linear-gradient(135deg, #45d2e9, #4c97f5 54%, #7669ef);
  box-shadow: 0 8px 0 #4350bb, 0 18px 30px rgba(76,151,245,0.22);
}

.title-actions.has-resume {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.title-actions.has-resume .title-play {
  grid-column: 1 / -1;
}

.title-new {
  --premium-button-shadow: #16856f;
  background: linear-gradient(135deg, #7ee3c8, #34c8a5 54%, #1fad91);
  box-shadow: 0 8px 0 #16856f, 0 18px 30px rgba(52, 200, 165, 0.22);
}

.title-actions button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08) brightness(1.03);
}

.title-actions button:active {
  transform: translateY(5px) scale(0.99);
  box-shadow: 0 3px 0 #9f3a55, 0 9px 18px rgba(49,64,82,0.18);
}

.title-new:active {
  box-shadow: 0 3px 0 #16856f, 0 9px 18px rgba(49,64,82,0.18);
}

.title-rank:active {
  box-shadow: 0 3px 0 #4350bb, 0 9px 18px rgba(49,64,82,0.18);
}

.title-actions button:focus-visible,
.title-brand:focus-visible {
  outline: 4px solid #17283f;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.96), 0 16px 30px rgba(49,64,82,0.2);
}

.rank-modal {
  position: fixed;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

@keyframes titleArtFloat {
  0%, 100% { transform: translateY(0) rotate(-0.45deg); }
  50% { transform: translateY(-7px) rotate(0.45deg); }
}

@keyframes titleBubbleFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.04); }
}

@media (min-width: 760px) {
  .title-screen {
    gap: 8px;
    padding:
      max(18px, env(safe-area-inset-top))
      max(24px, env(safe-area-inset-right))
      max(20px, env(safe-area-inset-bottom))
      max(24px, env(safe-area-inset-left));
  }

  .title-hero {
    height: min(100%, 780px);
    grid-template-columns: minmax(300px, 0.82fr) minmax(390px, 1.08fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "copy art"
      "actions art";
    column-gap: clamp(30px, 5vw, 72px);
    row-gap: 22px;
    padding: 4px 0 14px;
  }

  .title-copy {
    align-self: end;
    justify-self: end;
    justify-items: start;
    text-align: left;
  }

  .title-copy .kicker { font-size: 12px; }
  .title-hero h1 { font-size: clamp(58px, 6.2vw, 82px); }
  .title-tagline { font-size: clamp(15px, 1.55vw, 18px); }
  .title-badges { justify-content: flex-start; }
  .title-badges span { padding: 7px 11px; font-size: 9px; }

  .title-art-shell {
    width: min(46vw, 67dvh, 560px);
    grid-row: 1 / -1;
  }

  .title-actions {
    width: min(100%, 372px);
    align-self: start;
    justify-self: end;
    gap: 14px;
  }

  .title-actions button {
    min-height: 60px;
    border-radius: 20px;
    font-size: 18px;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .title-screen {
    grid-template-rows: minmax(0, 1fr);
    padding:
      max(8px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .title-brand {
    position: absolute;
    top: max(8px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    min-height: 32px;
    padding: 6px 11px;
    font-size: 11px;
  }

  .title-hero {
    width: min(100%, 980px);
    height: 100%;
    grid-template-columns: minmax(0, 0.86fr) minmax(170px, 0.94fr) minmax(0, 0.8fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "copy art actions";
    gap: clamp(10px, 2.2vw, 24px);
    padding: max(30px, calc(env(safe-area-inset-top) + 24px)) 0 0;
  }

  .title-copy {
    align-self: center;
    justify-self: end;
    justify-items: start;
    text-align: left;
    gap: 4px;
  }

  .title-copy .kicker { font-size: clamp(8px, 1.3vw, 10px); }
  .title-hero h1 { font-size: clamp(34px, 5.6vw, 52px); }
  .title-tagline { font-size: clamp(10px, 1.7vw, 13px); }
  .title-badges { justify-content: flex-start; gap: 4px; }
  .title-badges span { padding: 4px 7px; font-size: 7px; }

  .title-art-shell {
    grid-row: auto;
    width: min(30vw, 70dvh, 270px);
  }

  .title-art { border-radius: clamp(20px, 4vw, 34px); }
  .title-art-chip { padding: 5px 9px; font-size: 7px; }

  .title-actions {
    width: min(100%, 228px);
    align-self: center;
    justify-self: start;
    gap: 10px;
  }

  .title-actions button {
    min-height: 50px;
    padding: 9px 12px;
    border-radius: 15px;
    font-size: clamp(13px, 2vw, 16px);
    box-shadow: 0 6px 0 #4350bb, 0 12px 20px rgba(49,64,82,0.16);
  }

  .title-play { box-shadow: 0 6px 0 #b63b58, 0 12px 20px rgba(242,91,115,0.2) !important; }
}

@media (max-width: 430px) and (max-height: 650px) {
  .title-screen { gap: 2px; }
  .title-brand { min-height: 32px; padding: 6px 10px; font-size: 11px; }
  .title-hero { gap: 4px; padding-bottom: 2px; }
  .title-copy { gap: 2px; }
  .title-copy .kicker { font-size: 8px; }
  .title-hero h1 { font-size: clamp(36px, 11vw, 44px); }
  .title-tagline { font-size: 11px; line-height: 1.25; }
  .title-badges span { padding: 4px 7px; font-size: 7px; }
  .title-art-shell { width: min(74vw, 39dvh, 244px); }
  .title-art-chip { padding: 5px 9px; font-size: 7px; }
  .title-actions { width: min(100%, 292px); gap: 8px; }
  .title-actions button { min-height: 45px; padding: 8px 12px; border-radius: 14px; font-size: 14px; }
}

@media (pointer: coarse) {
  .title-actions button,
  .title-brand {
    touch-action: manipulation;
  }

  .title-actions button {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .title-art-shell,
  .title-bubbles span {
    animation: none !important;
    transform: none !important;
  }

  .title-actions button,
  .title-brand,
  .title-lang button {
    transition: none !important;
  }
}

.title-lang {
  position: absolute;
  z-index: 4;
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 36px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,0.92);
  border-radius: 999px;
  background: rgba(255,255,255,0.66);
  box-shadow: 0 10px 26px rgba(49,64,82,0.1), inset 0 1px 0 rgba(255,255,255,0.82);
}

.title-lang button {
  min-width: 40px;
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #516072;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.title-lang button.is-active {
  background: #fff;
  color: #172033;
  box-shadow: 0 2px 8px rgba(49,64,82,0.12);
}

.title-lang button:focus-visible {
  outline: 3px solid #17283f;
  outline-offset: 2px;
}

@media (orientation: landscape) and (max-height: 560px) {
  .title-lang {
    top: max(8px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    min-height: 32px;
  }
}

@media (pointer: coarse) {
  .title-lang button {
    touch-action: manipulation;
    min-height: 32px;
  }
}
