:root {
  --bg-deep: #0d0a14;
  --bg-surface: #171224;
  --bg-card: #211a33;
  --bg-card-hover: #2b2242;
  --bg-glass: rgba(23, 18, 36, 0.88);
  --gold-primary: #e4c065;
  --gold-light: #f6df9e;
  --gold-dark: #b38d36;
  --gold-border: rgba(228, 192, 101, 0.28);
  --gold-glow: rgba(228, 192, 101, 0.16);
  --purple-accent: #9b7ede;
  --purple-soft: rgba(155, 126, 222, 0.18);
  --text-main: #f3efe6;
  --text-secondary: #c9c0d8;
  --text-muted: #9186a6;
  --success: #4cd97b;
  --success-bg: rgba(76, 217, 123, 0.14);
  --danger: #ff6b7a;
  --danger-bg: rgba(255, 107, 122, 0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 0 24px rgba(228, 192, 101, 0.22);
  --font-serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(109, 86, 150, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(228, 192, 101, 0.10) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.65;
  min-height: 100vh;
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gold-border);
  padding: 12px 20px;
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #140f21;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
  flex-shrink: 0;
}

.brand-text h1 {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  color: var(--gold-light);
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(228, 192, 101, 0.2);
  color: var(--text-secondary);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(228, 192, 101, 0.12);
  color: var(--gold-light);
  border-color: var(--gold-primary);
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #161124;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(228, 192, 101, 0.3);
}

/* Container & Views */
.main-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px;
}

.view-section {
  display: none;
  animation: fadeIn 0.28s ease;
}

.view-section.active {
  display: block;
}

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

/* Hero Banner in Study View */
.study-hero {
  background: linear-gradient(135deg, rgba(43, 34, 66, 0.9), rgba(23, 18, 36, 0.95));
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-soft);
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hero-cover {
  width: 74px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--gold-primary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  cursor: pointer;
}

.hero-info h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.hero-info p {
  color: var(--text-secondary);
  font-size: 0.93rem;
  max-width: 650px;
  margin-bottom: 12px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-outline-gold {
  background: rgba(228, 192, 101, 0.1);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline-gold:hover {
  background: var(--gold-primary);
  color: #161124;
}

.progress-box {
  background: rgba(13, 10, 20, 0.65);
  border: 1px solid rgba(228, 192, 101, 0.22);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-width: 230px;
  text-align: center;
}

.progress-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.progress-label strong {
  color: var(--gold-light);
}

.progress-bar-bg {
  width: 100%;
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-accent), var(--gold-primary));
  width: 0%;
  transition: width 0.35s ease;
}

/* Filter & Search Bar */
.toolbar {
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toolbar-top {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

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

.search-input {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid rgba(228, 192, 101, 0.3);
  color: var(--text-main);
  padding: 11px 38px 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 16px; /* Prevents iOS auto-zoom */
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px rgba(228, 192, 101, 0.15);
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: none;
  padding: 4px;
}

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

.filter-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}

.filter-pill:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.filter-pill.active {
  background: rgba(228, 192, 101, 0.2);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  font-weight: 600;
}

/* Card Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 18px;
}

.card-tile {
  background: var(--bg-card);
  border: 1px solid rgba(228, 192, 101, 0.22);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.card-tile:hover {
  transform: translateY(-5px);
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-gold);
}

.card-tile-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(13, 10, 20, 0.82);
  border: 1px solid rgba(228, 192, 101, 0.45);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  z-index: 2;
}

.card-learned-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(20, 82, 45, 0.9);
  border: 1px solid var(--success);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  z-index: 2;
}

.card-img-wrap {
  width: 100%;
  aspect-ratio: 2 / 3.35;
  background: #120e1c;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px 8px 4px;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

.card-tile:hover .card-img-wrap img {
  transform: scale(1.03);
}

.card-tile-body {
  padding: 10px 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.card-tile-en {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.25;
}

.card-tile-vi {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.card-tile-kw {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Modal / Detail Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 4, 12, 0.84);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

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

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  animation: modalPop 0.24s ease;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 15px 22px;
  background: rgba(13, 10, 20, 0.75);
  border-bottom: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--gold-light);
  font-weight: 700;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.modal-footer {
  padding: 13px 22px;
  background: rgba(13, 10, 20, 0.85);
  border-top: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Card Detail Layout */
.detail-top {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 26px;
  align-items: start;
  margin-bottom: 22px;
}

.detail-card-frame {
  background: #120d1d;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.detail-card-frame img {
  width: 100%;
  border-radius: 8px;
  display: block;
  margin-bottom: 10px;
}

.detail-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.meta-badge {
  background: var(--purple-soft);
  border: 1px solid rgba(155, 126, 222, 0.35);
  color: #dfd3ff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.meta-badge.gold {
  background: rgba(228, 192, 101, 0.16);
  border-color: var(--gold-border);
  color: var(--gold-light);
}

.detail-title-en {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  color: var(--gold-light);
  line-height: 1.25;
  margin-bottom: 4px;
}

.detail-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1.04rem;
  margin-bottom: 16px;
}

