/* =========================
   SYNKLY THEME (BLUE)
   - Drop-in replacement for your existing CSS
========================= */

:root{
  /* Core */
  --bg: #f4f7fb;
  --card: #ffffff;
  --card-soft: rgba(255,255,255,0.86);
  --border: #dbe3f0;

  --text: #0f172a;
  --muted: #475569;

  /* Brand */
  --primary: #2563eb;       /* Synkly blue */
  --primary-soft: #38bdf8;  /* Light blue */
  --primary-ink: #0b2a3a;

  /* States */
  --row-alt: #f8fafc;
  --row-alt2: #eef6ff;

  --badge: #2563eb;
  --badge-ink: #ffffff;

  --new-bg: #eef6ff;
  --new-border: #38bdf8;

  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --radius: 14px;
}

/* =========================
   RESET & BAS
========================= */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1000px 600px at 20% 10%, rgba(56,189,248,.18), transparent 60%),
    radial-gradient(900px 600px at 85% 30%, rgba(37,99,235,.18), transparent 60%),
    var(--bg);
  color: var(--text);
  margin: 0;
  padding: 16px;
}

/* =========================
   RUBRIKER
========================= */
h1, h2, h3 {
  color: var(--text);
  text-align: center;
  margin: 0 0 12px;
}

/* =========================
   HEADER / MENY
========================= */
header { text-align: center; margin-bottom: 12px; }

.menu a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  margin: 0 8px;
}
.menu a:hover { text-decoration: underline; }

/* =========================
   BAKGRUNDSBILD
========================= */
.background-image {
  position: fixed;
  inset: 0;
  /* Byt gärna till synkly-logo/mark om du vill:
     background: url('../images/synkly-mark.png') no-repeat center center;
  */
  background: url('../images/synkly-logo.png') no-repeat center center;
  background-size: 95%;
  opacity: 0.06;          /* mer diskret */
  z-index: -1;
  pointer-events: none;
  filter: saturate(0.6) hue-rotate(165deg); /* gör kvarvarande rosa mer blåtonad */
}

/* =========================
   LOADER
========================= */
#page-loader {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(56,189,248,.14), transparent 60%),
    radial-gradient(800px 600px at 85% 30%, rgba(37,99,235,.14), transparent 60%),
    #f7fbff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: var(--primary);
}
.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid rgba(56,189,248,.35);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   GAME MATCHES – TABELL
========================================================= */
.table-viewport {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

/* Table shell */
.match-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  table-layout: fixed;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.match-table th,
.match-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.match-table th {
  background: linear-gradient(180deg, rgba(37,99,235,.10), rgba(56,189,248,.08));
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.mm-row.row-even { background: #ffffff; }
.mm-row.row-odd  { background: var(--row-alt); }

/* =========================
   SORTERING
========================= */
.sort-indicator {
  font-size: 0.7em;
  margin-left: 4px;
  opacity: 0.8;
}

/* =========================
   NY / 24H BADGES
========================= */
.badge-new-user { margin-right: 4px; }

.badge-new-24h {
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: var(--badge-ink);
  font-size: 0.65em;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 4px;
}

.mm-row.new-since-last {
  background: var(--new-bg);
  border-left: 4px solid var(--new-border);
}

/* =========================================================
   REAKTIONER – STABIL SLUTVERSION
========================================================= */

/* 🔑 Reaktionskolumn */
.match-table th:nth-child(6),
.match-table td:nth-child(6) {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
  padding: 4px 2px;
  text-align: center;
  vertical-align: top;
}

/* Visade reaktioner (namn) */
.match-table td:nth-child(6) > div[id^="reactions_"] {
  font-size: 9px;
  line-height: 1.05;
  margin-bottom: 3px;
  overflow: hidden;
  color: var(--muted);
}

/* Emoji-grid: 2 × 3 */
.reaction-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 14px;
  gap: 2px;
  justify-items: center;
}

/* Emoji-knappar */
.reaction-btn {
  all: unset;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.reaction-btn:hover {
  transform: scale(1.15);
  filter: brightness(1.03);
}
.reaction-btn:focus-visible{
  outline: 2px solid rgba(37,99,235,.45);
  outline-offset: 1px;
}

.emoji-users {
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
  color: var(--muted);
}

/* =========================================================
   MOBIL – TABELL
========================================================= */
@media (max-width: 700px) {

  .match-table { font-size: 0.75rem; line-height: 1.15; }

  .match-table th,
  .match-table td { padding: 4px 5px; }

  /* Kategori */
  .match-table th:nth-child(1),
  .match-table td:nth-child(1) { width: 70px; }

  /* Din fråga */
  .match-table th:nth-child(2),
  .match-table td:nth-child(2) { width: 120px; }

  /* Ditt svar */
  .match-table th:nth-child(3),
  .match-table td:nth-child(3) {
    width: 64px;
    white-space: nowrap;
  }

  /* Motfråga */
  .match-table th:nth-child(4),
  .match-table td:nth-child(4) { width: 120px; }

  /* Partnerns svar */
  .match-table th:nth-child(5),
  .match-table td:nth-child(5) {
    width: 64px;
    white-space: nowrap;
  }

  /* Reaktioner */
  .match-table th:nth-child(6),
  .match-table td:nth-child(6) {
    width: 82px;
    min-width: 82px;
    max-width: 82px;
    font-size: 9px;
  }

  /* Dölj */
  .match-table th:last-child,
  .match-table td:last-child { width: 60px; }
}

/* =========================================================
   QUESTIONS – ÅTERSTÄLLT (ANDRA SIDOR)
========================================================= */
.question-block {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding-top: 24px;
}

.question-title { font-size: 1.6rem; margin-bottom: 8px; }

.question-text {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 28px;
  line-height: 1.35;
  color: var(--text);
}

.answer-options {
  display: flex;
  justify-content: center;
  gap: 28px;
}

.answer-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.answer-option:hover { transform: scale(1.12); }

.answer-image {
  width: 80px;
  max-width: 80px;
  height: auto;
}

.answer-label {
  margin-top: 4px;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--primary);
}

/* MOBIL – FOOTER */
@media (max-width: 768px) {
  body { padding-bottom: 140px; }

  .answer-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
      180deg,
      rgba(244,247,251,0.92),
      rgba(244,247,251,1)
    );
    border-top: 1px solid var(--border);
    padding: 14px 10px 18px;
    z-index: 100;
    backdrop-filter: blur(6px);
  }

  .answer-options { justify-content: space-around; gap: 0; }

  .answer-image { width: 64px; max-width: 64px; }
  .answer-label { font-size: 0.85rem; }
}

