/**
 * BLD Memory Trainer Styles
 * Minimalist design with clear typography and touch-friendly controls
 */

:root {
  --bg-primary: #F7F9FC;
  --bg-secondary: #FFFFFF;
  --text-primary: #1A1F2E;
  --text-secondary: #6B7280;
  --color-primary: #6366F1;
  --color-primary-dark: #4F46E5;
  --color-success: #10B981;
  --color-error: #EF4444;
  --color-warning: #F59E0B;
  --border-color: #E5E7EB;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 24px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  max-width: 1400px;
  margin: 0 auto;
}

/* Typography */
h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  font-weight: 400;
}

.feature-highlight {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 1rem 0;
  padding: 0.5rem;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
}

/* Layout */
.screen {
  animation: fadeIn 0.3s ease-in;
}

.screen.hidden {
  display: none;
}

/* Utility class for hiding elements */
.hidden {
  display: none !important;
}

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

header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 1rem 0;
}

.header-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

/* Form Elements */
.form-group {
  margin-bottom: 1.75rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.input-field {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: all 0.2s ease;
  font-family: inherit;
}

.input-field:hover {
  border-color: #D1D5DB;
}

.input-field:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.help-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.help-text.warning {
  color: var(--color-warning);
}

/* Buttons */
.btn {
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  width: 100%;
  margin-bottom: 0.75rem;
}

.cta-buttons-row .btn-primary {
  width: auto;
  margin-bottom: 0;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  width: 100%;
  margin-bottom: 0.75rem;
}

.cta-buttons-row .btn-secondary {
  width: auto;
  margin-bottom: 0;
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.05);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn:disabled:hover,
.btn[disabled]:hover {
  transform: none;
  box-shadow: none;
}

.btn-large {
  padding: 20px 32px;
  font-size: 1.25rem;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  min-height: auto;
  font-weight: 500;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  min-height: auto;
  font-weight: 500;
}

.btn-text {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  min-height: auto;
}

.btn-text:hover {
  background: var(--bg-primary);
  transform: none;
}

.btn-danger-text {
  background: transparent;
  color: var(--color-error);
  padding: 8px 16px;
  margin-top: 1rem;
  min-height: auto;
}

.btn-danger-text:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: none;
}

.btn-success {
  background: var(--color-success);
  color: white;
  width: 100%;
  margin-bottom: 0.75rem;
}

.btn-success:hover {
  background: #059669;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: var(--color-error);
  color: white;
  width: 100%;
  margin-bottom: 0.75rem;
}

