/* Reset and base */
html, body {
  height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  background: #f1f5f9; /* soft slate */
}

.page {
  position: relative;
  overflow-x: hidden;
  height: 100vh;
}

/* Top panel with help button and scenario buttons */
.top-panel {
  height: 45px;
  background: #f4f4f4;
  border-bottom: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  box-sizing: border-box;
}

.help-btn {
  padding: 6px 12px;
  cursor: pointer;
  background: #fff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.help-btn:hover {
  background: #f8fafc;
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.help-btn::before {
  content: "❓";
  margin-right: 6px;
}

.scenario-buttons {
  display: flex;
  gap: 8px;
}

.scenario-btn {
  font-size: 13px;                 /* smaller font */
  font-weight: 600;
  padding: 6px 14px;               /* tighter vertical space */
  border-radius: 20px;             /* pill shape */
  border: 1px solid #d0d7de;
  background: linear-gradient(to bottom, #ffffff, #f4f6f8);
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

/* Hover */
.scenario-btn:hover {
  background: linear-gradient(to bottom, #ffffff, #e6eef8);
  border-color: #9fb3c8;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

/* Active click */
.scenario-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Selected scenario */
.scenario-btn.active {
  background: linear-gradient(to bottom, #2c6fd6, #1e4ea8);
  color: #ffffff;
  border-color: #1e4ea8;
  box-shadow: 
      0 4px 10px rgba(30, 78, 168, 0.25),
      inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-1px);
}


/* Main bottom container with regex panel and image */
.main-bottom-container {
  display: flex;
  gap: 20px;
  margin: 5px 10px 20px 30px;
  box-sizing: border-box;
  max-width: 1500px;
  width: calc(100% - 40px);
  height: 95vh;
  justify-content: space-between; /* spread children to edges */
}



/* Regex panel */
.regex-panel {
  flex: 1.7 1 0;
  flex-grow: 3; /* or higher */
  min-width: 750px;
  max-width: 800px;
  overflow-y: auto;
  padding-left: 0;
  box-sizing: border-box;
}

/* Regex labels and inputs */
.regex-panel label {
  display: block;
  margin-top: 8px;
  font-weight: 600;
  font-size: 14px;
}

.regex-panel input,
.regex-panel textarea {
  width: 100%;
  padding: 8px;
  margin-top: 6px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  box-sizing: border-box;
  font-size: 12px;
  font-family: Consolas, "Courier New", monospace;
  transition: border 0.2s, box-shadow 0.2s;
}

.regex-panel input:focus,
.regex-panel textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

/* Regex pattern and flags side-by-side row */
.regex-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: nowrap;
}

.regex-pattern {
  flex: 3 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.regex-flags {
  flex: 1 1 0;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  margin-top: 24px; /* align label with pattern input */
}

/* Smaller label inside flags label */
.regex-flags label .small-label {
  margin-left: 6px;
  font-size: 11px;
  color: #666;
  font-weight: normal;
  display: inline-block;
}

/* Regex inputs full width */
.regex-pattern input,
.regex-flags input {
  width: 100%;
  font-family: Consolas, "Courier New", monospace;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
}

/* Regex panel button styling */
.regex-panel button {
  margin-top: 10px;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  background: #2563eb;
  color: white;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.regex-panel button:hover {
  background: #1e40af;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37,99,235,0.45);
}

.regex-panel button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(37,99,235,0.35);
}

/* Story visual container for image */
.story-visual {
  width: 500px;
  height: 450px;
  flex: 0 0 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  margin-right: 25px;
  border-radius: 14px;

  /* Transparent background */
  background: transparent;

  /* Optional subtle placeholder frame */
  border: 1px solid #e5e7eb;
}




/* Image inside visual container */

.story-visual img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 14px;
  transition: opacity 0.3s ease;
}


.story-visual img.fade-out {
  opacity: 0;
  filter: blur(4px);
}

/* Title overlay on top of image */
.visual-title {
  position: absolute;
  top: 10px;
  left: 20px;
  z-index: 5;

  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;

  color: rgba(255, 255, 255, 0.9);
  background: rgba(15, 23, 42, 0.6);
  padding: 8px 18px;
  border-radius: 12px;

  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

/* Story board panel */
.story-board {
  background: #fbf1c7; /* light vintage paper */
  color: #4b3b2b;      /* warm ink color */
  padding: 20px;
  box-sizing: border-box;
  min-height: 260px;
  border-radius: 8px;  /* soften edges like a page */
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);  
}

.story-board-inner {
  background: #fbf1c7 url('https://www.transparenttextures.com/patterns/pw-pattern.png') repeat;
  color: #4b3b2b;
  /*
  background: linear-gradient(180deg, #0f172a, #020617);
  padding: 22px 26px;
  */
  color: #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.story-board-inner strong {
  background: transparent; /* remove dark gradient */
  color: #4b3b2b;
  display: block;
  font-size: 20px;
  color: #38bdf8;
  margin-bottom: 12px;
  border-radius: 8px;
}

.story-content p,
.story-board-inner p {
  font-size: 16px;
  line-height: 1.7;
}

/* Scenario pill */
.scenario-pill {
  background: rgba(56,189,248,0.15);
  color: #38bdf8;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Scenario header */
.scenario-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.scenario-header strong {
  font-size: 22px;
  font-weight: 700;
  color: #e5e7eb;
}

/* Scenario insight box */
.scenario-insight {
  margin-top: 20px;
  padding-left: 14px;
  border-left: 3px solid #38bdf8;
}

.scenario-insight strong {
  display: block;
  font-size: 12px;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.scenario-insight p {
  font-size: 14px;
  color: #e5e7eb;
  margin-bottom: 10px;
}

/* Text area for output */
/*
#text {
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.6;
  padding: 12px;
  background-image: linear-gradient(to bottom, #f9f9f9 50%, #ffffff 50%);
  background-size: 100% 2.4em;
  border: 2px solid #ccc;
  border-radius: 8px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  color: #111;
  white-space: pre-wrap;
  overflow-y: auto;
  user-select: text;
  min-height: 160px;
  box-sizing: border-box;
}
*/
#text {
  max-height: 350px;
  overflow-y: auto;

  padding: 22px 26px;

  background: #faf9f6; /* subtle paper tone */
  border: 1px solid #e3e0d8;
  border-radius: 12px;

  font-family: "Georgia", "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.7;
  color: #2b2b2b;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    0 3px 8px rgba(0,0,0,0.04);
}

.dropcap {
  float: left;
  font-size: 42px;
  line-height: 0.9;
  padding-right: 8px;
  font-weight: bold;
}

#text {
  background-image:
    radial-gradient(rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 4px 4px;
}


.success { color: rgb(56, 139, 56); }
.error { color: red; }

.help-overlay {
  background: #fbf1c7;  /* light vintage paper color */
  color: #4b3b2b;       /* dark warm brown text for that old ink feel */
  box-shadow: -4px 0 12px rgba(0,0,0,0.1);

  position: absolute;
  top: 60px;    /* below top panel */
  right: 0;
  bottom: 0;    /* added to stretch to bottom */
  width: 525px;
  height: auto; /* let top & bottom control height */
  /*background: white;*/
  /*box-shadow: -4px 0 12px rgba(0,0,0,0.1);*/
  padding: 20px;
  box-sizing: border-box;

  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 9999;
  overflow-y: auto;
  display: block;
}


.help-overlay.open {
  transform: translateX(0); /* Slide in */
}

.match {
  background: linear-gradient(
    to bottom,
    rgba(255, 225, 120, 0.6),
    rgba(255, 200, 0, 0.6)
  );
  padding: 2px 4px;
  border-radius: 4px;
}

/* Overlay controls on image */
.image-overlay-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.overlay-btn {
  position: absolute;
  bottom: 16px;
  padding: 8px 14px;
  border-radius: 20px;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  backdrop-filter: blur(6px);
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.overlay-btn.right { right: 16px; }
.overlay-btn.left  { left: 16px; }

.overlay-btn.hidden {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

/* Text overlay on image */
.image-overlay-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 28px;
  box-sizing: border-box;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  overflow-y: auto;
}


.image-overlay-content.show {
  opacity: 1;
  pointer-events: auto;
}

/* Dim image when overlay visible */
.story-visual.overlay-active img {
  filter: blur(3px) brightness(0.85);
}

.image-overlay-content a {
  color: #2563eb;
  text-decoration: underline;
  font-weight: 500;
}
.bg-gif {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
  opacity: 0.95;
}

/* Hero container */
.under-dev-hero {
  height: 80vh;                 /* <-- 80% of screen */
  display: flex;                /* <-- CENTERING MAGIC */
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8fafc;          /* optional soft backdrop */
}

.under-dev-gif {
  width: 100%;
  height: 100%;
  max-width: 80vw;
  max-height: 80vh;

  object-fit: contain;          /* no cropping */
  display: block;
}
/*----*/

.help-header {
  margin-bottom: 28px;
}

.help-pill {
  display: inline-block;
  background: rgba(56,189,248,0.15);
  color: #0284c7;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.help-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 6px 0 8px;
}

.help-subtitle {
  font-size: 16px;
  line-height: 1.6;
  color: #5c4a32;
}
.help-section {
  background: rgba(255,255,255,0.55);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.help-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#readMoreBtn {
  font-family: 'Georgia', 'Times New Roman', serif;
  background-color: #f5f0e6;    /* light parchment */
  color: #5a3e1b;               /* dark sepia brown */
  border: 1.5px solid #cbbf9f; /* soft gold-ish border */
  padding: 8px 18px;
  border-radius: 8px;
  box-shadow: 2px 2px 5px rgba(150, 120, 80, 0.3);
  cursor: pointer;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-shadow: 1px 1px 0 #fff9e6;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
  margin-top: 12px;
  display: inline-block;
}

#readMoreBtn:hover {
  background-color: #e6dcc7;
  color: #3e2f12;
  box-shadow: 3px 3px 7px rgba(130, 100, 60, 0.5);
  text-decoration: underline;
}
.scenario-message {
  margin-top: 8px;
  font-size: 0.9em;
  color: #555;
  font-style: italic;
  text-align: center;
  user-select: none;
  opacity: 0.8;
}

.scenario-message {
  font-size: 0.9em;
  opacity: 0.8;
  font-style: italic;
}


/* Style the dynamic output block like a certificate */
.result {
  background: #eff4ef;
  border: 3px solid #cbd0cb;   /* ← ORANGE BORDER */
  box-shadow: 0 0 15px rgba(245, 166, 35, 0.5);
  border-radius: 12px;
  padding: 10px;
  margin-top: 10px;
  font-weight: 700;
  font-size: 18px;
  color: #a05200;
  user-select: none;
  line-height: 1.4;
  white-space: normal; /* allow wrapping */
  display:none;
}
.result.success-70 {
  background: #f1fbe8;          /* very light green */
  border-color: #9ccc65;
  color: #4f7c1f;
  box-shadow: 0 0 12px rgba(156, 204, 101, 0.5);
}

.result.success-85 {
  color: #2e7d32 !important;
  background: #e6f7da !important;
  border-color: #66bb6a !important;
  box-shadow: 0 0 14px rgba(102, 187, 106, 0.6) !important;
}

.result.success-100 {
  background: #d0f0c0;          /* perfect green */
  border-color: #2e7d32;
  color: #1b5e20;
  box-shadow: 0 0 18px rgba(46, 125, 50, 0.8);
}

/* Tip text below image */
.tip-under-image {
  display: block;
  margin-top: 10px;
  font-style: italic;
  font-size: 14px;
  color: #555;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;

  /* restrict width to image container width */
  max-width: 500px;
  /* wrap text nicely */
  white-space: normal;
  user-select: none;
}
/*
#showHelpBtn {
  z-index: 10001;     
}
#showScenarioBtn {
  z-index: 10001;     
}
*/
#showScenarioBtn,
#showHelpBtn {
  padding: 8px 16px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.5); /* semi-transparent dark */
  color: #fff;
  transition: background-color 0.3s ease;
}

/* When overlay is active */
.overlay-active #showScenarioBtn,
.overlay-active #showHelpBtn {
  background-color: rgba(0, 0, 0, 0.3); /* lighter dark to reduce glare */
  color: #eee; /* soften text color */
  z-index: 10001;
}
.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.video-modal.show {
  display: flex;
}

.video-modal-content {
  width: 90%;
  max-width: 900px;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}

.video-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #1a1a1a;
  color: white;
}

.video-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.subscribe-btn {
  background: #ff0000;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
}

.close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.video-modal-body {
  aspect-ratio: 16 / 9;
  background: black;
}


.score-panel {
  display: flex;
  align-items: stretch;
  background: #f4f6f9;
  border: 2px solid #d0d7de;
  border-radius: 14px;
  padding: 24px;
  margin-top: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.score-block {
  flex: 1;
  text-align: center;
  padding: 10px 20px;
}

.score-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #6b7280;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.score-value {
  font-size: 42px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.score-message {
  font-size: 14px;
  color: #4b5563;
}

.score-divider {
  width: 1px;
  background: #d0d7de;
}

.panel-success {
  background: #e6f6ea;
  border: 3px solid #2e7d32;
  color: #1b5e20;
}

.panel-good {
  background: #eef7ff;
  border: 3px solid #1976d2;
  color: #0d47a1;
}

.panel-warning {
  background: #fff8e1;
  border: 3px solid #f9a825;
  color: #e65100;
}

/* Middle badge column */
.score-badge-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  min-width: 180px;
  margin-top: 100px;
}

/* Placeholder image styling */
.score-badge {
  width: 112px;
  height: 112px;
  object-fit: contain;

  border: none;
  background: transparent;
  padding: 0;

  /* Make it feel stamped */
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.25));
  mix-blend-mode: multiply;

  /* Slight natural imperfection */
  transform: rotate(-3deg);

  filter:
    drop-shadow(0 2px 3px rgba(0,0,0,0.25))
    contrast(1.05)
    saturate(0.95);
  
  mix-blend-mode: multiply;
  opacity: 0.95;
}