/* =========================
   KATEGORI-FILTER
========================= */

/* Desktop: grid som fyller bra */
#category-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 12px;
}

/* Kort */
.category-filter-card {
  position: relative;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card-soft);
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  min-width: 0;              /* viktigt för långa namn */
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.category-filter-card:hover { transform: translateY(-1px); }

.category-filter-card.inactive {
  opacity: 0.35;
  filter: grayscale(1);
}

/* Header: namn + total (total på egen rad om namnet blir långt) */
.cat-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

.cat-name {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.15;
  word-break: break-word;
  color: var(--text);
}

.cat-total {
  font-size: 0.75rem;
  opacity: 0.75;
  color: var(--muted);
}

/* Stats: 2×2 */
.cat-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 6px;
  margin-top: 6px;
  text-align: center;
}

.cat-stats .stat {
  font-size: 0.7rem;
  line-height: 1.15;
  padding: 3px 0;
  border-radius: 8px;
  white-space: nowrap;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

/* Färger (Synkly) */
.stat.perfect  { background: rgba(37,99,235,.10); color: var(--primary-ink); }
.stat.maybe    { background: rgba(56,189,248,.14); color: var(--primary-ink); }
.stat.silent   { background: rgba(148,163,184,.18); color: var(--primary-ink); }
.stat.conflict { background: rgba(251,191,36,.18); color: #5b3b00; } /* mild “gul” */
.stat.locked   { background: rgba(239,68,68,.12); color: #5a0a0a; }  /* mild röd */

/* ✅ MOBIL: alltid 2 kort per rad */
@media (max-width: 600px) {
  #category-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 🔥 2 per rad */
    gap: 8px;
    margin: 10px;
  }

  .category-filter-card { padding: 8px 10px; }

  .cat-name { font-size: 0.9rem; }

  .cat-stats .stat { font-size: 0.68rem; }

  /* dölj procent på mobil (om du vill behålla som innan) */
  .cat-stats .stat span { display: none; }
}

.mm-row.is-hidden-row td { font-style: italic; }
.mm-row.is-hidden-row {
  opacity: 0.5;
  background: rgba(148,163,184,.16);
}

.stat.locked { opacity: 0.95; font-weight: 700; }
.stat.locked.dimmed { opacity: 0.3; }

/* =========================================================
   IMAGE MODAL
========================================================= */
.match-thumb {
  width: 60px;
  margin-top: 6px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

#image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

#image-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
}

#image-modal-img {
  position: absolute;
  max-width: 90%;
  max-height: 90%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0,0,0,0.45);
}

