﻿/* =========================================================
   FIZIKA SZINTFELMÉRŐ - DESIGN SYSTEM & STYLESHEET
   ========================================================= */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(28, 38, 58, 0.95);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-focus: rgba(0, 210, 255, 0.5);
  
  --primary-cyan: #00d2ff;
  --primary-blue: #3a7bd5;
  --accent-purple: #8a2be2;
  --accent-gold: #ffb703;
  --success-green: #10b981;
  --danger-red: #ef4444;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-heading: 'Space Grotesk', 'Outfit', sans-serif;
  --font-body: 'Outfit', sans-serif;
  
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  
  --shadow-subtle: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(0, 210, 255, 0.25);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(58, 123, 213, 0.18) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(138, 43, 226, 0.15) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(0, 210, 255, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.6;
  padding-bottom: 100px;
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.page-header {
  padding: 28px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 28px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  background: var(--bg-card);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
}

.back-btn:hover {
  color: var(--primary-cyan);
  border-color: var(--primary-cyan);
  transform: translateX(-3px);
}

/* Hero & Title */
.hero-section {
  text-align: center;
  margin-bottom: 32px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #00d2ff 60%, #3a7bd5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* HUD / Status Counters */
.hud-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-subtle);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-icon {
  font-size: 26px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-cyan);
}

.stat-val.known { color: #10b981; }
.stat-val.review { color: #ffb703; }

.stat-lbl {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}

/* Filter Bar */
.controls-bar {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-input {
  width: 100%;
  padding: 11px 16px 11px 40px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.2);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-cyan);
  color: #060b13;
  border-color: var(--primary-cyan);
  font-weight: 700;
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.3);
}

/* Section Headings */
.section-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title .count-badge {
  font-size: 13px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  color: var(--primary-cyan);
}

/* Cards Grid */
.tasks-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 48px;
}

.task-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.task-card:hover {
  border-color: rgba(0, 210, 255, 0.35);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

/* Tudottnak jelölt feladatok: finoman elhalványulnak */
.task-card.status-known {
  border-color: rgba(16, 185, 129, 0.35) !important;
  border-left: 6px solid #10b981 !important;
  background: rgba(12, 18, 28, 0.55) !important;
  opacity: 0.42;
  filter: grayscale(0.3);
  box-shadow: none !important;
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.task-card.status-known:hover {
  opacity: 0.95;
  filter: grayscale(0);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

/* Átnézendőnek jelölt feladatok: kiemelkedően feltűnőek, meleg arany fénnyel */
.task-card.status-review {
  border-color: rgba(255, 183, 3, 0.8) !important;
  border-left: 7px solid #ffb703 !important;
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.1) 0%, rgba(22, 28, 44, 0.95) 100%) !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: 0 0 35px rgba(255, 183, 3, 0.22), 0 12px 35px rgba(0, 0, 0, 0.5) !important;
  transform: scale(1.008);
  transition: all 0.3s ease;
}

.task-card.status-review:hover {
  border-color: #ffb703 !important;
  box-shadow: 0 0 45px rgba(255, 183, 3, 0.35), 0 15px 40px rgba(0, 0, 0, 0.6) !important;
  transform: scale(1.012) translateY(-2px);
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.task-number-badge {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  color: var(--primary-cyan);
}

/* User Status Action Buttons (Tudom / Átnézendő) */
.task-status-actions {
  display: flex;
  gap: 8px;
}

.status-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.status-btn:hover {
  transform: translateY(-1px);
}

.status-btn.btn-known:hover,
.status-btn.btn-known.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}

.status-btn.btn-review:hover,
.status-btn.btn-review.active {
  background: rgba(255, 183, 3, 0.2);
  border-color: #ffb703;
  color: #fcd34d;
}

.task-question {
  font-size: 16.5px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 18px;
  line-height: 1.6;
}

/* Diagram Container with Crisp Pure White Background */
.task-diagram {
  margin: 18px 0;
  text-align: center;
  background: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
}

.task-diagram img {
  max-width: 100%;
  max-height: 280px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  filter: none !important;
  background: transparent;
}

/* Options Grid for Multiple Choice */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

@media (min-width: 768px) {
  .options-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.option-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: var(--transition);
}

.option-btn:hover:not(.disabled) {
  background: rgba(0, 210, 255, 0.1);
  border-color: var(--primary-cyan);
  transform: translateY(-2px);
}

.option-key {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.option-btn.selected-correct {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: var(--success-green) !important;
  color: #34d399;
}
.option-btn.selected-correct .option-key {
  background: var(--success-green);
  color: #060b13;
}

.option-btn.selected-wrong {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: var(--danger-red) !important;
  color: #f87171;
}
.option-btn.selected-wrong .option-key {
  background: var(--danger-red);
  color: #ffffff;
}

/* Accordion Explanation Box */
.explanation-box {
  display: none;
  background: rgba(0, 0, 0, 0.35);
  border-left: 4px solid var(--primary-cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px;
  margin-top: 16px;
  font-size: 15px;
  color: #e2e8f0;
  animation: fadeIn 0.3s ease;
}

.explanation-box.active {
  display: block;
}

.explanation-box p {
  margin-bottom: 12px;
}
.explanation-box p:last-child {
  margin-bottom: 0;
}

.result-badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  margin-top: 10px;
}

.result-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-toggle-expl {
  background: transparent;
  border: none;
  color: var(--primary-cyan);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}
.btn-toggle-expl:hover {
  text-decoration: underline;
}

/* Workout Tasks */
.workout-card {
  border-left: 4px solid var(--accent-purple);
}

.workout-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.subtask-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
}

.subtask-header {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary-cyan);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}

