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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0eeff;
  color: #1e1a2e;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ===== Augšējā josla ===== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  font-size: 13px;
  color: #8878b0;
  letter-spacing: 0.05em;
}

/* ===== Virsraksts ===== */
.title {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.15;
  background: linear-gradient(135deg, #a78bfa, #60a5fa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.underline {
  border-bottom: 2px solid #a78bfa;
  padding-bottom: 2px;
  -webkit-text-fill-color: unset;
  color: #a78bfa;
}

.subtitle {
  font-size: 17px;
  color: #7070a0;
  margin-bottom: 2.5rem;
  max-width: 480px;
}

/* ===== Karšu režģis (pogas uz citām lapām) ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 3rem;
}

.card {
  background: rgba(109, 74, 191, 0.06);
  border: 1px solid rgba(109, 74, 191, 0.18);
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
  display: block;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(109, 74, 191, 0.1), rgba(167, 139, 250, 0.08));
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: 16px;
  pointer-events: none;
}

.card:hover {
  border-color: rgba(109, 74, 191, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(109, 74, 191, 0.12);
}

.card:hover::before {
  opacity: 1;
}

.card-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  color: #2d1e60;
  position: relative;
}

.card-sub {
  font-size: 13px;
  color: #7070a0;
  position: relative;
}

/* ===== Blob sadaļa ===== */
.blob-section {
  background: rgba(109, 74, 191, 0.06);
  border: 1px solid rgba(109, 74, 191, 0.18);
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.hint {
  font-size: 13px;
  color: #7070a0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

.blob-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

#blob-svg {
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease;
  filter: drop-shadow(0 0 20px rgba(167, 139, 250, 0.5));
}

.counter {
  font-size: 13px;
  color: #7070a0;
  margin-top: 1.5rem;
}

/* ===== Apakšējais footer ===== */
.footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(109, 74, 191, 0.2);
}

.footer a {
  color: #7070a0;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: #6d4abf;
}

/* ===== DVD sadaļa ===== */
.dvd-section {
  margin-bottom: 2rem;
}

.dvd-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #1a1030;
  border: 1px solid rgba(109, 74, 191, 0.25);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.4s ease;
}

.dvd-box:hover {
  box-shadow: 0 0 32px rgba(109, 74, 191, 0.2);
}

@keyframes rgb-glow {
  0%   { filter: hue-rotate(0deg)   drop-shadow(0 0 8px  rgba(167,139,250,0.95)) drop-shadow(0 0 22px rgba(167,139,250,0.5)); }
  25%  { filter: hue-rotate(90deg)  drop-shadow(0 0 16px rgba(167,139,250,1.0))  drop-shadow(0 0 40px rgba(167,139,250,0.75)); }
  50%  { filter: hue-rotate(180deg) drop-shadow(0 0 8px  rgba(167,139,250,0.95)) drop-shadow(0 0 22px rgba(167,139,250,0.5)); }
  75%  { filter: hue-rotate(270deg) drop-shadow(0 0 16px rgba(167,139,250,1.0))  drop-shadow(0 0 40px rgba(167,139,250,0.75)); }
  100% { filter: hue-rotate(360deg) drop-shadow(0 0 8px  rgba(167,139,250,0.95)) drop-shadow(0 0 22px rgba(167,139,250,0.5)); }
}

.dvd-logo {
  position: absolute;
  left: 0;
  top: 0;
  padding: 8px 16px;
  font-weight: 900;
  font-size: 28px;
  font-style: italic;
  letter-spacing: -0.05em;
  color: #a78bfa;
  user-select: none;
  font-family: Arial, sans-serif;
  will-change: transform, filter;
  animation: rgb-glow 2.5s ease-in-out infinite;
}

.dvd-stats {
  position: absolute;
  top: 12px;
  left: 16px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 11px;
  font-family: monospace;
  pointer-events: none;
}

.dvd-help {
  position: absolute;
  bottom: 12px;
  right: 16px;
  color: rgba(255, 255, 255, 0.18);
  font-size: 10px;
  font-family: monospace;
  pointer-events: none;
}