/* =========================================================
   TABS (för att inte bryta i varje span)
========================================================= */
#tabs {
  display: flex;
  flex-wrap: wrap;
  overflow-x: auto;
  gap: 6px;
}

#tabs .tab {
  white-space: nowrap;
  flex-shrink: 0;
}
/* =========================================================
   SYNKLY UI KIT – FORMS / BUTTONS / CARDS / TABLES
   (Bra för edit_game.php och admin-sidor)
========================================================= */

/* Containers */
.container {
  max-width: 980px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card.soft {
  background: var(--card-soft);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.section-title {
  text-align: left;
  margin: 0 0 10px;
  font-size: 1.15rem;
}

/* Simple layout helpers */
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.row > * { min-width: 180px; }

.stack { display: grid; gap: 10px; }
.spacer { height: 10px; }

/* Topbar (valfri) */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin: 0 auto 12px;
  border-radius: var(--radius);
  background: var(--card-soft);
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.topbar .title {
  font-weight: 800;
  color: var(--text);
}
.topbar a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}
.topbar a:hover { text-decoration: underline; }

/* Buttons */
.btn,
button,
input[type="submit"],
input[type="button"]{
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover{
  transform: translateY(-1px);
  filter: brightness(0.99);
}

.btn:active,
button:active,
input[type="submit"]:active,
input[type="button"]:active{
  transform: translateY(0px);
}

.btn-primary,
button.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  box-shadow: 0 12px 30px rgba(37,99,235,.28);
}
.btn-primary:hover,
button.primary:hover{
  box-shadow: 0 16px 40px rgba(37,99,235,.32);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger,
button.danger {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #fb7185);
  box-shadow: 0 12px 30px rgba(239,68,68,.22);
}

.btn-small {
  padding: 7px 10px;
  font-size: 13px;
}

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
select,
textarea{
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.95);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: box-shadow .12s ease, border-color .12s ease;
}

textarea { min-height: 110px; resize: vertical; }

input:focus,
select:focus,
textarea:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  display: inline-block;
  margin: 8px 0 6px;
}

/* Checkboxes/radios (lätta och snygga) */
input[type="checkbox"],
input[type="radio"]{
  accent-color: var(--primary);
}

/* Small helper text */
.help {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
}

/* Notices / Alerts */
.notice {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(37,99,235,.18);
  background: rgba(37,99,235,.06);
  color: var(--text);
}
.notice.success {
  border-color: rgba(16,185,129,.22);
  background: rgba(16,185,129,.10);
}
.notice.warn {
  border-color: rgba(251,191,36,.28);
  background: rgba(251,191,36,.14);
}
.notice.danger {
  border-color: rgba(239,68,68,.22);
  background: rgba(239,68,68,.10);
}

/* Generic tables (för admin). Din .match-table påverkas inte */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  font-size: 0.92rem;
}
.table th, .table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.table th {
  background: linear-gradient(180deg, rgba(37,99,235,.10), rgba(56,189,248,.08));
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}
.table tr:nth-child(even) td { background: var(--row-alt); }