/* Interactive Simulation Modules */
.sim-container {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 210, 255, 0.25);
  border-radius: var(--radius-md);
  padding: 22px;
  margin: 18px 0;
  user-select: text !important;
}

.sim-title {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary-cyan);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.sim-slider-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sim-slider-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.sim-slider-group input[type="range"] {
  accent-color: var(--primary-cyan);
  cursor: pointer;
}

.sim-canvas {
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  display: block;
  background: #040810;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
  touch-action: pan-y;
}

/* Responsive Simulation Overrides for Mobile Devices */
@media (max-width: 768px) {
  .sim-container {
    padding: 16px 12px;
    margin: 14px 0;
  }

  .sim-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .sim-slider-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
  }

  .sim-slider-group input[type="range"] {
    flex: 1;
    min-width: 100px;
    height: 8px;
  }

  .sim-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .sim-stat-card {
    padding: 12px 14px;
  }

  .sim-stat-value {
    font-size: 14px;
  }

  .sim-comparison-banner {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Crisp Native HTML Stats & Comparison Cards for Simulations */
.sim-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  user-select: text !important;
}

.sim-stat-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  user-select: text !important;
}

.sim-stat-card.cyan-theme {
  border-color: rgba(0, 210, 255, 0.4);
  background: rgba(0, 210, 255, 0.06);
}

.sim-stat-card.gold-theme {
  border-color: rgba(255, 183, 3, 0.4);
  background: rgba(255, 183, 3, 0.06);
}

.sim-stat-card.green-theme {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
}

.sim-stat-title {
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cyan-theme .sim-stat-title { color: #00d2ff; }
.gold-theme .sim-stat-title { color: #ffb703; }
.green-theme .sim-stat-title { color: #34d399; }

.sim-stat-value {
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
  font-family: var(--font-heading);
}

.sim-stat-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.sim-comparison-banner {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--primary-cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.5;
  user-select: text !important;
}

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

/* =========================================================
   Próba ZH (Mock Exam) Styles
   ========================================================= */

.hidden {
  display: none !important;
}

.proba-zh-launch-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35) !important;
  padding: 8px 16px !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.proba-zh-launch-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5) !important;
}

.proba-zh-section {
  animation: fadeIn 0.3s ease;
}

.proba-zh-header-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.proba-zh-header-left {
  max-width: 650px;
}

.proba-zh-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.proba-zh-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.proba-zh-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.proba-zh-exit-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.proba-zh-exit-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
  color: #ffffff;
}

