/* CineAHO Premium Tetrus Legendary Block Game Stylesheet */

/* Core Variables & Tokens */
:root {
  --hue-purple: 270;
  --hue-blue: 210;
  --hue-green: 145;
  --hue-gold: 45;
  --hue-red: 350;
  --hue-cyan: 190;
  --hue-pink: 325;
  --hue-orange: 20;

  /* Theme Core - Dark Glassmorphism */
  --bg-color: #04060d;
  --bg-grid: rgba(255, 255, 255, 0.015);
  
  --panel-bg: rgba(10, 15, 30, 0.65);
  --panel-border: rgba(255, 255, 255, 0.05);
  --panel-hover-border: rgba(240, 75, 125, 0.25);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #475569;
  
  /* Gradation Accents */
  --grad-purple: linear-gradient(135deg, #a855f7 0%, #6b21a8 100%);
  --grad-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --grad-green: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --grad-orange: linear-gradient(135deg, #f97316 0%, #c2410c 100%);
  --grad-pink: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
  
  --font-main: 'Noto Sans KR', 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
  
  --highlight-color: #ec4899;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Grid Background */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2;
  pointer-events: none;
}

/* Ambient Glow Orbs */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  z-index: -3;
  pointer-events: none;
  opacity: 0.18;
}

.bg-glow-purple {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #be185d 0%, transparent 70%);
  top: -100px;
  left: 5%;
}

.bg-glow-blue {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: 35%;
  right: 5%;
}

/* Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 1rem 1.5rem 0 1.5rem;
  border-radius: 50px;
  transition: var(--transition-smooth);
}

.glass-header {
  background: rgba(10, 15, 30, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.logo-circle {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(236, 72, 153, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-text {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
}

.logo-text span {
  color: var(--text-muted);
  font-weight: 400;
}

.header-nav {
  flex-grow: 1;
  margin: 0 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-nav::-webkit-scrollbar {
  display: none;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  white-space: nowrap;
}

.nav-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  padding: 0.5rem 0.25rem;
  position: relative;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--text-main);
}

.nav-list a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #ec4899;
  border-radius: 2px;
}

.btn-back-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 0.5rem 1.2rem;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-back-dashboard:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #ec4899;
  transform: translateX(-2px);
}

/* Glass Panels */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--panel-hover-border);
}

/* Tetris Container */
.tetris-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tetris-header-section {
  text-align: center;
}

.main-title {
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  letter-spacing: -0.5px;
}

.main-title span {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-title i {
  color: #fb923c;
  margin-right: 0.5rem;
}

.subtitle-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 1.25rem auto;
  line-height: 1.6;
}

.tag-badges {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.25rem 0.75rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.badge-tag {
  background: rgba(236, 72, 153, 0.05);
  border-color: rgba(236, 72, 153, 0.12);
  color: #f472b6;
}

/* Retro Big Title */
.retro-title-wrapper {
  text-align: center;
  margin: 0.5rem 0;
}

.retro-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 2.8rem;
  background: linear-gradient(90deg, #00f2fe 0%, #4facfe 30%, #f093fb 60%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  text-shadow: 0 0 40px rgba(240, 147, 251, 0.15);
}

/* Score Cards Dashboard */
.score-cards-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.score-card {
  padding: 1rem 1.25rem;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-meta span {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
  display: block;
  margin-bottom: 0.25rem;
}

.card-meta h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

/* Individual card colors and glows */
.score-card.theme-purple {
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.2);
}
.score-card.theme-purple h3 { color: #d8b4fe; }

.score-card.theme-blue {
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.2);
}
.score-card.theme-blue h3 { color: #93c5fd; }

.score-card.theme-green {
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.2);
}
.score-card.theme-green h3 { color: #6ee7b7; }

.score-card.theme-orange {
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.2);
}
.score-card.theme-orange h3 { color: #fdba74; }

/* Level progress bar */
.level-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #3b82f6;
  width: 0%;
  transition: width 0.3s;
}

/* Tetris Game Workspace */
.tetris-workspace {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  gap: 1.5rem;
  align-items: start;
}

.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hold-panel, .next-panel {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-header {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-align: center;
}

.canvas-wrapper {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.hold-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.hold-badge.disabled {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.25);
  color: #f43f5e;
}

/* Center main board column */
.main-board-column {
  display: flex;
  justify-content: center;
}

.board-container {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  display: inline-block;
  box-shadow: 0 0 35px rgba(236, 72, 153, 0.18);
  border: 3px solid #1e293b;
}

#canvas-board {
  display: block;
  background: #060914;
}

/* Overlays on Play Board */
.board-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 6, 13, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  z-index: 10;
  padding: 2rem;
  text-align: center;
}