/*
#objectiveBadgeWrapper {
  transform: translateY(8px) rotate(-4deg);
}

#eleganceBadgeWrapper {
  transform: translateY(16px) rotate(3deg);
}
*/



/* Label under badge */
.badge-label {
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #444;
}

.badge-close {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 14px;
  cursor: pointer;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  padding: 2px 4px;
}

.badge-wrapper {
  position: relative;
  display: inline-block;
  text-align: center;

  /* Remove boxed alignment feel */
  background: transparent;
  min-height: 169;
}


.hidden {
  display: none !important;
}

.levels {
  display: flex;
  justify-content: center;     /* CENTER THEM */
  gap: 16px;
  margin: 6px 0;
  flex-wrap: wrap;
}

.levels button {
  padding: 6px 18px;
  border-radius: 30px;
  border: none;
  background: linear-gradient(145deg, #e2e8f0, #ffffff);
  color: #1e293b;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.levels button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

.levels button.active {
  background: linear-gradient(145deg, #2563eb, #1e40af);
  color: white;
  box-shadow: 0 12px 28px rgba(37,99,235,0.45);
}


.scenario-scroll-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.scenario-container {
  overflow: hidden;
  flex: 1;
  padding: 0 16px;
}

.scenario-list {
  display: flex;
  gap: 16px;
  justify-content: flex-start;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}


.scenario-list::-webkit-scrollbar {
  display: none;
}

.scroll-btn {
  background: #333;
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
}

.hidden {
  display: none;
}

#text::-webkit-scrollbar {
  width: 8px;
}

#text::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

#text::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

#text::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
#text {
  position: relative;
}

#text::after {
  content: "";
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, white);
}

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.primary-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.primary-btn:hover {
  background: #1d4ed8;
}

.secondary-btn {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}

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