/* ═══════════════════════════════════════════════════════════════════
   MIA GAMES — Simon Memory Game Styles
   File     : games/simon/simon.css
   Inherits : ../../style.css (global tokens + layout)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Breadcrumb ─────────────────────────────────────────────────── */
.breadcrumb-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.625rem 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.breadcrumb li {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover { color: var(--accent-purple); }

.breadcrumb [aria-current="page"] {
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}

/* ── Screen-reader only utility ─────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── SEO Article Content ────────────────────────────────────────── */
.seo-content {
  padding: 2.5rem 0 1rem;
  border-top: 1px solid var(--border-subtle);
}

.seo-content h2 {
  font-size: clamp(var(--fs-xl), 2.5vw, var(--fs-2xl));
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.seo-content h3 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}

.seo-content p {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  line-height: 1.85;
  max-width: none;
  margin-bottom: 1rem;
}

.seo-content ul {
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.seo-content ul li {
  list-style: disc;
  font-size: var(--fs-base);
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ══════════════════════════════════════════════════════════════════
   SIMON BOARD
   ══════════════════════════════════════════════════════════════════ */

.simon-board {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  position: relative;
  background: #1a1a2e;
  border-radius: 50%;
  padding: 20px;
  box-shadow: 
    0 0 40px rgba(0, 0, 0, 0.5),
    inset 0 0 40px rgba(0, 0, 0, 0.3);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Simon Buttons ──────────────────────────────────────────────── */
.simon-btn {
  position: relative;
  border-radius: 50%;
  cursor: pointer;
  border: 4px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.simon-btn:focus-visible {
  outline: 3px solid var(--accent-purple);
  outline-offset: 4px;
}

.simon-label {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: var(--fw-bold);
  color: rgba(255, 255, 255, 0.15);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: color 0.2s ease;
}

.simon-btn.active .simon-label {
  color: rgba(255, 255, 255, 0.4);
}

.simon-btn:active {
  transform: scale(0.92);
}

/* ── Button Colors ──────────────────────────────────────────────── */
.simon-green {
  background: radial-gradient(circle at 40% 40%, #66bb6a, #2e7d32);
  box-shadow: 0 0 20px rgba(46, 125, 50, 0.3);
}

.simon-green.lit {
  background: radial-gradient(circle at 40% 40%, #a5d6a7, #43a047);
  box-shadow: 0 0 50px rgba(76, 175, 80, 0.6);
}

.simon-red {
  background: radial-gradient(circle at 40% 40%, #ef5350, #c62828);
  box-shadow: 0 0 20px rgba(198, 40, 40, 0.3);
}

.simon-red.lit {
  background: radial-gradient(circle at 40% 40%, #ef9a9a, #e53935);
  box-shadow: 0 0 50px rgba(244, 67, 54, 0.6);
}

.simon-yellow {
  background: radial-gradient(circle at 40% 40%, #ffd54f, #f9a825);
  box-shadow: 0 0 20px rgba(249, 168, 37, 0.3);
}

.simon-yellow.lit {
  background: radial-gradient(circle at 40% 40%, #ffe082, #fdd835);
  box-shadow: 0 0 50px rgba(255, 235, 59, 0.6);
}

.simon-blue {
  background: radial-gradient(circle at 40% 40%, #42a5f5, #1565c0);
  box-shadow: 0 0 20px rgba(21, 101, 192, 0.3);
}

.simon-blue.lit {
  background: radial-gradient(circle at 40% 40%, #90caf9, #1e88e5);
  box-shadow: 0 0 50px rgba(33, 150, 243, 0.6);
}

/* ── Center Circle ──────────────────────────────────────────────── */
.simon-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 40% 40%, #2a2a4a, #0d0d1a);
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.simon-center-inner {
  text-align: center;
  color: var(--text-secondary);
}

.simon-center-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.15rem;
}

.simon-center-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
}

/* ── Game Over Overlay ───────────────────────────────────────────── */
.simon-gameover {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.simon-gameover-content {
  text-align: center;
  color: #fff;
  padding: 1.5rem;
}

.simon-gameover-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.simon-gameover-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--fw-bold);
  margin-bottom: 0.5rem;
  color: #fff;
}

.simon-gameover-content p {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--fs-base);
  margin-bottom: 0.3rem;
}

.simon-gameover-content .control-btn {
  margin-top: 1rem;
  background: var(--accent-purple);
  color: #fff;
  border: none;
  padding: 0.6rem 1.8rem;
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: transform var(--transition-spring), box-shadow var(--transition-base);
}

.simon-gameover-content .control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(124, 109, 250, 0.4);
}

/* ── Board Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .simon-board {
    max-width: 380px;
    padding: 16px;
    gap: 12px;
  }
  .simon-label {
    font-size: 1.4rem;
  }
  .simon-center-icon {
    font-size: 1.5rem;
  }
  .simon-center-label {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .simon-board {
    max-width: 320px;
    padding: 12px;
    gap: 10px;
  }
  .simon-label {
    font-size: 1.2rem;
  }
  .simon-center-icon {
    font-size: 1.2rem;
  }
  .simon-center-label {
    font-size: 0.6rem;
  }
  .simon-center {
    width: 36%;
  }
}

@media (max-width: 360px) {
  .simon-board {
    max-width: 270px;
    padding: 8px;
    gap: 6px;
  }
  .simon-label {
    font-size: 1rem;
  }
}

/* ══════════════════════════════════════════════════════════════════
   STATS ROW
   ══════════════════════════════════════════════════════════════════ */

.game-stats-row {
  display: flex;
  justify-content: space-around;
  width: 100%;
  padding: var(--space-3) 0;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.game-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 60px;
}

.game-stat-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  font-weight: var(--fw-medium);
}

.game-stat-value {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: 1.2;
  transition: font-size var(--transition-base);
}

/* ── Responsive Stats Values ── */
@media (max-width: 768px) {
  .game-stat-value {
    font-size: var(--fs-lg);
  }
}

@media (max-width: 480px) {
  .game-stat-item {
    min-width: 45px;
  }
  .game-stat-label {
    font-size: 0.55rem;
    letter-spacing: var(--ls-wide);
  }
  .game-stat-value {
    font-size: var(--fs-base);
  }
}

@media (max-width: 360px) {
  .game-stat-value {
    font-size: var(--fs-sm);
  }
  .game-stat-label {
    font-size: 0.5rem;
  }
  .game-stats-row {
    gap: var(--space-1);
    padding: var(--space-2) 0;
  }
}

/* ══════════════════════════════════════════════════════════════════
   GAME STATUS MESSAGE
   ══════════════════════════════════════════════════════════════════ */

.game-status {
  font-family: var(--font-display);
  font-size: clamp(var(--fs-base), 2vw, var(--fs-lg));
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  text-align: center;
  min-height: 1.8em;
  letter-spacing: var(--ls-snug);
  transition: color var(--transition-base);
  padding: var(--space-1) 0;
  margin: 0;
}

.game-status.status--playing {
  color: var(--accent-teal);
}
.game-status.status--watch {
  color: var(--accent-purple);
}
.game-status.status--gameover {
  color: var(--accent-red);
}

@media (max-width: 480px) {
  .game-status {
    font-size: var(--fs-sm);
    min-height: 1.5em;
  }
}

@media (max-width: 360px) {
  .game-status {
    font-size: var(--fs-xs);
    min-height: 1.2em;
  }
}

/* ── Score bump animation ───────────────────────────────────────── */
.score-bump {
  animation: scoreBump 0.35s var(--ease-spring) both;
}

@keyframes scoreBump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.45); color: var(--accent-green); }
  100% { transform: scale(1); }
}

/* ══════════════════════════════════════════════════════════════════
   GAME CONTROLS — Desktop: title left, controls right
   ══════════════════════════════════════════════════════════════════ */

.simon-game-area .game-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: var(--space-2);
  width: 100%;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 48px;
  position: relative;
  z-index: 10;
  pointer-events: auto;
  touch-action: manipulation;
}

.simon-game-area .game-controls-title {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.4;
  text-align: left;
}

.simon-game-area .game-controls-title span {
  margin-right: 2px;
}

.simon-game-area .game-controls .game-controls-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: nowrap;
}

/* ── Ensure all controls have identical height ── */
.simon-game-area .game-controls .control-btn,
.simon-game-area .game-controls .control-btn.control-btn--primary,
.simon-game-area .game-controls .difficulty-select,
#startBtn,
#soundBtn,
#difficultySelect {
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  line-height: 1;
  box-sizing: border-box;
}

.simon-game-area .game-controls .game-controls-right .difficulty-select {
  flex: 0 1 auto;
  min-width: 85px;
  max-width: 120px;
  padding: var(--space-1) var(--space-6) var(--space-1) var(--space-2);
  font-size: var(--fs-xs);
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239898b8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.simon-game-area .game-controls .game-controls-right .control-btn {
  flex: 0 0 auto;
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-xs);
  min-height: 32px;
  height: 32px;
  min-width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  box-sizing: border-box;
  white-space: nowrap;
}

.simon-game-area .game-controls .game-controls-right .control-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
}