.overlay-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: #fff;
  letter-spacing: 1px;
}

.overlay-title i {
  margin-right: 0.4rem;
}

.board-overlay p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-start {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-start:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* Bottom Controls */
.tetris-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.controls-buttons {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  align-items: center;
}

.btn-action-reset {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

.btn-action-reset:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #60a5fa;
}

.btn-mode-toggle {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.btn-mode-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.btn-mode-toggle.active-daily {
  background: rgba(249, 115, 22, 0.15) !important;
  border-color: #f97316 !important;
  color: #ffedd5 !important;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

.btn-mode-toggle.active-hardcore {
  background: rgba(244, 63, 94, 0.15) !important;
  border-color: #f43f5e !important;
  color: #ffe4e6 !important;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
}

.btn-settings-gear {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-settings-gear:hover {
  background: rgba(255,255,255,0.06);
  border-color: #ec4899;
  color: #fff;
}

.shortcut-guide-text {
  font-size: 0.72rem;
  color: var(--text-dark);
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Explanation Guide Board */
.explanation-board-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.explanation-board-section .board-header {
  border-bottom: 2px solid #ec4899;
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.explanation-board-section .board-header i {
  font-size: 1.25rem;
  color: #ec4899;
}

.explanation-board-section .board-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.explanation-board-section .board-header span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.explanation-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.explanation-index-list {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 16px;
  overflow: hidden;
}

.explanation-index-list ul {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.explanation-index-list li {
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-smooth);
}

.explanation-index-list li:last-child {
  border-bottom: none;
}

.explanation-index-list li:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  padding-left: 1.25rem;
}

.explanation-index-list li.active {
  background: rgba(236, 72, 153, 0.1);
  color: #fff;
  border-left: 4px solid #ec4899;
  padding-left: 1.25rem;
}

.index-num {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.08);
  font-weight: 700;
}

.explanation-index-list li.active .index-num {
  color: #f472b6;
}

.explanation-display-box {
  min-height: 380px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  border-left: 4px solid #f472b6;
}

.display-content-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.display-top-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(236, 72, 153, 0.12);
  padding: 0.25rem 0.8rem;
  border-radius: 30px;
  width: fit-content;
}

.display-top-badge i {
  font-size: 0.8rem;
  color: #f472b6;
}

.display-top-badge span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f472b6;
}

.explanation-display-box h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.display-text-body {
  font-size: 0.92rem;
  color: #e2e8f0;
  line-height: 1.7;
}

.display-text-body p {
  margin-bottom: 1rem;
}

.display-text-body ul, .display-text-body ol {
  margin-left: 1.25rem;
  margin-bottom: 1rem;
}

.display-text-body li {
  margin-bottom: 0.45rem;
}

.display-text-body strong {
  color: #f472b6;
}

.fade-out {
  opacity: 0;
}

/* Modals Overlay Settings */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  width: 90%;
  max-width: 440px;
  padding: 1.75rem;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-close-modal:hover {
  color: #fff;
}

.settings-options-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.setting-toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 80%;
}

.toggle-info strong {
  font-size: 0.85rem;
  color: #fff;
}

.toggle-info span {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.setting-toggle-item input[type="checkbox"] {
  accent-color: #ec4899;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Floating Navigator widget */
.floating-navigator {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
}

.floating-buttons-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-float {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(10, 15, 30, 0.8);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.btn-float:hover {
  background: #ec4899;
  border-color: #ec4899;
  color: #fff;
  transform: translateY(-2px);
}

/* Responsive query grids */
@media (max-width: 850px) {
  .score-cards-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
  .tetris-workspace {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .sidebar-column {
    flex-direction: row;
    justify-content: center;
    gap: 1.5rem;
  }
  .hold-panel, .next-panel {
    flex: 1;
    max-width: 180px;
  }
  .explanation-layout {
    grid-template-columns: 1fr;
  }
  .explanation-index-list ul {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .explanation-index-list li {
    flex: 1 1 180px;
  }
}

@media (max-width: 600px) {
  .main-header {
    margin: 0.5rem;
    padding: 0.5rem 1.1rem;
  }
  .logo-text {
    display: none;
  }
  .main-title {
    font-size: 1.7rem;
  }
  .retro-title {
    font-size: 2rem;
  }
  .score-cards-dashboard {
    grid-template-columns: 1fr;
  }
  .sidebar-column {
    flex-direction: column;
    align-items: center;
  }
  .hold-panel, .next-panel {
    max-width: 100%;
    width: 100%;
  }
  .controls-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }
}
