/* ==========================================================================
   CS-CyberVerse M.3 - Mini-Games Arcade Styles
   ========================================================================== */

/* Game Container Wrapper */
.game-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.game-badge {
  background: linear-gradient(135deg, var(--accent-purple), #ec4899);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 0.3rem;
}

.game-stats-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-box {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
}

/* Arcade Menu Cards */
.arcade-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.arcade-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  border-color: var(--border-glow);
}

.arcade-card-banner {
  padding: 2.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.arcade-big-icon {
  font-size: 3.5rem;
  transition: transform 0.3s ease;
}

.arcade-card:hover .arcade-big-icon {
  transform: scale(1.15) rotate(6deg);
}

.arcade-badge {
  font-size: 0.82rem;
  padding: 6px 12px;
}

.arcade-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.arcade-card-body h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.arcade-card-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-grow: 1;
}

.arcade-card-meta {
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.8rem;
  margin-top: 0.8rem;
}

/* -------------------------------------------------------------
   Game 1: Data & Law Matcher (3D Flip Cards)
   ------------------------------------------------------------- */
.matcher-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 1.5rem;
  perspective: 1000px;
}

.match-card-wrapper {
  height: 120px;
  perspective: 1000px;
}

.match-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  cursor: pointer;
}

.match-card-wrapper.flipped .match-card-inner {
  transform: rotateY(180deg);
}

.match-card-front, .match-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.match-card-front {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.card-pattern-icon {
  font-size: 2rem;
  color: var(--accent-cyan);
  opacity: 0.6;
}

.match-card-back {
  background: linear-gradient(135deg, #0284c7, #1e1b4b);
  border: 2px solid var(--accent-cyan);
  transform: rotateY(180deg);
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-neon);
}

.match-card-wrapper.matched .match-card-back {
  background: linear-gradient(135deg, #059669, #064e3b);
  border-color: #34d399;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

/* -------------------------------------------------------------
   Game 2: Cyber Word Hunter (Grid & Clues)
   ------------------------------------------------------------- */
.word-grid-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  user-select: none;
}

.grid-cell {
  aspect-ratio: 1 / 1;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.grid-cell:hover {
  background: rgba(56, 189, 248, 0.3);
}

.grid-cell.selected {
  background: var(--accent-cyan) !important;
  color: #000 !important;
  transform: scale(1.08);
}

.grid-cell.found-permanent {
  background: rgba(16, 185, 129, 0.5) !important;
  border-color: var(--accent-emerald) !important;
  color: #fff !important;
}

.clue-box {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  height: 100%;
}

.word-clues-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1rem;
  max-height: 420px;
  overflow-y: auto;
}

.clue-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.clue-item.found {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
}

.clue-item.found .word-target {
  text-decoration: line-through;
  color: var(--accent-emerald);
}

.clue-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 4px;
}

.clue-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
}

/* -------------------------------------------------------------
   Game 3: Cyber Cop (Case Dossier)
   ------------------------------------------------------------- */
.case-dossier-card {
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.2);
}

.case-top-bar {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.case-id {
  color: var(--accent-amber);
  font-weight: 700;
}

.case-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.2rem;
}

.case-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 1.5rem;
}

.case-desc-box, .case-evidence-box {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.case-evidence-box ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 0.88rem;
}

.case-evidence-box li {
  margin-bottom: 0.4rem;
}

.case-question-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.2rem;
}

.case-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1rem;
}

.case-option-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: all 0.2s ease;
}

.case-option-btn:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--accent-purple);
}

.case-option-btn.correct {
  background: rgba(16, 185, 129, 0.3) !important;
  border-color: var(--accent-emerald) !important;
}

.case-option-btn.wrong {
  background: rgba(239, 68, 68, 0.3) !important;
  border-color: #ef4444 !important;
}

/* -------------------------------------------------------------
   Game 4: Tech Trivia Blitz (Kahoot style)
   ------------------------------------------------------------- */
.trivia-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.timer-progress-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.timer-progress-bar {
  height: 100%;
  background: var(--accent-cyan);
  transition: width 1s linear, background-color 0.3s ease;
}

.lifelines-bar {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
}

.lifeline-btn {
  font-size: 0.85rem;
  border-radius: 20px;
}

.lifeline-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.trivia-question-text {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin: 2rem 0;
}

.trivia-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.trivia-btn {
  border: none;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-md);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.trivia-btn.color-0 { background: #ef4444; }
.trivia-btn.color-1 { background: #3b82f6; }
.trivia-btn.color-2 { background: #f59e0b; }
.trivia-btn.color-3 { background: #10b981; }

.trivia-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  filter: brightness(1.15);
}

.trivia-btn.correct {
  border: 4px solid #fff !important;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8) !important;
  transform: scale(1.03);
}

.trivia-btn.wrong {
  opacity: 0.35;
}

.trivia-key {
  background: rgba(0, 0, 0, 0.25);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

/* -------------------------------------------------------------
   Game 5: Data Sorter (Drag & Drop)
   ------------------------------------------------------------- */
.sorter-game-area {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

.sorter-pool-container {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass);
  padding: 1.2rem;
  border-radius: var(--radius-md);
}

.sorter-pool {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1rem;
  min-height: 250px;
}

.sorter-item {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border-glow);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: grab;
  user-select: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.sorter-item:active { cursor: grabbing; }

.sorter-item.selected-item {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.sorter-item.dragging { opacity: 0.4; }

.sorter-buckets-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sorter-bucket {
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid var(--border-glass);
  border-top-width: 6px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bucket-header {
  padding: 10px 14px;
  text-align: center;
  font-weight: 700;
}

.bucket-dropzone {
  flex-grow: 1;
  padding: 1rem;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background-color 0.2s ease;
}

.bucket-dropzone.drag-over {
  background: rgba(56, 189, 248, 0.15);
  border: 2px dashed var(--accent-cyan);
}

.dropzone-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  margin: auto;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  padding: 12px;
  border-radius: var(--radius-sm);
  width: 100%;
}

/* Victory Modals */
.game-victory-modal {
  padding: 3rem 2rem;
}

.victory-icon {
  font-size: 4.5rem;
  margin-bottom: 0.5rem;
}

.score-summary-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  max-width: 450px;
  margin: 1.5rem auto;
  padding: 1.2rem 1.6rem;
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.score-row.total {
  font-size: 1.2rem;
  font-weight: 700;
  border-bottom: none;
  padding-top: 10px;
}

@media (max-width: 768px) {
  .matcher-grid { grid-template-columns: repeat(2, 1fr); }
  .case-body-grid { grid-template-columns: 1fr; }
  .trivia-options-grid { grid-template-columns: 1fr; }
  .sorter-game-area { grid-template-columns: 1fr; }
}
