@import '../../shared/styles/tokens.css';
@import '../../shared/styles/base.css';

/* ── Custom Theme Colors for Thought Untangler (matches shared dark app theme) ── */
:root {
  --color-accent-teal: hsl(175, 75%, 50%);
  --color-accent-teal-glow: hsla(175, 75%, 50%, 0.4);
  --color-glass-bg: hsla(230, 28%, 10%, 0.55);
  --color-glass-border: hsla(220, 20%, 50%, 0.12);
  --color-glass-hover: hsla(220, 20%, 50%, 0.22);
}

/* ── Fullscreen Setup & Screens ── */
body {
  background-color: var(--color-bg-deep);
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#physics-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.mute-btn {
  position: absolute;
  top: max(env(safe-area-inset-top), 1.25rem);
  right: 1.25rem;
  z-index: 100;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}@media (hover: hover) and (pointer: fine) {

.mute-btn:hover {
  background: var(--color-glass-hover);
  transform: scale(1.05);
}
}
.mute-btn:active {
  transform: scale(0.95);
}
.mute-btn svg {
  transition: opacity 0.2s ease;
}
.is-hidden {
  display: none !important;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms var(--ease-out-expo), transform 600ms var(--ease-out-expo);
  transform: scale(0.97) translateY(10px);
}
.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.scr-inner {
  width: 100%;
  max-width: 520px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 5vw, 2.5rem);
  padding-top: max(env(safe-area-inset-top), clamp(1.25rem, 5vw, 2rem));
  padding-bottom: max(env(safe-area-inset-bottom), clamp(1.25rem, 5vw, 2rem));
  overflow-y: auto;
  position: relative;
  z-index: 10;
}

.scr-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-4);
  flex-shrink: 0;
}

.nav-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}@media (hover: hover) and (pointer: fine) {

.nav-back:hover {
  background: var(--color-glass-hover);
  transform: translateX(-2px);
}
}

/* ── Intro Screen Styles ── */
.intro-hero {
  text-align: center;
  margin-bottom: var(--space-6);
  flex-shrink: 0;
}
.intro-icon-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.intro-emoji {
  font-size: 2.2rem;
  z-index: 3;
}
.intro-icon-ring {
  position: absolute;
  border: 1px solid var(--color-accent-teal-glow);
  border-radius: 50%;
  animation: spinRing 20s linear infinite;
}
.ring-outer { width: 80px; height: 80px; animation-duration: 25s; opacity: 0.2; }
.ring-middle { width: 64px; height: 64px; animation-duration: 15s; animation-direction: reverse; opacity: 0.4; }
.ring-inner { width: 48px; height: 48px; opacity: 0.6; }

.intro-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #fff 30%, var(--color-accent-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.intro-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 38ch;
  margin: 0 auto;
  line-height: 1.5;
}

/* Tab controls */
.input-tabs {
  display: flex;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-glass-border);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  flex-shrink: 0;
}
.tab-btn {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: calc(var(--radius-md) - 3px);
  color: var(--color-text-muted);
  transition: all 0.2s ease;
}
.tab-btn.active {
  background: var(--color-glass-hover);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  display: none;
  flex-direction: column;
  flex: 1;
}
.tab-panel.active {
  display: flex;
}

/* Custom thought textarea */
.input-group {
  position: relative;
  margin-bottom: var(--space-5);
  flex-shrink: 0;
}
.thought-textarea {
  width: 100%;
  height: 120px;
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  resize: none;
  outline: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.thought-textarea:focus {
  border-color: var(--color-accent-teal);
  box-shadow: 0 0 12px rgba(175, 255, 240, 0.15);
}
.textarea-counter {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 0.7rem;
  color: var(--color-text-dim);
}

/* Always-visible limitations note under the custom-thought textarea —
   quiet and matter-of-fact, styled like the other muted hints. */
.custom-limits-note {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  line-height: 1.5;
  margin: var(--space-2) 0 var(--space-4);
}

/* Practice Scenarios List */
.scenario-prompt-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.scenarios-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  max-height: 180px;
  margin-bottom: var(--space-5);
  padding-right: 4px;
}
/* Scrollbar stylings */
.scenarios-list::-webkit-scrollbar,
.scr-inner::-webkit-scrollbar {
  width: 6px;
}
.scenarios-list::-webkit-scrollbar-thumb,
.scr-inner::-webkit-scrollbar-thumb {
  background: var(--color-glass-border);
  border-radius: var(--radius-full);
}

