:root {
  --ink: #1e293b;
  --bg: #f0fdf4;
  --surface: #ffffff;
  --line: #dcfce7;
  --green-main: #10b981;
  --green-dark: #065f46;
  --blue-zone: #3b82f6;
  --green-zone: #10b981;
  --yellow-zone: #f59e0b;
  --red-zone: #ef4444;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Lexend", system-ui, sans-serif;
  --shadow: 0 10px 25px rgba(16, 185, 129, 0.08);
  --shadow-hover: 0 16px 36px rgba(16, 185, 129, 0.16);
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: #064e3b;
  color: #fff;
  padding: 0.9rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 3px solid #34d399;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: #fff;
}

.brand-icon {
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.4rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #a7f3d0;
  letter-spacing: -0.01em;
}

.brand p {
  font-size: 0.8rem;
  color: #d1fae5;
}

.controls-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tab-pills {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.25rem;
  border-radius: 999px;
  gap: 0.3rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #d1fae5;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.tab-btn.active {
  background: #34d399;
  color: #064e3b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-header {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}

.btn-header:hover {
  background: rgba(255, 255, 255, 0.25);
}

.game-container {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.2rem;
  width: 100%;
  flex: 1;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-intro {
  margin-bottom: 1.5rem;
}

.section-intro h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--green-dark);
}

.section-desc {
  color: #4b5563;
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

/* ================== TAB 1: FEELINGS WHEEL ================== */
.wheel-stage {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
}

.wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  margin: 0 auto;
}

.feelings-wheel-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.08));
}

.wheel-slice {
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
  transform-origin: 250px 250px;
}

.wheel-slice:hover {
  transform: scale(1.03);
  filter: brightness(1.1);
}

.wheel-slice.active {
  stroke: #ffffff;
  stroke-width: 3px;
  filter: brightness(1.15) drop-shadow(0 0 8px rgba(0,0,0,0.2));
}

.wheel-slice text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  fill: #ffffff;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.wheel-center-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110px;
  height: 110px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  border: 4px solid #f0fdf4;
}

#center-hub-emoji {
  font-size: 2.2rem;
}

#center-hub-text {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--green-dark);
}

.emotion-card {
  background: var(--surface);
  border: 2px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.zone-badge {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.badge-green { background: #dcfce7; color: #15803d; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-yellow { background: #fef3c7; color: #b45309; }
.badge-red { background: #fee2e2; color: #b91c1c; }

.emotion-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.emotion-emoji {
  font-size: 3.2rem;
  background: #f0fdf4;
  padding: 0.4rem;
  border-radius: 16px;
  border: 1px solid #dcfce7;
}

.emotion-header h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--green-dark);
  line-height: 1.1;
}

.emotion-en {
  font-size: 1rem;
  color: #64748b;
  font-weight: 600;
}

.card-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.section-tag {
  font-size: 0.82rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-section p {
  font-size: 0.95rem;
  color: #334155;
}

.strategy-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: var(--radius-md);
  padding: 1rem;
}

.strategy-box .section-tag {
  color: #166534;
}

/* ================== TAB 2: ZONES OF REGULATION ================== */
.zones-hud {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-top: 0.8rem;
  background: #ffffff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid #bbf7d0;
  flex-wrap: wrap;
}

.hud-item {
  font-weight: 700;
  color: #334155;
}

.hud-item span {
  color: var(--green-dark);
  font-size: 1.2rem;
}

.card-prompter-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.8rem;
}

.prompt-card {
  background: #ffffff;
  border: 2px solid #86efac;
  border-radius: var(--radius-lg);
  padding: 1.4rem 2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  max-width: 500px;
  width: 100%;
}

.prompt-emoji {
  font-size: 3rem;
}

.prompt-info h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--green-dark);
}

.prompt-info p {
  color: #64748b;
  font-size: 0.9rem;
}

.zones-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