.core-box {
  background: linear-gradient(135deg, rgba(228, 192, 101, 0.13), rgba(155, 126, 222, 0.1));
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.core-box-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  margin-bottom: 8px;
}

.core-meaning-text {
  font-size: 1.03rem;
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 12px;
}

.kw-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.kw-tag {
  background: rgba(13, 10, 20, 0.7);
  border: 1px solid rgba(228, 192, 101, 0.45);
  color: var(--gold-light);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
}

.word-section {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.word-section h3 {
  font-family: var(--font-serif);
  color: var(--gold-light);
  font-size: 1.12rem;
  margin-bottom: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(228, 192, 101, 0.2);
}

.word-p {
  margin-bottom: 10px;
  color: var(--text-main);
  font-size: 0.97rem;
  text-align: justify;
}

.word-bold-label {
  margin-top: 12px;
  margin-bottom: 4px;
  color: var(--gold-light);
  font-weight: 700;
  font-size: 0.98rem;
}

.word-quote {
  margin: 12px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--gold-primary);
  background: rgba(228, 192, 101, 0.07);
  font-style: italic;
  color: var(--gold-light);
  border-radius: 0 8px 8px 0;
}

.see-more-toggle {
  width: 100%;
  background: rgba(228, 192, 101, 0.12);
  border: 1px dashed var(--gold-primary);
  color: var(--gold-light);
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0;
  transition: all 0.2s;
}

.see-more-toggle:hover {
  background: rgba(228, 192, 101, 0.22);
}

.extra-sections-container {
  display: none;
  margin-top: 14px;
}