.scenario-card {
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}@media (hover: hover) and (pointer: fine) {

.scenario-card:hover {
  background: var(--color-glass-hover);
  border-color: hsla(175, 75%, 50%, 0.25);
  transform: translateY(-1px);
}
}
.scenario-card.selected {
  border-color: var(--color-accent-teal);
  background: hsla(175, 75%, 50%, 0.08);
}
.sc-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sc-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: #fff;
}
.sc-desc {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.sc-badge {
  font-size: 0.65rem;
  color: var(--color-accent-teal);
  background: hsla(175, 75%, 50%, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.begin-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--color-accent-teal) 0%, hsl(195, 80%, 45%) 100%);
  color: hsl(230, 35%, 7%);
  font-weight: 600;
  font-size: var(--text-base);
  padding: 0.9rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(175, 255, 240, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}@media (hover: hover) and (pointer: fine) {

.begin-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(175, 255, 240, 0.4);
  filter: brightness(1.05);
}
}
.begin-btn:not(:disabled):active {
  transform: translateY(0);
}
.begin-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.intro-science {
  margin-top: auto;
  padding-top: var(--space-8);
  text-align: center;
  flex-shrink: 0;
}
.science-text {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 4px;
}
.science-citation {
  font-size: 0.62rem;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Play (Untangling) Layout ── */
.play-layout {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
  z-index: 10;
}

.play-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--color-glass-border);
  background: hsla(230, 35%, 7%, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.hud-center {
  flex: 1;
  text-align: center;
}
.hud-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}
.hud-tension {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.tension-label {
  font-size: 0.7rem;
  color: rgba(255, 150, 150, 0.85);
  font-weight: 500;
}
.tension-value {
  font-size: 0.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: rgb(255, 120, 120);
}
.tension-value.relieved {
  color: var(--color-accent-teal);
}
.hud-tension:has(.relieved) {
  background: rgba(175, 255, 240, 0.1);
  border-color: rgba(175, 255, 240, 0.2);
}

.play-workspace {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

.instruction-banner {
  padding: var(--space-3) var(--space-4);
  text-align: center;
  background: hsla(230, 28%, 10%, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-glass-border);
  z-index: 20;
}
.instruction-banner p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
  max-width: 48ch;
  margin: 0 auto;
}

@keyframes matchPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* ── Quiz Mode (preset scenarios) ── */
.quiz-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-4);
  justify-content: center;
  overflow-y: auto;
}
.quiz-thought-display {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-muted);
  text-align: center;
  max-width: 46ch;
  margin: 0 auto;
}
.quiz-highlight {
  color: #fff;
  background: rgba(175, 255, 240, 0.12);
  border-radius: 4px;
  padding: 0 4px;
  box-shadow: 0 0 12px var(--color-accent-teal-glow);
  font-style: normal;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}
.quiz-option-btn {
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  text-align: left;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s var(--ease-out-expo);
}@media (hover: hover) and (pointer: fine) {

.quiz-option-btn:hover:not(:disabled) {
  background: var(--color-glass-hover);
  transform: translateY(-1px);
}
}
.quiz-option-btn .opt-emoji {
  font-size: 1.2rem;
  flex-shrink: 0;
}
.quiz-option-btn.is-correct {
  border-color: var(--color-accent-teal);
  background: rgba(175, 255, 240, 0.12);
  box-shadow: 0 0 15px var(--color-accent-teal-glow);
  animation: matchPop 0.4s var(--ease-bounce);
}
.quiz-option-btn.is-incorrect {
  border-color: rgb(255, 120, 120);
  background: rgba(255, 100, 100, 0.12);
}
.quiz-option-btn:disabled {
  cursor: default;
  opacity: 0.85;
}
.quiz-explanation {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.5;
  max-width: 40ch;
  margin: 0 auto;
}

/* ── Reflect Mode (custom thoughts) ── */
.reflect-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-4);
  justify-content: center;
  overflow-y: auto;
}
.reflect-thought-display {
  font-size: var(--text-base);
  color: #fff;
  font-style: italic;
  text-align: center;
  line-height: 1.6;
  max-width: 46ch;
  margin: 0 auto;
}
.reflect-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
}
.reflect-chip {
  padding: 9px 16px;
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}@media (hover: hover) and (pointer: fine) {

.reflect-chip:hover {
  background: var(--color-glass-hover);
}
}
.reflect-chip.is-selected {
  border-color: var(--color-accent-teal);
  background: rgba(175, 255, 240, 0.12);
  box-shadow: 0 0 12px var(--color-accent-teal-glow);
}

/* ── Screen Reframe Styles ── */
.reframe-inner {
  max-width: 480px;
}
.reframe-card {
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  flex: 1;
}

.reframe-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-dim);
  font-weight: 600;
  display: block;
  margin-bottom: var(--space-2);
}

.original-thought-display {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  line-height: 1.4;
  margin-bottom: var(--space-3);
}

.identified-distortions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.distortion-badge {
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.reframe-guideline {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  line-height: 1.4;
}

.reframe-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-3);
}
.starter-chip {
  padding: 6px 12px;
  font-size: 0.72rem;
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  transition: all 0.2s ease;
}@media (hover: hover) and (pointer: fine) {

.starter-chip:hover,
.starter-chip:active {
  background: var(--color-glass-hover);
  color: #fff;
  border-color: var(--color-accent-teal);
}
}

.reframe-textarea-wrapper {
  position: relative;
  width: 100%;
}
.reframe-textarea {
  height: 130px;
}

/* ── Screen Release (Breathing Animation) ── */
.release-inner {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.release-breathing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
}
.release-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: #fff;
}
.release-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 32ch;
  line-height: 1.5;
}

