/* LuajHub shared styles — design tokens and cross-page components.
   Loaded by every page BEFORE its own <style> block, so page CSS can override. */

:root {
  --bg: #14110f;
  --panel: #1d1916;
  --accent: #e8543e;
  --accent-soft: #f0a08f;
  --text: #f4ede4;
  --text-dim: #a39a8e;
  --cell-empty: #2a2521;
  --cell-fill: #f4ede4;
  --cell-correct: #4caf6e;
  --cell-wrong: #e8543e;
  --border-radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 64px;
  min-height: 100vh;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

header h1 {
  font-size: 1.8rem;
  margin: 0;
  letter-spacing: 0.5px;
}

header h1 span {
  color: var(--accent);
}

header p {
  color: var(--text-dim);
  margin: 4px 0 0;
  font-size: 0.95rem;
}

/* Back-to-hub pill — kept prominent so it's always easy to find */
.home-link {
  display: inline-block;
  color: var(--accent-soft);
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 10px;
}

.home-link:hover {
  background: var(--accent);
  color: #fff;
}

.puzzle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.puzzle-card {
  background: var(--panel);
  border: 1px solid #3a332c;
  border-radius: var(--border-radius);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.puzzle-card:hover {
  border-color: var(--accent);
  background: #241f1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Hub game cards are real links — keep the card look, drop link styling */
a.puzzle-card {
  text-decoration: none;
  color: inherit;
}

.puzzle-card-label {
  font-weight: 600;
  color: var(--text);
}

.leke-display {
  background: var(--panel);
  border: 1px solid #3a332c;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f0c674;
  white-space: nowrap;
}

.leke-display.flash-warning {
  animation: flashWarning 0.4s ease-in-out 2;
}

@keyframes flashWarning {
  0%, 100% { background: var(--panel); }
  50% { background: #4a2e2e; color: #fff; }
}

.difficulty {
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 20px;
  margin-left: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.diff-easy { background: #2e4a36; color: #8fd9a3; }
.diff-medium { background: #4a3f2e; color: #d9b88f; }
.diff-hard { background: #4a2e2e; color: #d98f8f; }
.diff-expert { background: #3a2e4a; color: #c49be8; }

/* Undo feedback (July 12): touched spots flash yellow, removals fade out
   softly. .undo-flash for pieces/cards/vehicles (filter keeps their own
   box-shadows intact), .undo-flash-cell for board squares/cells. */
@keyframes undoFlash {
  0%, 100% { filter: none; }
  35% { filter: brightness(1.4) drop-shadow(0 0 10px #f0c674); }
}

.undo-flash { animation: undoFlash 0.9s ease-in-out; }

@keyframes undoFlashCell {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(240, 198, 116, 0); }
  35% { box-shadow: inset 0 0 0 3px #f0c674, inset 0 0 18px rgba(240, 198, 116, 0.55); }
}

.undo-flash-cell { animation: undoFlashCell 0.9s ease-in-out; }

.undo-out {
  transition: opacity 0.3s ease, transform 0.3s ease !important;
  opacity: 0 !important;
  transform: scale(0.65) !important;
  pointer-events: none !important;
}

/* End-of-game "play another one" prompt (js/replay.js) */
.replay-panel {
  margin-top: 14px;
  text-align: center;
}

.replay-phrase {
  font-size: 0.95rem;
  color: var(--accent-soft);
  margin-bottom: 10px;
  line-height: 1.4;
}

.replay-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--border-radius);
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

button:hover { opacity: 0.85; }

button:disabled {
  opacity: 0.35;
  cursor: default;
}

button.secondary {
  background: var(--panel);
  color: var(--text-dim);
}

.status {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--accent-soft);
  text-align: center;
  min-height: 1.2em;
}
