:root {
  --bg1: #172446;
  --bg2: #1f2e58;
  --bg-accent-a: #29417b;
  --bg-accent-b: #1f3f84;
  --orb-1: #ff6dc0;
  --orb-2: #58d4ff;
  --orb-3: #8f7bff;
  --card-top: rgba(67, 93, 152, 0.95);
  --card-bottom: rgba(45, 67, 120, 0.96);
  --slate: #2a3b6a;
  --pink: #ff4fb3;
  --purple: #8c52ff;
  --sky: #36b8ff;
  --teal: #2eb8b4;
  --mint: #4ee3c1;
  --orange: #ff9b42;
  --ink: #f6eeff;
  --card: #344a7d;
  --border: rgba(255, 255, 255, 0.12);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 18% 20%, var(--bg-accent-a), transparent 50%),
    radial-gradient(circle at 85% 78%, var(--bg-accent-b), transparent 48%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  overflow-x: hidden;
}

body[data-theme="theme_candy_blue"] {
  --bg1: #132f58;
  --bg2: #1f4d8d;
  --bg-accent-a: #3278cc;
  --bg-accent-b: #4ca0ff;
  --orb-1: #8dc9ff;
  --orb-2: #5fd1ff;
  --orb-3: #88a9ff;
  --card-top: rgba(59, 113, 183, 0.95);
  --card-bottom: rgba(41, 81, 139, 0.96);
}

body[data-theme="theme_orange_pop"] {
  --bg1: #3f2742;
  --bg2: #70364f;
  --bg-accent-a: #a74f57;
  --bg-accent-b: #f08e4f;
  --orb-1: #ffb86a;
  --orb-2: #ff7e6f;
  --orb-3: #ff9f7b;
  --card-top: rgba(123, 69, 96, 0.95);
  --card-bottom: rgba(93, 50, 79, 0.96);
}

body[data-theme="theme_cosmic_grid"] {
  --bg1: #151734;
  --bg2: #2b2f6f;
  --bg-accent-a: #3d49a6;
  --bg-accent-b: #5f74ff;
  --orb-1: #8c74ff;
  --orb-2: #68d2ff;
  --orb-3: #c28dff;
  --card-top: rgba(68, 78, 163, 0.95);
  --card-bottom: rgba(47, 57, 132, 0.96);
}

body[data-theme="theme_legend_glow"] {
  --bg1: #312743;
  --bg2: #5f2f5a;
  --bg-accent-a: #ff6f61;
  --bg-accent-b: #ffbf5f;
  --orb-1: #ff7aa9;
  --orb-2: #ffbe6d;
  --orb-3: #ffd986;
  --card-top: rgba(116, 63, 118, 0.95);
  --card-bottom: rgba(82, 43, 92, 0.96);
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.18;
  pointer-events: none;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.55;
  z-index: 0;
  animation: floatOrb 8s ease-in-out infinite;
}

.orb-1 { width: 250px; height: 250px; background: var(--orb-1); top: 4%; left: -60px; }
.orb-2 { width: 280px; height: 280px; background: var(--orb-2); bottom: 2%; right: -70px; animation-delay: 1.5s; }
.orb-3 { width: 200px; height: 200px; background: var(--orb-3); top: 35%; right: 15%; animation-delay: 0.8s; }

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px;
  display: grid;
  gap: 16px;
}

.card {
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 0 rgba(11, 17, 36, 0.55), 0 16px 26px rgba(10, 15, 34, 0.35);
}

.game-header {
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.hud-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(21, 35, 73, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
}

.hud-badge,
.hud-level,
.hud-hearts {
  background: #2f4374;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 0.84rem;
}

.hud-badge {
  color: #ffd07c;
}

.hud-level {
  color: #9bf8f8;
}

.hud-hearts {
  color: #ff6b91;
  letter-spacing: 0.08em;
}

.hud-economy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hud-economy .eco-chip {
  background: #2f4374;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 8px;
  display: grid;
  gap: 2px;
  min-width: 108px;
}

.hud-economy .eco-chip span {
  font-size: 0.62rem;
  text-transform: uppercase;
  opacity: 0.82;
}

.eco-chip .eco-chip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.eco-chip .eco-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.hud-economy .eco-chip strong {
  font-size: 0.92rem;
}

.brand-block {
  display: grid;
  gap: 2px;
}

.kicker {
  margin: 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.75;
  font-size: 0.7rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.86;
}

select,
.btn,
#typingInput {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
}

.native-select-hidden {
  display: none;
}

.custom-select {
  position: relative;
  min-width: 140px;
}

.custom-select-trigger {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: #fff;
  background: #2f4374;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.custom-select-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 0 rgba(13, 20, 42, 0.55);
  background: #3f5895;
}

.custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  display: none;
  z-index: 40;
  background: #2a3d6d;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 12px 22px rgba(8, 14, 32, 0.45);
}

.custom-select.open .custom-select-menu {
  display: grid;
  gap: 4px;
}

.custom-select-option {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.86rem;
  color: #fff;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option.selected {
  background: #3f5895;
  border-color: rgba(255, 255, 255, 0.14);
}

select,
.btn {
  color: #fff;
  background: #2f4374;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: #2f4374 !important;
  color: #fff !important;
  color-scheme: dark;
  transition: none;
  -webkit-tap-highlight-color: transparent;
}

select:hover,
select:focus,
select:focus-visible,
select:active,
select:open {
  background: #2f4374 !important;
  color: #fff !important;
  outline: 2px solid rgba(78, 227, 193, 0.45);
  outline-offset: 0;
}

select option,
select optgroup {
  background-color: #2a3d6d;
  color: #fff;
}

select option:checked,
select option:hover,
select option:focus,
select option:active {
  background: #3f5895 !important;
  color: #fff !important;
  box-shadow: 0 0 0 100vmax #3f5895 inset;
}

.btn {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 0 rgba(13, 20, 42, 0.55);
  background: #3f5895;
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  border: none;
  background: linear-gradient(140deg, #f3af50, #ef7f4c);
}

.shop-trigger-btn {
  border: none;
  background: linear-gradient(140deg, #37c7d9, #2b8fff);
  box-shadow: 0 4px 0 rgba(16, 56, 112, 0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}

.shop-trigger-btn:hover:not(:disabled) {
  background: linear-gradient(140deg, #4ad7e8, #4aa0ff);
  box-shadow: 0 6px 0 rgba(16, 56, 112, 0.55);
}

.shop-btn-icon {
  font-size: 2rem;
  line-height: 1;
}

.shop-notify-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(140deg, #ff6ca8, #ff8a57);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  border: 2px solid rgba(21, 35, 73, 0.95);
  box-shadow: 0 3px 0 rgba(88, 23, 52, 0.5);
}

.arena-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: 320px minmax(0, 1fr);
}

.player-panel {
  padding: 14px;
}

.shop-under-stats {
  width: 100%;
  margin-top: 10px;
}

.play-panel {
  display: grid;
  gap: 14px;
}

.settings-modal {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.settings-divider {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin: 4px 0 2px;
}

.settings-subtitle {
  margin: 2px 0 6px;
}

.panel-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.88;
}

.panel-ribbon {
  display: inline-block;
  background: linear-gradient(90deg, var(--teal), #38d8d4);
  color: #effdff;
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 4px 0 rgba(8, 67, 88, 0.5);
}

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

.stat {
  position: relative;
  background: #2f4374;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 40px 12px 12px;
  min-height: 92px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  box-shadow: none;
  cursor: help;
}

.stat::before {
  content: attr(data-glyph);
  position: absolute;
  left: 12px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 800;
  background: #5a73af;
  color: #fff;
  box-shadow: none;
}

.stat span {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.82;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.stat strong {
  font-size: 1.05rem;
  color: #fff;
  margin-left: 56px;
}

.stat::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 8px);
  background: #1f2e58;
  color: #f4f8ff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.78rem;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 7;
}

.stat:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.progress-card,
.typing-card {
  padding: 14px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 7px;
}

.progress-track {
  width: 100%;
  height: 16px;
  border-radius: 8px;
  background: #4a5f93;
  overflow: hidden;
  margin-bottom: 11px;
}

.progress-track.secondary {
  background: rgba(54, 184, 255, 0.2);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff6ca8, #f7488f);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.progress-track.secondary .progress-fill {
  background: linear-gradient(90deg, #64d2ff, #47edca);
}

.message {
  margin: 0;
  font-weight: 600;
  min-height: 24px;
  color: #f6fbff;
}

.sentence-display {
  margin: 12px 0;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #293d6f;
  font-size: clamp(1.02rem, 2.2vw, 1.32rem);
  line-height: 1.75;
  min-height: 130px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.char {
  transition: opacity 0.16s ease, color 0.16s ease;
}

.char.pending {
  opacity: 0.35;
}

.char.correct {
  opacity: 1;
  color: #8effb9;
}

.char.current {
  text-decoration: underline;
  text-decoration-color: #ffe66f;
  text-decoration-thickness: 2px;
}

.char.mistake {
  color: #ff8da9;
  animation: wobble 0.2s ease;
}

.input-wrap {
  display: flex;
  justify-content: center;
}

#typingInput {
  width: 116px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

#typingInput:focus {
  border-color: #ffe66f;
  box-shadow: 0 0 0 3px rgba(255, 230, 111, 0.2);
}

.hint {
  margin: 10px 0 0;
  font-size: 0.86rem;
  opacity: 0.88;
}

.typing-progress {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.shop-card {
  padding: 14px;
}

.shop-overlay {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgba(8, 12, 25, 0.74);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.shop-overlay.open {
  display: flex;
}

.shop-modal {
  width: min(1060px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 14px;
}

.shop-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.economy-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.eco-chip {
  background: #2f4374;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px;
  display: grid;
  gap: 4px;
  word-break: break-word;
}

.sentence-display.typing-effect-wave {
  box-shadow: 0 0 0 1px rgba(108, 215, 255, 0.35), 0 0 22px rgba(108, 215, 255, 0.2);
}

.sentence-display.typing-effect-prism {
  box-shadow: 0 0 0 1px rgba(215, 120, 255, 0.35), 0 0 26px rgba(255, 108, 168, 0.22);
}

.sentence-display.typing-effect-trail {
  box-shadow: 0 0 0 1px rgba(155, 233, 255, 0.45), 0 0 28px rgba(155, 233, 255, 0.24);
}

.eco-chip span {
  font-size: 0.68rem;
  text-transform: uppercase;
  opacity: 0.82;
}

.eco-chip strong {
  font-size: 1rem;
}

.loadout-hint {
  margin-top: 6px;
  opacity: 0.8;
}

.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.shop-rotation {
  margin: 0 0 10px;
  font-size: 0.82rem;
  opacity: 0.8;
}

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

.shop-item {
  background: #2d416f;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 7px;
}

.shop-item.owned {
  border-color: rgba(78, 227, 193, 0.55);
}

.shop-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.shop-item h4 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: capitalize;
}

.shop-item p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.85;
}

.shop-preview-box {
  position: relative;
  height: 54px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #253a68;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-preview-box.common {
  box-shadow: inset 0 0 0 1px rgba(122, 214, 255, 0.18);
}

.shop-preview-box.rare {
  box-shadow: inset 0 0 0 1px rgba(143, 147, 255, 0.25);
}

.shop-preview-box.epic {
  box-shadow: inset 0 0 0 1px rgba(215, 120, 255, 0.3);
}

.shop-preview-box.legendary {
  box-shadow: inset 0 0 0 1px rgba(255, 178, 94, 0.35);
}

.preview-tag {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.85;
}

.preview-theme {
  justify-content: flex-start;
  padding: 8px;
}

.preview-theme-palette {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.preview-effect .preview-char {
  font-weight: 800;
  font-size: 1rem;
  margin: 0 5px;
  color: #e8f4ff;
  animation: previewPulse 1.2s ease-in-out infinite;
}

.preview-effect .preview-char:nth-child(2) {
  animation-delay: 0.2s;
}

.preview-effect .preview-char:nth-child(3) {
  animation-delay: 0.4s;
}

.preview-effect.effect-v1 .preview-char {
  animation: previewSlide 1.35s ease-in-out infinite;
}

.preview-effect.effect-v2 .preview-char {
  animation: previewFlicker 1.1s steps(2, end) infinite;
}

.preview-effect-spark .spark-dot {
  width: 8px;
  height: 8px;
  margin: 0 5px;
  border-radius: 50%;
  background: #ffd36e;
  box-shadow: 0 0 8px rgba(255, 211, 110, 0.5);
  animation: previewPulse 1s ease-in-out infinite;
}

.preview-effect-spark .spark-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.preview-effect-spark .spark-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.preview-effect-wave .wave-bar {
  width: 6px;
  height: 20px;
  margin: 0 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #8ce9ff, #3fa8ff);
  animation: previewWaveBar 1.1s ease-in-out infinite;
}

.preview-effect-wave .wave-bar:nth-child(2) {
  animation-delay: 0.12s;
}

.preview-effect-wave .wave-bar:nth-child(3) {
  animation-delay: 0.24s;
}

.preview-effect-wave .wave-bar:nth-child(4) {
  animation-delay: 0.36s;
}

.preview-effect-prism .prism-shard {
  width: 0;
  height: 0;
  margin: 0 4px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 14px solid #d778ff;
  animation: previewPrism 1.2s ease-in-out infinite;
}

.preview-effect-prism .prism-shard:nth-child(2) {
  border-bottom-color: #36b8ff;
  animation-delay: 0.2s;
}

.preview-effect-prism .prism-shard:nth-child(3) {
  border-bottom-color: #ff6ca8;
  animation-delay: 0.4s;
}

.preview-effect-trail .trail-line {
  width: 24px;
  height: 4px;
  margin: 0 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), #9be9ff, rgba(255, 255, 255, 0.2));
  animation: previewTrail 1s ease-in-out infinite;
}

.preview-effect-trail .trail-line:nth-child(2) {
  animation-delay: 0.2s;
}

.preview-effect-trail .trail-line:nth-child(3) {
  animation-delay: 0.4s;
}

.shop-preview-box.preview-replay {
  animation: previewReplay 0.55s ease;
}

.preview-companion .preview-pet {
  font-size: 1.4rem;
  animation: previewBounce 1s ease-in-out infinite;
}

.preview-companion.companion-v1 .preview-pet {
  animation: previewSway 1.4s ease-in-out infinite;
}

.preview-companion.companion-v2 .preview-pet {
  animation: previewPulse 1.25s ease-in-out infinite;
}

.preview-knowledge .preview-scroll {
  font-size: 1.25rem;
  animation: previewPulse 1.6s ease-in-out infinite;
}

.preview-knowledge.knowledge-v1 .preview-scroll {
  animation: previewOrbit 1.9s ease-in-out infinite;
}

.preview-knowledge.knowledge-v2 .preview-scroll {
  animation: previewSlide 1.5s ease-in-out infinite;
}

.rarity {
  color: #112;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 7px;
}

.price-row {
  display: flex;
  gap: 10px;
  font-size: 0.82rem;
}

.owned-pill {
  display: inline-block;
  font-size: 0.76rem;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(78, 227, 193, 0.2);
  color: #9ff7e5;
}

.near-miss {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #45598a;
  overflow: hidden;
}

.near-miss-bar {
  height: 100%;
  background: linear-gradient(90deg, #f3af50, #ff6ca8);
}

.shop-item small {
  opacity: 0.78;
}

.shop-feedback {
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 10px;
  display: grid;
  gap: 4px;
}

.shop-feedback-title {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  opacity: 0.75;
}

.shop-feedback p {
  margin: 0;
}

.effects-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}

.debug-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(9, 6, 20, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.debug-overlay.open {
  display: flex;
}

.debug-modal {
  width: min(560px, 100%);
  padding: 18px;
}

.debug-modal h2 {
  margin: 0;
}

.debug-sub {
  margin: 6px 0 12px;
  font-size: 0.9rem;
  opacity: 0.8;
}

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

.debug-status {
  margin: 12px 0 0;
  font-size: 0.9rem;
  min-height: 20px;
  color: #ffe8a3;
}

.debug-footer {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.float-score,
.level-popup {
  position: absolute;
  font-weight: 800;
  animation: riseFade 800ms ease-out forwards;
}

.float-score {
  color: var(--orange);
}

.level-popup {
  color: #ffefb9;
  text-shadow: 0 0 8px rgba(255, 155, 66, 0.45);
  font-size: 1.55rem;
}

.particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: particleBurst 700ms ease-out forwards;
}

@keyframes floatOrb {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

@keyframes riseFade {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-34px) scale(1.08); }
}

@keyframes particleBurst {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.3); opacity: 0; }
}

@keyframes wobble {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-2px); }
  60% { transform: translateX(2px); }
}

@keyframes previewSweep {
  0% { transform: translateX(-35%); }
  100% { transform: translateX(35%); }
}

@keyframes previewPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes previewBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes previewSlide {
  0%, 100% { transform: translateY(0) scale(0.95); opacity: 0.62; }
  50% { transform: translateY(-2px) scale(1.1); opacity: 1; }
}

@keyframes previewFlicker {
  0%, 100% { opacity: 0.58; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes previewSway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

@keyframes previewOrbit {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(12deg); }
}

@keyframes previewWaveBar {
  0%, 100% { transform: scaleY(0.45); opacity: 0.65; }
  50% { transform: scaleY(1.15); opacity: 1; }
}

@keyframes previewPrism {
  0%, 100% { transform: translateY(1px) scale(0.9); opacity: 0.7; }
  50% { transform: translateY(-3px) scale(1.08); opacity: 1; }
}

@keyframes previewTrail {
  0%, 100% { transform: translateX(-2px); opacity: 0.45; }
  50% { transform: translateX(3px); opacity: 1; }
}

@keyframes previewReplay {
  0% { transform: scale(1); }
  40% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

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

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

  .hud-strip {
    width: 100%;
    justify-content: center;
  }

  .hud-economy {
    justify-content: center;
  }
}

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

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

  .controls-row {
    justify-content: center;
  }

  .game-header {
    justify-content: center;
  }

  .hud-strip {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hud-economy .eco-chip {
    min-width: 100px;
  }

  .sentence-display {
    min-height: 108px;
  }

  .shop-modal {
    max-height: 92vh;
  }

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

  .debug-actions {
    grid-template-columns: 1fr;
  }
}