.simon-game-area .game-controls .game-controls-right .control-btn .btn-text {
  display: inline;
}

.simon-game-area .game-controls .game-controls-right .control-btn.control-btn--primary {
  background: var(--accent-purple-dim);
  color: var(--accent-purple);
  border-color: var(--border-accent);
}

.simon-game-area .game-controls .game-controls-right .control-btn.control-btn--primary:hover {
  background: var(--accent-purple);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — Title row 1, controls row 2
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .simon-game-area .game-controls {
    flex-wrap: wrap;
    gap: var(--space-1);
    padding-bottom: var(--space-2);
    justify-content: space-between;
    min-height: 36px;
  }

  .simon-game-area .game-controls-title {
    font-size: var(--fs-sm);
    flex: 0 0 100%;
    text-align: left;
    padding-bottom: var(--space-1);
    margin-bottom: var(--space-1);
  }

  .simon-game-area .game-controls .game-controls-right {
    flex: 0 0 100%;
    justify-content: center;
    gap: var(--space-1);
    flex-wrap: wrap;
  }

  .simon-game-area .game-controls .game-controls-right .difficulty-select {
    min-width: 80px;
    max-width: 110px;
    font-size: 0.6rem;
    height: auto;
    min-height: 28px;
    padding: 4px var(--space-4) 4px var(--space-2);
    padding-right: 20px;
    background-size: 8px 5px;
    background-position: right 5px center;
    border-radius: var(--radius-sm);
  }

  .simon-game-area .game-controls .game-controls-right .control-btn {
    padding: 4px var(--space-2);
    font-size: 0.6rem;
    min-height: 28px;
    height: auto;
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    border-radius: var(--radius-sm);
  }

  .simon-game-area .game-controls .game-controls-right .control-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
  }

  .simon-game-area .game-controls .game-controls-right .control-btn .btn-text {
    display: inline;
    font-size: 0.6rem;
  }

  .simon-game-area .game-controls .game-controls-right .control-btn.control-btn--primary .btn-text {
    display: inline;
    font-size: 0.6rem;
  }

  .simon-game-area .game-controls .control-btn,
  .simon-game-area .game-controls .control-btn.control-btn--primary,
  .simon-game-area .game-controls .difficulty-select,
  #startBtn,
  #soundBtn,
  #difficultySelect {
    min-height: 28px;
    height: auto;
  }
}