/* Links */
a { color: var(--primary); }
a:hover { color: #1d4ed8; }

/* Small chips/tags (praktiskt i edit_game) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(56,189,248,.14);
  color: var(--primary-ink);
  border: 1px solid rgba(56,189,248,.25);
  font-size: 13px;
  font-weight: 700;
}

/* Mobile polish */
@media (max-width: 700px){
  .card { padding: 14px; }
  input[type="text"], select, textarea { max-width: 100%; }
  .topbar { padding: 10px 12px; }
}
/* =========================================================
   EDIT GAME – PAGE SPECIFIC
========================================================= */

.edit-game-card{
  max-width: 520px;
  margin: 0 auto;
}

.category-list-edit{
  margin: 10px 0 6px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.cat-check{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.98rem;
  color: var(--text);
}

.cat-check input[type="checkbox"]{
  width: 18px;
  height: 18px;
}

.players-list{
  max-width: 360px;
  margin: 0 auto;
}

.players-ul{
  margin: 0;
  padding-left: 18px;
}

.invite-box{
  max-width: 620px;
  margin: 0 auto;
}

.invite-code-big{
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.5px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(37,99,235,.08);
  border: 1px solid rgba(37,99,235,.18);
  display: inline-block;
}

.invite-link{
  word-break: break-word;
  display: inline-block;
  margin-top: 6px;
  font-weight: 700;
}
/* =========================================================
   GAME MATCHES – EXTRA (tidigare inline)
========================================================= */

.top-controls { max-width: 1100px; margin: 0 auto; }
.center { text-align: center; margin-top: 8px; }

.fadeOut { animation: fadeOut 0.4s forwards; }
@keyframes fadeOut { to { opacity:0; transform: translateX(20px); } }

.fadeIn  { animation: fadeIn 0.4s forwards; }
@keyframes fadeIn { from { opacity:0; transform: translateX(-20px); } to { opacity:1; transform: translateX(0); } }

#hidden-container{
  display:none;
  padding: 10px;
  background: rgba(56,189,248,.10);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 10px;
  max-width: 1100px;
}
.hidden-item { margin-bottom: 10px; }

.no-category-hint{
  display:none;
  text-align:center;
  margin: 20px;
  color: var(--muted);
}

/* Om du använder outline-stilen för nya rader */
.new-since-last {
  outline: 2px dashed rgba(56,189,248,.55);
  outline-offset: -2px;
}

/* Om din JS fortfarande skapar reaction-grid med 3 kolumner någonstans:
   (du har redan 2x3 i Synkly-CSS, men denna kan vara backup)
*/
/*
.reaction-grid {
  grid-template-columns: repeat(3, max-content);
  gap: 6px 10px;
  justify-content: center;
  margin-top: 6px;
}
*/

/* =========================================================
   LOBBY (tabs + listor)
========================================================= */

.lobby-message{
  color: #b91c1c;
  text-align: center;
  font-weight: 600;
  margin: 10px 0 0;
}

/* Tabs */
.tabs{
  display:flex;
  gap: 6px;
  margin: 15px auto;
  max-width: 1100px;
  justify-content: center;
  flex-wrap: wrap;
}

.tab-btn{
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  background: rgba(255,255,255,0.7);
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
}

.tab-btn.active{
  background: linear-gradient(135deg, rgba(37,99,235,.16), rgba(56,189,248,.14));
}

/* Content – viktigt: INTE dubbla regler med !important */
.tab-content{
  display:none;
  padding: 16px 0 0;
  max-width: 1100px;
  margin: 0 auto;
}
.tab-content.active{ display:block; }

/* Game list */
.ongoing-games ul{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap: 12px;
}

.game-card{
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.game-title-link{
  font-size: 1.15em;
  font-weight: 900;
  color: var(--primary);
  text-decoration: none;
}
.game-title-link:hover{ text-decoration: underline; }

.game-meta{
  color: var(--muted);
  font-size: 0.95em;
  margin-top: 6px;
}

.game-actions{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Forms */
.lobby-form{
  text-align:center;
  max-width: 420px;
  margin: 0 auto;
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.lobby-form input[type="text"]{
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  outline: none;
}

.category-list{
  text-align:left;
  margin-top: 8px;
}

.category-list label{
  display:flex;
  align-items:center;
  gap: 8px;
  margin: 3px 0;
}
/* =========================================================
   PROFILE
========================================================= */

.profile-box{
  max-width: 520px;
  margin: 0 auto;
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.profile-push{
  display:flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.profile-info{
  text-align:center;
  color: var(--text);
  display:grid;
  gap: 6px;
  margin: 10px 0 14px;
}

.section-title{
  text-align:center;
  margin: 16px 0 10px;
}

.message{
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
  font-weight: 600;
}

.message.success{
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.22);
  color: #14532d;
}

.message.error{
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.20);
  color: #7f1d1d;
}

/* Game list inside profile */
.games-list{
  list-style:none;
  padding:0;
  margin: 0 0 12px;
  display:grid;
  gap: 10px;
}

.game-item{
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.game-link{
  color: var(--primary);
  font-weight: 900;
  text-decoration:none;
}
.game-link:hover{ text-decoration: underline; }

.game-sub{
  color: var(--muted);
  font-size: 0.95em;
  margin-top: 6px;
}

/* Forms */
.profile-form{
  display:grid;
  gap: 8px;
  justify-items: center;
}

.profile-form label{
  width: 100%;
  max-width: 360px;
  font-weight: 800;
  color: var(--text);
  text-align:left;
}

.profile-form input[type="text"],
.profile-form input[type="password"],
.profile-form input[type="email"]{
  width: 100%;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  outline: none;
  background: #fff;
}

.profile-form input:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
/* =========================================================
   MATCH INSIGHTS
========================================================= */

.insights-wrap{
  max-width: 900px;
  margin: 0 auto;
}

.insights-title{
  text-align: center;
  margin: 6px 0 14px;
}

.insight-card{
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.insight-title{
  margin: 0 0 10px;
  text-align: left;
}

.insight-cat-row{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  padding: 6px 0 2px;
}

.insight-cat-name{
  color: var(--text);
  word-break: break-word;
}

.insight-cat-pct{
  color: var(--primary);
  white-space: nowrap;
}

.insight-cat-sub{
  color: var(--muted);
  font-size: 0.9em;
  margin-bottom: 8px;
}

.insight-question{
  border-bottom: 1px dashed rgba(15,23,42,.18);
  padding: 10px 0;
}

.insight-question:last-child{
  border-bottom: none;
}

.insight-q-text{
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.insight-q-meta{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.muted{
  color: var(--muted);
  font-size: 0.92em;
}

/* Tags */
.tag{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78em;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(148,163,184,.18);
  color: var(--primary-ink);
}

.tag.yes{
  background: rgba(34,197,94,.14);
  border-color: rgba(34,197,94,.22);
}

.tag.maybe{
  background: rgba(251,191,36,.18);
  border-color: rgba(251,191,36,.28);
}

.tag.neutral{
  background: rgba(56,189,248,.14);
  border-color: rgba(56,189,248,.24);
}

/* =========================================================
   QUESTIONS – animationer & toast (Synkly-blå)
========================================================= */

/* 🔢 räknare blink */
.remaining-counter strong{
  transition: transform 0.25s ease, color 0.25s ease;
}
.remaining-counter strong.blink{
  transform: scale(1.3);
  color: var(--primary);
}

/* 🎬 ENDA animationen – rör INGET annat */
.question-title,
.question-text{
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.q-exit{
  opacity: 0;
  transform: translateX(-20px);
}

.q-enter{
  opacity: 0;
  transform: translateX(20px);
}

/* 🔔 Match-toast (Synkly-blå) */
.match-toast{
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: #fff;
  padding: 14px 20px;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
  z-index: 9999;
  animation: toastIn 0.25s ease;
  max-width: min(92vw, 520px);
  text-align: center;
}

@keyframes toastIn{
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
/* =========================================================
   GAME MATCHES – TABS (active + hover)
========================================================= */
#tabs .tab{
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.75);
  transition: transform .12s ease, opacity .12s ease, background .12s ease;
}

#tabs .tab:hover{
  transform: translateY(-1px);
}

#tabs .tab.active{
  background: linear-gradient(135deg, rgba(37,99,235,.14), rgba(56,189,248,.12));
  border-color: rgba(37,99,235,.35);
  font-weight: 800;
}

/* =========================================================
   EDIT GAME – KATEGORILISTA (kompakt)
========================================================= */

.category-list-edit{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 10px;                 /* 🔥 detta styr radavståndet */
  margin-top: 10px;
}

.cat-check{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;             /* klickyta utan att bli “luftigt” */
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.70);
  line-height: 1.2;              /* 🔥 stoppar “höga rader” */
  margin: 0;                     /* viktigt om label fått margin globalt */
}

.cat-check input{
  margin: 0;                     /* vissa browsers lägger konstiga margins */
  width: 18px;
  height: 18px;
}

.cat-check span{
  display: block;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

/* Mobil: 2 kolumner eller 1 om du vill */
@media (max-width: 600px){
  .category-list-edit{
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
/* =========================================================
   LOBBY – AKTIVA SPEL (kort/ruta runt varje spel)
========================================================= */

.ongoing_games ul{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

/* själva "rutan" */
.ongoing_games li{
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

/* rubriken */
.game-title-link{
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}
.game-title-link:hover{
  text-decoration: underline;
  color: var(--primary);
}

/* meta-rader */
.game-meta{
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* knapparna/länkarna */
.game-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.game-actions a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.75);
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
  transition: transform .12s ease, background .12s ease;
}
.game-actions a:hover{
  transform: translateY(-1px);
  background: rgba(56,189,248,.10);
}