.breath-indicator {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-4) 0;
}
.breath-ring {
  position: absolute;
  border: 1px solid var(--color-accent-teal);
  border-radius: 50%;
  inset: 0;
  opacity: 0.1;
  transition: transform 3.5s ease-in-out, opacity 3.5s ease-in-out;
}
.breath-ring.ring-1 { transform: scale(0.35); }
.breath-ring.ring-2 { transform: scale(0.55); border-color: hsl(195, 80%, 45%); }
.breath-ring.ring-3 { transform: scale(0.75); border-color: hsl(270, 75%, 65%); }

.breath-label {
  font-family: var(--font-display);
  font-size: var(--text-md);
  color: #fff;
  font-weight: 500;
  z-index: 2;
  letter-spacing: -0.01em;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

/* Expand & Contract breathing animations */
.breath-indicator.inhale .breath-ring.ring-1 { transform: scale(1); opacity: 0.55; box-shadow: 0 0 20px var(--color-accent-teal-glow); }
.breath-indicator.inhale .breath-ring.ring-2 { transform: scale(1.12); opacity: 0.35; box-shadow: 0 0 30px rgba(0, 180, 255, 0.2); }
.breath-indicator.inhale .breath-ring.ring-3 { transform: scale(1.24); opacity: 0.15; box-shadow: 0 0 40px rgba(175, 255, 240, 0.1); }

.breath-indicator.exhale .breath-ring.ring-1 { transform: scale(0.35); opacity: 0.1; }
.breath-indicator.exhale .breath-ring.ring-2 { transform: scale(0.45); opacity: 0.08; }
.breath-indicator.exhale .breath-ring.ring-3 { transform: scale(0.55); opacity: 0.05; }

.breathing-timer {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
}
.breathing-timer span {
  font-weight: 600;
  color: var(--color-text-muted);
}

/* ── Screen Complete Styles ── */
.complete-inner {
  max-width: 480px;
  justify-content: center;
}
.complete-hero {
  text-align: center;
  margin-bottom: var(--space-6);
}
.success-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(175, 255, 240, 0.12);
  border: 1px solid var(--color-accent-teal);
  color: var(--color-accent-teal);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  box-shadow: 0 0 25px rgba(175, 255, 240, 0.15);
}
.complete-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.complete-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 34ch;
  margin: 0 auto;
  line-height: 1.4;
}

.summary-card {
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.summary-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
  font-weight: 600;
}
.summary-text {
  font-size: var(--text-sm);
  line-height: 1.4;
}
.summary-text.before {
  color: var(--color-text-muted);
  text-decoration: line-through;
  opacity: 0.7;
}
.summary-text.after {
  color: #fff;
  font-weight: 500;
}
.summary-divider {
  height: 1px;
  background: var(--color-glass-border);
}

.progression-box {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  background: rgba(175, 255, 240, 0.06);
  border: 1px solid rgba(175, 255, 240, 0.12);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}
.progression-icon {
  font-size: 1.6rem;
}
.progression-details h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}
.progression-details p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.next-suggestion {
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--color-accent-teal);
  text-align: center;
  margin-bottom: var(--space-4);
}
.next-suggestion:empty { display: none; }

.complete-footer-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.btn-primary {
  width: 100%;
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  color: #fff;
  font-weight: 500;
  font-size: var(--text-sm);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}@media (hover: hover) and (pointer: fine) {

.btn-primary:hover {
  background: var(--color-glass-hover);
  border-color: var(--color-accent-teal);
  transform: translateY(-1px);
}
}
.btn-ghost {
  width: 100%;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  padding: 0.85rem;
  text-align: center;
  transition: color 0.2s ease;
}@media (hover: hover) and (pointer: fine) {

.btn-ghost:hover {
  color: #fff;
}
}

/* Loader style */
.screen-loading {
  z-index: 999;
  background: var(--color-bg-deep);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(175, 255, 240, 0.1);
  border-top-color: var(--color-accent-teal);
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}
.loading-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}
@keyframes spinRing {
  to { transform: rotate(360deg); }
}

/* ── Gentle support panel ──
   Shown when a typed thought sounds heavier than a game should carry.
   Deliberately calm: same glass/teal language as the rest of the game,
   never red, never alarming. */
.support-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: hsla(230, 35%, 5%, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.support-overlay.is-hidden {
  display: none;
}
.support-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-glass-bg);
  border: 1px solid var(--color-accent-teal-glow);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  box-shadow: 0 0 60px hsla(175, 75%, 50%, 0.12);
}
.support-glow {
  font-size: 1.8rem;
  margin-bottom: var(--space-3);
}
.support-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}
.support-body {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}
.support-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.support-link {
  display: block;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  color: var(--color-accent-teal);
  font-size: var(--text-sm);
  transition: background 0.2s ease, border-color 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .support-link:hover {
    background: var(--color-glass-hover);
    border-color: var(--color-accent-teal);
  }
}
.support-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Quiet end-screen support link — even more muted than the other ghosts */
.support-footer-link {
  font-size: var(--text-xs);
  opacity: 0.75;
}
