/* Det gemensamma för spelen (spel/CLAUDE.md) och högerspalten på spel.php. Prefix: .spe- */

/* ---------- Sidan ---------- */
.spe-hero {
  background: linear-gradient(135deg, #0d2b3e, #164a66);
  color: #eaf6ff;
  padding: 2.5rem 1rem;
}
.spe-hero-inre { max-width: 868px; margin: 0 auto; }
.spe-hero-bred { max-width: 1168px; }
.spe-hero h1 { font-weight: 700; margin: 0 0 .35rem; }
.spe-hero p { color: #bcdcef; margin: 0; }

.spe-sida-spel { max-width: 900px; margin: 0 auto; padding: 1.75rem 1rem 3rem; }
.spe-sida-spel.spe-med-spalt { max-width: 1200px; }

/* Två kolumner med avskiljande linje, som i artikelportalen. */
.spe-med-spalt { display: grid; grid-template-columns: minmax(0, 1fr) 325px; column-gap: 1.5rem; align-items: start; }
.spe-innehall { min-width: 0; }
.spe-spalt { align-self: stretch; border-left: 1px solid #e2e8f0; padding-left: 1.5rem; }
.spe-ruta {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: 5px solid var(--primary, #2563eb);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, .05);
  margin-bottom: 1.25rem;
}
.spe-ruta h2 { font-size: 1.1rem; font-weight: 700; color: #0d2b3e; margin: 0 0 .75rem; }
.spe-artiklar { list-style: none; margin: 0; padding: 0; }
.spe-artiklar li { padding: .45rem 0; border-bottom: 1px solid #e5e7eb; }
.spe-artiklar li:last-child { border-bottom: none; }
.spe-artiklar a { display: block; font-weight: 600; line-height: 1.3; }
.spe-artiklar .spe-rad-info { display: block; margin-top: .1rem; }

/* Annonserna: koden är admins egen, så bilder och inbäddningar hålls inom sin plats. */
.spe-annons-kod { overflow: hidden; }
.spe-annons-kod img, .spe-annons-kod iframe { max-width: 100%; height: auto; }
.spe-annons-under { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #e2e8f0; }
.spe-annons-etikett { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin: 0 0 .5rem; }

/* ---------- Texterna runt spelet ---------- */
.spe-info {
  background: #f0f7fb;
  border-left: 4px solid var(--primary, #2563eb);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: .95rem;
  color: #1f2937;
}
.spe-info strong { color: #0d2b3e; }
.spe-info ul, .spe-info ol { margin: .5rem 0 0; padding-left: 1.25rem; }
.spe-disclaimer {
  margin-top: 2rem;
  font-size: .85rem;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

/* ---------- Knapparna ---------- */
.spe-knapp {
  display: inline-block;
  border: none;
  border-radius: 6px;
  padding: .6rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  background: #059669;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s ease, transform .1s ease;
}
.spe-knapp:hover { filter: brightness(1.08); color: #fff; }
.spe-knapp:active { transform: translateY(1px); }
.spe-knapp[disabled] { opacity: .5; cursor: not-allowed; }
.spe-knapp-stor { padding: .8rem 1.8rem; font-size: 1.15rem; }
.spe-knapp-gra { background: #475569; }
.spe-knapp-liten {
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 6px;
  padding: .35rem .7rem;
  font-size: .85rem;
  font-weight: 600;
  color: #eaf6ff;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
}
.spe-knapp-liten:hover { background: rgba(255, 255, 255, .18); }
.spe-knapp-liten[hidden] { display: none; }

/* ---------- Spelplanen med startrutan och slutrutan ----------
   Rutan läggs i samma cell som spelplanen, så att scenen växer om innehållet inte får plats (en smal spelplan). */
.spe-scen { position: relative; display: grid; border-radius: 12px; overflow: hidden; }
.spe-scen > * { grid-area: 1 / 1; min-width: 0; }
.spe-overlay {
  z-index: 5;
  background: rgba(13, 43, 62, .94);
  color: #eaf6ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  gap: .6rem;
}
.spe-overlay[hidden] { display: none; }
.spe-overlay h2 { margin: 0; font-size: 1.5rem; font-weight: 700; color: #eaf6ff; }
.spe-overlay p { margin: 0; color: #bcdcef; }
.spe-overlay a:not(.spe-knapp) { color: #eaf6ff; }

/* ---------- Spara resultatet ---------- */
.spe-spara { display: flex; flex-direction: column; align-items: center; gap: .45rem; }
.spe-spara-text { font-size: .9rem; }
.spe-spara-knappar { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.spe-spara-status { font-size: .85rem; min-height: 1.1em; }
.spe-visa-som { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; font-size: .9rem; }
.spe-spara .spe-visa-som { justify-content: center; }
.spe-visa-som select, .spe-visa-som input {
  max-width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: .3rem .5rem;
  font-size: .9rem;
  color: #0f172a;
  background: #fff;
}
.spe-visa-som input { width: 11rem; }
.spe-visa-som input[hidden] { display: none; }
.spe-osparat .spe-spara-text { margin: .3rem 0 .6rem; }
.spe-spara-status:empty { display: none; }

/* ---------- Topplistan ---------- */
.spe-topplista {
  margin-top: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}
.spe-topplista h2 { font-size: 1.05rem; font-weight: 700; color: #0d2b3e; margin: 0 0 .75rem; }
.spe-lista { list-style: none; margin: 0; padding: 0; }
.spe-lista li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .15rem .75rem;
  padding: .4rem 0;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
}
.spe-lista li:last-child { border-bottom: none; }
.spe-plats { flex: none; width: 1.5rem; font-weight: 700; color: #64748b; }
.spe-namn { flex: 1 1 8rem; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.spe-rad-info { font-size: .82rem; color: #64748b; white-space: nowrap; }
.spe-poang {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #059669;
  white-space: nowrap;
}
.spe-tom { color: #6b7280; margin: 0; }
#speOsparat:empty { display: none; }
.spe-osparat {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: .9rem;
  color: #1f2937;
}
.spe-osparat p { margin: 0 0 .5rem; }

@media (max-width: 800px) {
  .spe-med-spalt { grid-template-columns: 1fr; }
  .spe-spalt { margin-top: 1.5rem; border-left: 0; padding-left: 0; }
}

@media print {
  .spe-hero, .spe-scen, .spe-topplista, .spe-spalt, .spe-annons-under { display: none !important; }
}