.btn-danger:hover {
  background: #DC2626;
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

/* Session Screen */
.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.counter {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.session-content {
  text-align: center;
  margin: 4rem 0;
}

.pair-display {
  font-size: 6rem;
  font-weight: 700;
  letter-spacing: 0.5rem;
  color: var(--color-primary);
  margin: 2rem 0;
  animation: pairAppear 0.3s ease-out;
}

@keyframes pairAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.instruction {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.session-controls {
  text-align: center;
  margin-top: 3rem;
}

/* Rating Screen */
.rating-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rating-option {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-secondary);
}

.rating-option:hover {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: var(--shadow);
}

.rating-option input[type="radio"] {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.rating-option input[type="radio"]:checked {
  accent-color: var(--color-primary);
}

.rating-option span {
  font-size: 1rem;
}

/* Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Table */
#sessions-table-container {
  overflow-x: auto;
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

thead {
  background: var(--bg-primary);
}

th {
  text-align: left;
  padding: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

tr:hover {
  background: var(--bg-primary);
}

.clickable-row {
  transition: background-color 0.2s ease;
}

.clickable-row:hover {
  background: #E3F2FD;
  cursor: pointer;
}

.accuracy-high {
  color: var(--color-success);
  font-weight: 600;
}

.accuracy-medium {
  color: var(--color-warning);
  font-weight: 600;
}

.accuracy-low {
  color: var(--color-error);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.empty-state.hidden {
  display: none;
}

/* Notifications */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
  z-index: 1000;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification.success {
  background: var(--color-success);
  color: white;
}

.notification.error {
  background: var(--color-error);
  color: white;
}

.notification.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .card {
    padding: 1.5rem;
  }

  .pair-display {
    font-size: 4rem;
    letter-spacing: 0.25rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 8px;
  }

  .header-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .pair-display {
    font-size: 3rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Notation Training Styles */
.notation-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem 1rem;
}

#color-squares-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
}

/* Edge Squares - Vertical Layout */
.color-squares-edge {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.color-squares-edge .color-square {
  width: 100px;
  height: 100px;
  border: 2px solid #333;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Corner Squares - Inverted T Layout */
.color-squares-corner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.color-squares-corner .color-square {
  width: 80px;
  height: 80px;
  border: 2px solid #333;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.corner-bottom-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

/* Notation Input */
.notation-input {
  font-size: 48px;
  width: 100px;
  height: 100px;
  text-align: center;
  border: 3px solid var(--color-primary);
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
  outline: none;
  transition: all 0.2s;
}

.notation-input:focus {
  border-color: var(--color-primary-dark);
  box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.2);
}

/* Timer Display */
.timer {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Notation Feedback */
.notation-feedback {
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  min-width: 200px;
  animation: feedbackPop 0.3s ease-out;
}

@keyframes feedbackPop {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.notation-feedback.correct {
  background: var(--color-success);
  color: white;
}

.notation-feedback.incorrect {
  background: var(--color-error);
  color: white;
}

.notation-feedback.hidden {
  display: none;
}

/* Results Display */
.results-summary {
  margin-bottom: 2rem;
}

.result-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.stat {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--bg-primary);
  border-radius: 8px;
}

.stat-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.attempts-breakdown {
  margin-top: 2rem;
}

.attempts-breakdown h4 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.attempts-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.attempt-item {
  display: grid;
  grid-template-columns: 40px 1fr 2fr 80px 40px;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
}

.attempt-item.correct {
  background: rgba(76, 175, 80, 0.1);
  border-left: 3px solid var(--color-success);
}

.attempt-item.incorrect {
  background: rgba(244, 67, 54, 0.1);
  border-left: 3px solid var(--color-error);
}

.attempt-number {
  font-weight: 600;
  color: var(--text-secondary);
}

.attempt-colors {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.attempt-answer {
  font-size: 0.9rem;
}

.attempt-time {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.attempt-icon {
  text-align: center;
  font-size: 1.25rem;
}

.attempt-item.correct .attempt-icon {
  color: var(--color-success);
}

.attempt-item.incorrect .attempt-icon {
  color: var(--color-error);
}

/* Mobile Responsive for Notation */
@media (max-width: 768px) {
  .color-squares-edge .color-square {
    width: 80px;
    height: 80px;
  }

  .color-squares-corner .color-square {
    width: 60px;
    height: 60px;
  }

  .notation-input {
    font-size: 36px;
    width: 80px;
    height: 80px;
  }

  .attempt-item {
    grid-template-columns: 30px 1fr 80px;
    gap: 0.5rem;
  }

  .attempt-colors {
    display: none;
  }

  .attempt-answer {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    font-size: 0.85rem;
  }
}

/* Authentication UI */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 1rem;
  gap: 1rem;
}

.btn-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  color: var(--text-primary);
  height: fit-content;
}

.btn-auth:hover {
  background: var(--bg-primary);
  border-color: var(--color-primary);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  transition: all 0.2s ease;
  height: fit-content;
}

.user-profile:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-email {
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Stats Page Header - simplified, no longer needed for complex layout */

@media (max-width: 768px) {
  .auth-container {
    justify-content: center;
    margin-top: 0.5rem;
  }
  
  .auth-container-nav {
    margin-left: 0.5rem;
    gap: 0.5rem;
  }
  
  .nav-container {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 1rem;
  }
  
  .auth-container-nav {
    order: 2;
  }
  
  .user-email {
    display: none;
  }
}

/* Recall verification styles */
.recall-textarea {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.recall-feedback {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.recall-feedback h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.recall-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.recall-stat {
  flex: 1;
  text-align: center;
  padding: 0.75rem;
  border-radius: 4px;
  background: var(--bg-primary);
}

.recall-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.recall-stat .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.recall-details {
  display: grid;
  gap: 0.5rem;
}

.recall-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 4px;
}

.recall-item.correct {
  background: #e8f5e9;
  color: #2e7d32;
}

.recall-item.incorrect {
  background: #ffebee;
  color: #c62828;
}

.recall-item.missed {
  background: #fff3e0;
  color: #e65100;
}

.recall-item.extra {
  background: #f5f5f5;
  color: #616161;
}

.recall-icon {
  font-size: 1.2rem;
  font-weight: bold;
  min-width: 24px;
  text-align: center;
}

@media (max-width: 768px) {
  .recall-stats {
    flex-direction: column;
  }
  
  .recall-textarea {
    font-size: 1rem;
    letter-spacing: 1px;
  }
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease-in;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
  border: 1px solid var(--border-color);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-close:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
  line-height: 1.8;
}

.modal-body h3 {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.modal-body h4 {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.modal-body p {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.modal-body ul {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.modal-body li {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.modal-body strong {
  font-weight: 600;
  color: var(--text-primary);
}

.modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Info Button Styles */
.btn-info-icon {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s;
  color: var(--color-primary);
}

.btn-info-icon:hover {
  background: rgba(33, 150, 243, 0.1);
  transform: scale(1.1);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.card-header-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-header-with-action h2 {
  margin: 0;
}

/* Info Section Styling in Modal */
.info-section {
  margin-bottom: 1.5rem;
}

.info-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--color-primary);
}

.info-section-content {
  padding-left: 0.5rem;
}

.session-detail-section {
  margin-bottom: 1.5rem;
}

.session-detail-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--color-primary);
}

@media (max-width: 768px) {
  .modal-content {
    max-height: 95vh;
    margin: 10px;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .card-header-with-action {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Tracing Results Styles */
.correct-solution-section {
  background: linear-gradient(135deg, #E8F5E8 0%, #F0F8F0 100%);
  border: 2px solid var(--color-success);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.correct-solution-section h4 {
  color: var(--color-success);
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.solution-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 8px;
  font-style: italic;
}

.correct-solution {
  background: var(--color-success);
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 12px 16px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

.user-sequence {
  background: #F5F5F5;
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

.sequence-display {
  word-break: break-all;
  white-space: pre-wrap;
}

/* Intro Link Styling */
.intro-link-container {
  margin: 20px 0;
  text-align: center;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.intro-link {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 25px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1em;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.intro-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.intro-link:active {
  transform: translateY(0);
}

.btn-tutorial {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 15px 25px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-tutorial:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.btn-tutorial:active {
  transform: translateY(0);
}

/* Chart Styles */
.charts-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.chart-controls {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-group label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.control-group select {
  min-width: 150px;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.control-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 1rem;
  max-width: 100%;
}

.chart-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  min-width: 0; /* Allow flex shrinking */
}

.chart-container h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.chart-container canvas {
  width: 100% !important;
  height: 400px !important;
  max-height: 400px;
}

/* Chart responsive behavior */
@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .chart-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .control-group {
    width: 100%;
  }
  
  .control-group select {
    width: 100%;
  }
  
  .chart-container canvas {
    height: 300px !important;
  }
}

@media (max-width: 480px) {
  .charts-section {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .chart-container {
    padding: 0.75rem;
  }
  
  .chart-container canvas {
    height: 200px !important;
  }
}

/* Navigation */
.main-navigation {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  margin-bottom: 3rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  height: 60px;
  display: flex;
  align-items: center;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
}

.nav-logo {
  flex: 0 0 auto;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: opacity 0.2s ease;
}

.nav-logo:hover {
  opacity: 0.8;
}

.nav-logo img,
.nav-logo-image {
  width: 50px !important;
  height: 50px !important;
  object-fit: contain;
}

.nav-links {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-left: 1rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s ease;
  padding: 0.5rem 0;
  position: relative;
}

.nav-links a:hover {
  color: var(--color-primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.2s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.auth-container-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex: 0 0 auto;
  margin-left: 1.5rem;
  height: 100%;
}

/* Footer */
.main-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 5rem;
  padding: 3rem 0 2rem;
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
}

.footer-section h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-section ul li a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 1rem 20px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Registration Prompt */
.registration-prompt-container {
  margin-bottom: 2rem;
}

.registration-prompt {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.registration-prompt-content {
  flex: 1;
}

.registration-prompt-text {
  margin-bottom: 1rem;
}

.registration-prompt-text strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.registration-benefits {
  font-size: 0.9rem;
  opacity: 0.9;
}

.registration-prompt-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.registration-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.2rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
  margin-left: 1rem;
}

.registration-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Primary CTA */
.primary-cta-container {
  margin-bottom: 1rem;
  text-align: center;
}

.primary-cta.compact {
  margin-bottom: 0.5rem;
}

.primary-cta .btn-large {
  font-size: 1.25rem;
  padding: 1rem 2rem;
  min-width: 250px;
}

.primary-cta.compact .btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  min-width: auto;
}

.cta-buttons-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.cta-buttons-row .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 150px;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Best Performance */
.best-performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.best-performance-grid.compact {
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.best-performance-grid.compact .best-performance-card {
  padding: 1rem;
}

.best-performance-card {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  border: 2px solid var(--border-color);
}

.best-performance-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.best-performance-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Population Comparison */
.population-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.population-card {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  border: 2px solid var(--border-color);
}

.population-metric {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.population-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0.5rem 0;
}

.population-badge.elite {
  background: #9C27B0;
  color: white;
}

.population-badge.top-performer {
  background: #2196F3;
  color: white;
}

.population-badge.above-average {
  background: #4CAF50;
  color: white;
}

.population-badge.average {
  background: #FF9800;
  color: white;
}

.population-badge.improving {
  background: #757575;
  color: white;
}

.population-percentile {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Value Indicators */
.value-indicators-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.value-indicators-list.compact {
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.value-indicators-list.compact .value-indicator {
  padding: 0.5rem;
  font-size: 0.9rem;
}

.value-indicator {
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 8px;
  border-left: 4px solid var(--color-primary);
  font-size: 0.95rem;
}

/* Drill Cards */
.drill-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.drill-cards-grid.compact {
  gap: 1rem;
  margin-top: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.drill-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 2px solid var(--border-color);
}

.drill-card.compact {
  padding: 1rem;
}

.drill-card.compact .drill-card-header h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.drill-card.compact .drill-card-description {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
  transition: transform 0.2s, box-shadow 0.2s;
}

.drill-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.drill-card.under-practiced {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.drill-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.drill-card-header h3 {
  font-size: 1.1rem;
  margin: 0;
  color: var(--text-primary);
}

.drill-badge {
  background: var(--color-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.drill-card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.drill-card-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.drill-start-btn {
  width: 100%;
  margin-top: 0.5rem;
}

/* Encouragement Section */
.encouragement-section {
  margin-top: 1rem;
}

.encouragement-section.compact {
  margin-top: 0.5rem;
}

.encouragement-section.compact h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.encouragement-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.encouragement-section.compact .encouragement-messages {
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.encouragement-section.compact .encouragement-message {
  font-size: 0.9rem;
  padding: 0.5rem;
}

/* Insights and Motivation Row */
.insights-motivation-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.insights-motivation-row .card {
  margin: 0;
  padding: 1.5rem;
}

.insights-motivation-row .card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  margin-top: 0;
}

.insights-motivation-row .encouragement-section.compact h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  margin-top: 0;
}

.insights-motivation-row .value-indicators-list.compact {
  margin-top: 0.5rem;
}

.insights-motivation-row .encouragement-messages {
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .insights-motivation-row {
    grid-template-columns: 1fr;
  }
  
  .cta-buttons-row {
    flex-direction: column;
  }
  
  .cta-buttons-row .btn {
    width: 100%;
  }
  
  .stats-header-top {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .stats-header-top h1 {
    order: -1;
  }
  
  .stats-header-right {
    justify-content: center;
    min-width: auto;
  }
}

.encouragement-message {
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 8px;
  border-left: 4px solid var(--color-success);
  font-size: 1rem;
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .intro-link {
    font-size: 1em;
    padding: 12px 20px;
  }

  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    justify-content: center;
  }

  .registration-prompt {
    flex-direction: column;
    gap: 1rem;
  }

  .registration-prompt-actions {
    width: 100%;
    justify-content: stretch;
  }

  .registration-prompt-actions .btn {
    flex: 1;
  }

  .drill-cards-grid {
    grid-template-columns: 1fr;
  }

  .best-performance-grid,
  .population-comparison-grid {
    grid-template-columns: 1fr;
  }

  .footer-container {
    grid-template-columns: 1fr;
  }
}

/* Auth Form Styles */
.auth-form {
  width: 100%;
}

.auth-form h3 {
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text-primary);
}

.auth-options-container {
  width: 100%;
}

.auth-options {
  margin-bottom: 1.5rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-secondary);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 1rem;
  font-size: 0.875rem;
}

.btn-full-width {
  width: 100%;
  margin-bottom: 0;
}

.error-message {
  background: rgba(244, 67, 54, 0.1);
  color: var(--color-error);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid rgba(244, 67, 54, 0.2);
}

.success-message {
  background: rgba(76, 175, 80, 0.1);
  color: var(--color-success);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.auth-form-footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .auth-form {
    padding: 0;
  }
  
  .modal-content {
    max-width: 95%;
  }
}

/* Auth Page Styles */
.auth-page-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-page-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 450px;
  animation: fadeIn 0.3s ease-in;
}

.auth-page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-page-header h1 {
  margin-bottom: 0.5rem;
  font-size: 2rem;
}

.auth-content {
  margin-bottom: 1.5rem;
}

.auth-page-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.auth-page-footer p {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-page-footer p:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .auth-page-container {
    padding: 1rem;
    min-height: calc(100vh - 150px);
  }
  
  .auth-page-card {
    padding: 1.5rem;
  }
  
  .auth-page-header h1 {
    font-size: 1.75rem;
  }
}

/* Stats Page Filtering and Pagination */
.stats-filters {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-group label {
  font-weight: 500;
  color: var(--text-primary);
}

.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  gap: 1.5rem;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pagination-page-info {
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 0 1rem;
  white-space: nowrap;
  min-width: 100px;
  text-align: center;
}

.pagination-page-info strong {
  color: var(--color-primary);
  font-weight: 600;
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-size label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pagination-size select {
  min-width: 80px;
}

@media (max-width: 768px) {
  .pagination-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .pagination-buttons {
    justify-content: center;
  }
}

/* Playground Styles */
.cube-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

#cube {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  width: 350px;
  height: 350px;
  min-width: 350px;
  min-height: 350px;
}

.sequence-display {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  min-height: 60px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text-primary);
  word-wrap: break-word;
  white-space: pre-wrap;
}

.sequence-display.empty {
  color: var(--text-secondary);
  font-style: italic;
}

.move-buttons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.move-buttons .btn {
  padding: 0.5rem;
  font-size: 0.85rem;
  min-height: auto;
  margin-bottom: 0;
  width: 100%;
}

.setup-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.setup-table th {
  background: var(--color-primary);
  color: white;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

.setup-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

.setup-table tr:last-child td {
  border-bottom: none;
}

.setup-table tr:hover {
  background: var(--bg-primary);
}

.buffer-cell {
  background: #fff3cd;
  font-weight: bold;
}

.algorithm-box {
  background: var(--bg-secondary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 0.75rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-primary);
}

.clickable-move {
  cursor: pointer;
  color: var(--color-primary);
  font-weight: 600;
  transition: all 0.2s;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.clickable-move:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary-dark);
  transform: scale(1.05);
}

.clickable-move:active {
  transform: scale(0.98);
}

.reference-section {
  margin-top: 1.5rem;
}

.reference-section h2 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}

.reference-section h2:hover {
  color: var(--color-primary);
}

.reference-section h3 {
  color: var(--text-secondary);
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.reference-content {
  display: none;
}

.reference-content.expanded {
  display: block;
}

.info {
  background: rgba(99, 102, 241, 0.05);
  border-left: 4px solid var(--color-primary);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.info strong {
  color: var(--color-primary);
}

.info ul {
  margin-top: 0.625rem;
  margin-left: 1.25rem;
}

.info code {
  background: var(--bg-primary);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .move-buttons {
    grid-template-columns: repeat(3, 1fr);
  }
  
  #cube {
    width: 300px;
    height: 300px;
    min-width: 300px;
    min-height: 300px;
  }
}