.zone-target {
  background: #ffffff;
  border: 3px dashed;
  border-radius: var(--radius-lg);
  padding: 1.2rem 1rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.zone-target:hover {
  transform: translateY(-4px);
}

.zone-blue { border-color: var(--blue-zone); background: #f0f7ff; }
.zone-blue .zone-title { color: #1e40af; }

.zone-green { border-color: var(--green-zone); background: #f0fdf4; }
.zone-green .zone-title { color: #166534; }

.zone-yellow { border-color: var(--yellow-zone); background: #fffbeb; }
.zone-yellow .zone-title { color: #92400e; }

.zone-red { border-color: var(--red-zone); background: #fef2f2; }
.zone-red .zone-title { color: #991b1b; }

.zone-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
}

.zone-sub {
  font-size: 0.75rem;
  text-align: center;
  color: #64748b;
  margin-bottom: 0.8rem;
}

.zone-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.sorted-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* ================== TAB 3: MINDFUL BREATHING ================== */
.breath-nav {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.breath-btn {
  background: #ffffff;
  border: 1.5px solid #86efac;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--green-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.breath-btn.active {
  background: var(--green-dark);
  color: #ffffff;
  border-color: var(--green-dark);
}

.breathing-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.breathing-circle-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.35) 0%, rgba(52, 211, 153, 0) 70%);
  transform: scale(0.8);
  transition: transform 4s cubic-bezier(0.4, 0, 0.2, 1);
}

.breathing-bubble {
  width: 190px;
  height: 190px;
  background: linear-gradient(135deg, #34d399, #059669);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 12px 36px rgba(5, 150, 105, 0.35);
  transform: scale(0.85);
  transition: transform 4s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  padding: 1rem;
}

.breathing-bubble.inhale {
  transform: scale(1.3);
}

.breathing-bubble.exhale {
  transform: scale(0.8);
}

.breathing-bubble.hold {
  transform: scale(1.3);
  filter: brightness(1.1);
}

.breath-instruction {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
}

.breath-count {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin: 0.2rem 0;
}

.breath-sub {
  font-size: 0.78rem;
  opacity: 0.9;
}

.breathing-controls {
  display: flex;
  gap: 1rem;
  margin-top: 3rem;
}

.btn-large {
  font-size: 1.05rem;
  padding: 0.75rem 1.8rem;
}

/* ================== TAB 4: PROBLEM SOLVER ================== */
.solver-hud {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.8rem;
  background: #ffffff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid #bbf7d0;
  max-width: fit-content;
}

.solver-stage {
  max-width: 780px;
  margin: 0 auto;
}

.scenario-card {
  background: #ffffff;
  border: 2px solid #86efac;
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.scenario-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.scenario-icon {
  font-size: 2.6rem;
  background: #f0fdf4;
  padding: 0.5rem;
  border-radius: 14px;
}

.scenario-header h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--green-dark);
}

.scenario-sub {
  font-size: 0.9rem;
  color: #64748b;
}

.scenario-desc {
  font-size: 1.05rem;
  color: #334155;
  background: #f8fafc;
  padding: 1rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--green-main);
}

.solver-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.scenario-opt-btn {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.scenario-opt-btn:hover {
  background: #f0fdf4;
  border-color: var(--green-main);
  transform: translateX(4px);
}

.scenario-opt-btn.best {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #14532d !important;
}

.scenario-opt-btn.suboptimal {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
  color: #92400e !important;
}

.solver-reflection {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: var(--radius-md);
  padding: 1.1rem;
  font-size: 0.95rem;
  color: #166534;
  line-height: 1.4;
}

.solver-footer {
  display: flex;
  justify-content: flex-end;
}

.btn-action {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 800;
  background: var(--green-dark);
  color: #fff;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action:hover {
  background: #044232;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--green-dark);
  border: 2px solid #86efac;
}

.btn-secondary:hover {
  background: #f0fdf4;
}

@media (max-width: 900px) {
  .wheel-stage {
    grid-template-columns: 1fr;
  }
  .zones-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 550px) {
  .zones-grid {
    grid-template-columns: 1fr;
  }
}