/* ══════════════════════════════════════════════════════════════════
   VERY SMALL SCREEN (≤400px)
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 400px) {
  .simon-game-area .game-controls-title {
    font-size: 0.7rem;
    padding-bottom: var(--space-0.5);
    margin-bottom: var(--space-0.5);
  }

  .simon-game-area .game-controls .game-controls-right {
    gap: var(--space-0.5);
  }

  .simon-game-area .game-controls .game-controls-right .difficulty-select {
    min-width: 65px;
    max-width: 85px;
    font-size: 0.5rem;
    min-height: 24px;
    padding: 3px var(--space-3) 3px var(--space-1);
    padding-right: 16px;
    background-size: 6px 4px;
    background-position: right 4px center;
  }

  .simon-game-area .game-controls .game-controls-right .control-btn {
    padding: 3px var(--space-1);
    font-size: 0.5rem;
    min-height: 24px;
    min-width: 24px;
  }

  .simon-game-area .game-controls .game-controls-right .control-btn svg {
    width: 10px;
    height: 10px;
  }

  .simon-game-area .game-controls .game-controls-right .control-btn .btn-text {
    font-size: 0.5rem;
  }

  .simon-game-area .game-controls .game-controls-right .control-btn.control-btn--primary .btn-text {
    display: inline;
    font-size: 0.5rem;
  }

  .simon-game-area .game-controls .control-btn,
  .simon-game-area .game-controls .control-btn.control-btn--primary,
  .simon-game-area .game-controls .difficulty-select,
  #startBtn,
  #soundBtn,
  #difficultySelect {
    min-height: 24px;
    height: auto;
  }
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE CLICK FIX
   ══════════════════════════════════════════════════════════════════ */

button,
a,
.control-btn,
.primary-btn,
.secondary-btn,
.nav-toggle,
.theme-toggle,
.play-btn,
.game-card-link,
.game-card a,
.difficulty-select,
.simon-btn,
.simon-board,
.simon-gameover,
.simon-gameover button,
.simon-gameover .control-btn,
.simon-gameover-content .control-btn,
.simon-game-area .control-btn,
.simon-game-area .game-controls select,
.simon-game-area .game-controls button {
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
  cursor: pointer !important;
}

/* Simon buttons need special touch handling */
.simon-btn {
  touch-action: none !important;
}

.nav-overlay {
  pointer-events: none !important;
}
.nav-overlay.is-visible {
  pointer-events: auto !important;
}

.mobile-nav a {
  pointer-events: auto !important;
  touch-action: manipulation !important;
}

.ad-container,
.ad-placeholder,
.adsbygoogle {
  pointer-events: none !important;
}
.ad-container .adsbygoogle {
  pointer-events: auto !important;
}