.extra-sections-container.expanded {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* Flashcard Mode inside Study View */
.flashcard-panel {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 24px;
  text-align: center;
}

.flashcard-panel.open {
  display: block;
}

.fc-stage {
  max-width: 520px;
  margin: 0 auto 18px;
  perspective: 1200px;
}

.fc-card {
  background: var(--bg-card);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease;
}

.fc-card img {
  max-height: 270px;
  border-radius: 8px;
  margin-bottom: 14px;
}

/* 2-Card Combination View */
.combo-mode-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.mode-switch-btn {
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  color: var(--text-secondary);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.mode-switch-btn.active {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #161124;
  border-color: transparent;
  box-shadow: var(--shadow-gold);
}

.combo-selectors-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 28px;
}

.slot-box {
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(228, 192, 101, 0.18);
  padding-bottom: 10px;
}

.slot-role {
  font-size: 0.8rem;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.slot-select {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid rgba(228, 192, 101, 0.35);
  color: var(--text-main);
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 16px; /* iOS safe */
  outline: none;
}

.slot-preview {
  display: flex;
  gap: 16px;
  align-items: center;
  background: rgba(13, 10, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 14px;
  flex: 1;
}

.slot-preview img {
  width: 96px;
  height: 158px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

.combo-swap-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.swap-btn {
  background: var(--bg-card);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.2s;
}

.swap-btn:hover {
  transform: rotate(180deg);
  background: var(--gold-primary);
  color: #151022;
}

/* Random 2 Face-down Cards Stage */
.random-stage {
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 28px;
}

.facedown-pair {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 22px 0;
  flex-wrap: wrap;
}

.flip-slot {
  width: 190px;
  height: 315px;
  perspective: 1000px;
  cursor: pointer;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
}

.flip-slot.flipped .flip-inner {
  -webkit-transform: rotateY(180deg);
  transform: rotateY(180deg);
}

.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.flip-front {
  background:
    radial-gradient(circle at center, rgba(228, 192, 101, 0.24) 0%, transparent 60%),
    repeating-linear-gradient(45deg, #1d1530 0px, #1d1530 10px, #251b3d 10px, #251b3d 20px);
  border: 2px solid var(--gold-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card-back-ornament {
  width: 86%;
  height: 88%;
  border: 1px solid rgba(228, 192, 101, 0.55);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(13, 10, 20, 0.55);
}

.card-back-star {
  font-size: 2.4rem;
  color: var(--gold-primary);
}

.flip-back {
  background: #120d1d;
  border: 2px solid var(--gold-primary);
  -webkit-transform: rotateY(180deg);
  transform: rotateY(180deg);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.flip-back img {
  width: 100%;
  height: 84%;
  object-fit: contain;
  border-radius: 6px;
}

.flip-back-label {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  color: var(--gold-light);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Combination Result Synthesis */
.combo-result-card {
  background: var(--bg-surface);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.combo-result-header {
  text-align: center;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--gold-border);
}

.combo-result-header h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.combo-Core-Banner {
  background: linear-gradient(135deg, rgba(228, 192, 101, 0.16), rgba(155, 126, 222, 0.14));
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 22px;
}

.direct-word-quote-box {
  background: rgba(76, 217, 123, 0.08);
  border: 1px solid rgba(76, 217, 123, 0.45);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 22px;
}

.direct-word-quote-box h3 {
  font-family: var(--font-serif);
  color: var(--success);
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.combo-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.analysis-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(228, 192, 101, 0.22);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.analysis-block h4 {
  font-family: var(--font-serif);
  color: var(--gold-light);
  font-size: 1.05rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mini Games View */
.game-tabs {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.game-stage-card {
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 880px;
  margin: 0 auto;
  box-shadow: var(--shadow-soft);
}

.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gold-border);
}

.hud-stat {
  background: var(--bg-deep);
  border: 1px solid rgba(228, 192, 101, 0.25);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.hud-stat strong {
  color: var(--gold-light);
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 20px;
}

.quiz-options.two-col {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.quiz-option-btn {
  background: var(--bg-card);
  border: 1px solid rgba(228, 192, 101, 0.28);
  color: var(--text-main);
  padding: 15px 18px;
  border-radius: var(--radius-md);
  font-size: 0.96rem;
  text-align: left;
  cursor: pointer;
  line-height: 1.5;
  transition: all 0.18s ease;
}

.quiz-option-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
}

.quiz-option-btn.correct {
  background: var(--success-bg);
  border-color: var(--success);
  color: #eafff0;
}

.quiz-option-btn.wrong {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #ffe8eb;
}

.quiz-feedback {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(13, 10, 20, 0.8);
  border: 1px solid var(--gold-primary);
  display: none;
}

.quiz-feedback.show {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* Responsive for iOS / Mobile & Tablets */
@media (max-width: 820px) {
  .study-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .progress-box {
    width: 100%;
  }
  .detail-top {
    grid-template-columns: 1fr;
  }
  .detail-card-frame {
    max-width: 220px;
    margin: 0 auto;
  }
  .combo-selectors-grid {
    grid-template-columns: 1fr;
  }
  .combo-swap-col {
    flex-direction: row;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 10px 14px;
  }
  .brand-text h1 {
    font-size: 1.05rem;
  }
  .main-nav {
    width: 100%;
    justify-content: space-between;
  }
  .nav-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.82rem;
  }
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .modal-body {
    padding: 16px;
  }
  .combo-result-card {
    padding: 18px 15px;
  }
}