/* Option Selected during test (before submit) */
.option-btn.proba-selected {
  background: rgba(99, 102, 241, 0.3) !important;
  border-color: #818cf8 !important;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.5) !important;
}

.option-btn.proba-selected .option-key {
  background: #6366f1 !important;
  color: #ffffff !important;
}

/* Result Banner */
.proba-zh-result-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 2px solid var(--accent-cyan);
  border-radius: 20px;
  padding: 24px 28px;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(6, 182, 212, 0.25);
  animation: fadeIn 0.4s ease;
}

.proba-zh-result-score {
  font-size: 2.4rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.proba-zh-result-pct {
  font-size: 1.3rem;
  font-weight: 700;
  display: inline-block;
  padding: 4px 16px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.pct-high {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.pct-mid {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.pct-low {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

/* Submit Actions Bar */
.proba-zh-actions-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 32px 0 60px 0;
}

.btn-proba-zh-submit {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 16px 36px;
  border-radius: 18px;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-proba-zh-submit:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(16, 185, 129, 0.6);
}

.btn-proba-zh-restart {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  padding: 14px 28px;
  border-radius: 16px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-proba-zh-restart:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

/* =========================================================
   Bsz2-chan Surprised/Evaluative Mascot Reaction Pop-up
   ========================================================= */
.secret-mascot-reaction-container {
    position: fixed;
    right: 12px;
    bottom: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    transform: translateY(140px) scale(0.85);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.secret-mascot-reaction-container.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.secret-mascot-speech-bubble {
    position: relative;
    margin-right: 60px;
    margin-bottom: -25px;
    background: rgba(18, 14, 28, 0.96);
    border: 2.5px solid rgba(255, 117, 160, 0.85);
    border-radius: 22px 22px 6px 22px;
    padding: 18px 26px 18px 24px;
    max-width: 380px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 117, 160, 0.5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1055;
    animation: mascotBubbleFloat 3s ease-in-out infinite alternate;
}

.secret-mascot-speech-bubble p {
    margin: 0;
    color: #ffffff;
    font-size: 1.02rem;
    line-height: 1.55;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.mascot-speech-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.mascot-speech-close:hover {
    color: #ffffff;
}

.secret-mascot-speech-bubble .speech-bubble-tail {
    position: absolute;
    bottom: -12px;
    right: 36px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid rgba(255, 117, 160, 0.9);
}

@keyframes mascotBubbleFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-8px); }
}

/* Standard full-size mascot sprite (for normal & sad portraits <= 80%) */
.secret-mascot-sprite-box {
    position: relative;
    width: clamp(340px, 30vw, 520px);
    height: clamp(480px, 64vh, 760px);
    filter: drop-shadow(0 20px 45px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 35px rgba(255, 117, 160, 0.5));
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    z-index: 1050;
}

/* Compact scaled mascot sprite for the wide 032 celebration image (81-100%) */
.secret-mascot-reaction-container.mascot-size-compact .secret-mascot-sprite-box {
    width: clamp(230px, 20vw, 340px);
    height: clamp(320px, 44vh, 490px);
}

.secret-mascot-sprite-box .mascot-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: bottom right;
    pointer-events: none;
    display: block;
}

@media (max-width: 1024px) {
    .secret-mascot-reaction-container {
        right: 8px;
    }
    .secret-mascot-sprite-box {
        width: clamp(280px, 32vw, 400px);
        height: clamp(380px, 52vh, 560px);
    }
    .secret-mascot-reaction-container.mascot-size-compact .secret-mascot-sprite-box {
        width: clamp(190px, 24vw, 270px);
        height: clamp(260px, 36vh, 380px);
    }
    .secret-mascot-speech-bubble {
        max-width: 320px;
        margin-right: 20px;
        font-size: 0.9rem;
    }
    .secret-mascot-reaction-container.mascot-size-compact .secret-mascot-speech-bubble {
        max-width: 290px;
        margin-right: 15px;
        font-size: 0.88rem;
    }
}