@keyframes corner-rgb {
  0%   { box-shadow: 0 0 55px #ff3366, 0 0 110px rgba(255,51,102,0.45); border-color: #ff3366; }
  16%  { box-shadow: 0 0 55px #ff9933, 0 0 110px rgba(255,153,51,0.45); border-color: #ff9933; }
  33%  { box-shadow: 0 0 55px #ffee33, 0 0 110px rgba(255,238,51,0.45); border-color: #ffee33; }
  50%  { box-shadow: 0 0 55px #33ff66, 0 0 110px rgba(51,255,102,0.45); border-color: #33ff66; }
  66%  { box-shadow: 0 0 55px #3399ff, 0 0 110px rgba(51,153,255,0.45); border-color: #3399ff; }
  83%  { box-shadow: 0 0 55px #cc33ff, 0 0 110px rgba(204,51,255,0.45); border-color: #cc33ff; }
  100% { box-shadow: 0 0 55px #ff3366, 0 0 110px rgba(255,51,102,0.45); border-color: #ff3366; }
}

.dvd-corner-flash {
  animation: corner-rgb 0.4s linear 5;
}

/* ===== Ātruma reakcija ===== */
.reakcija-section {
  margin: 2rem 0 3rem;
}

.reakcija-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.reakcija-btn {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: none;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  user-select: none;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.reakcija-btn.idle,
.reakcija-btn.result {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 6px 24px rgba(59,130,246,0.45);
}

.reakcija-btn.idle:hover,
.reakcija-btn.result:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 34px rgba(59,130,246,0.6);
}

.reakcija-btn.idle:active,
.reakcija-btn.result:active {
  transform: scale(0.97);
}

@keyframes pulse-blue {
  0%, 100% { box-shadow: 0 6px 24px rgba(59,130,246,0.45); }
  50% { box-shadow: 0 6px 40px rgba(59,130,246,0.85), 0 0 0 10px rgba(59,130,246,0.15); }
}

.reakcija-btn.waiting {
  background: #3b82f6;
  color: #fff;
  animation: pulse-blue 1.2s ease-in-out infinite;
  cursor: pointer;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 6px 30px rgba(239,68,68,0.65), 0 0 0 6px rgba(239,68,68,0.2); transform: scale(1); }
  50% { box-shadow: 0 6px 52px rgba(239,68,68,0.9), 0 0 0 16px rgba(239,68,68,0.35); transform: scale(1.06); }
}

.reakcija-btn.active {
  background: #ef4444;
  color: #fff;
  font-size: 24px;
  animation: pulse-red 0.55s ease-in-out infinite;
  cursor: pointer;
}

.reakcija-msg {
  font-size: 15px;
  color: #7070a0;
  text-align: center;
  min-height: 22px;
  font-family: monospace;
}

.reakcija-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-height: 74px;
}

.react-label {
  font-size: 11px;
  color: #a090c8;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 2px;
}

.react-score {
  font-size: 14px;
  color: #7070a0;
  font-family: monospace;
}

.react-score.best {
  font-size: 15px;
  color: #6d4abf;
  font-weight: 600;
}

/* ===== Lai izskatās labi arī telefonā ===== */
@media (max-width: 480px) {
  .title {
    font-size: 28px;
  }
  .subtitle {
    font-size: 15px;
  }
}

/* ===== Kopīgās pogas ===== */
.btn-primary {
  background: #6d4abf;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: block;
}
.btn-primary:hover:not(:disabled) { background: #7d5acf; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: rgba(109, 74, 191, 0.08);
  color: #6d4abf;
  border: 1px solid rgba(109, 74, 191, 0.25);
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: block;
}
.btn-secondary:hover { background: rgba(109, 74, 191, 0.14); }

/* ===== Stili apakšlapām ===== */
.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(109, 74, 191, 0.2);
}

.game-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 99px;
  background: rgba(109, 74, 191, 0.06);
  border: 1px solid rgba(109, 74, 191, 0.15);
}

.game-toolbar a {
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  color: #6d5a99;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.game-toolbar a:hover { background: rgba(109, 74, 191, 0.14); color: #2d1e60; }

@media (max-width: 640px) {
  .game-toolbar { order: 3; width: 100%; justify-content: space-between; }
  .game-toolbar a { flex: 1; text-align: center; padding: 7px 4px; font-size: 11.5px; }
}

.path {
  font-size: 13px;
  color: #a090c8;
  font-family: monospace;
}

.back-link {
  font-size: 14px;
  color: #7070a0;
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: #6d4abf;
}

.page-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2d1e60;
}

.page-content {
  font-size: 16px;
  color: #7070a0;
  margin-bottom: 2rem;
}
