:root {
  --bg: #f5f1f8; --surface: #fffdfb; --surface-2: #efe8f3; --border: #ddd2e6;
  --text: #1e1530; --text-2: #594c6e; --muted: #8b809b;
  --accent: #5e2db8; --accent-ink: #ffffff; --accent-soft: #ebe1fa;
  --good: #1f7a45; --warn: #9a6200; --bad: #b3261e;
  --bar: #5e2db8; --gold: #a8780e;
  --radius: 10px; --shadow: 0 1px 3px rgba(20, 10, 40, .08);
}
/* mörkt tema: följer telefonen, om man inte valt ljust eller mörkt under Inställningar */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #110a1f; --surface: #1a1030; --surface-2: #24173f; --border: #392a5a;
    --text: #f1ebfa; --text-2: #bcaed3; --muted: #8a7ba3;
    --accent: #f0b93a; --accent-ink: #1a0f2e; --accent-soft: #3a2a18;
    --good: #6fd49a; --warn: #f0b93a; --bad: #ff7b72;
    --bar: #b07cff; --gold: #f0b93a;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #110a1f; --surface: #1a1030; --surface-2: #24173f; --border: #392a5a;
  --text: #f1ebfa; --text-2: #bcaed3; --muted: #8a7ba3;
  --accent: #f0b93a; --accent-ink: #1a0f2e; --accent-soft: #3a2a18;
  --good: #6fd49a; --warn: #f0b93a; --bad: #ff7b72;
  --bar: #b07cff; --gold: #f0b93a;
  --shadow: none;
}
/* ---------- färgteman efter Magics fem färger (väljs under Inställningar) ---------- */
:root[data-theme="plains"] {
  --bg: #f7f1e3; --surface: #fffaf0; --surface-2: #f0e7d2; --border: #e0d3b4;
  --text: #2b2414; --text-2: #6b5d3f; --muted: #978a6b;
  --accent: #a87a12; --accent-ink: #ffffff; --accent-soft: #f5e6bf;
  --good: #3d7a2a; --warn: #a35c00; --bad: #b3261e;
  --bar: #c8961e; --gold: #a87a12;
  --shadow: 0 1px 3px rgba(80, 60, 10, .1); color-scheme: light;
}
:root[data-theme="island"] {
  --bg: #0d1726; --surface: #13223a; --surface-2: #1b2e4b; --border: #27405f;
  --text: #e6f0fb; --text-2: #a9bed6; --muted: #7389a3;
  --accent: #4fb3ff; --accent-ink: #0d1726; --accent-soft: #173b5e;
  --good: #5fd0a0; --warn: #f0b860; --bad: #ff7b7b;
  --bar: #4fb3ff; --gold: #e0c06a;
  --shadow: none; color-scheme: dark;
}
:root[data-theme="swamp"] {
  --bg: #0b0a0c; --surface: #151317; --surface-2: #1e1b21; --border: #2d2930;
  --text: #e8e3e8; --text-2: #aaa1ab; --muted: #7a717b;
  --accent: #b9a7c9; --accent-ink: #0b0a0c; --accent-soft: #2a2430;
  --good: #8fc79a; --warn: #d9b25a; --bad: #e0707a;
  --bar: #9f8bb3; --gold: #c9aa5a;
  --shadow: none; color-scheme: dark;
}
:root[data-theme="mountain"] {
  --bg: #1a0f0c; --surface: #261612; --surface-2: #331e18; --border: #4a2b22;
  --text: #f6e9e3; --text-2: #d0b3a8; --muted: #9a7a6f;
  --accent: #ff6a3d; --accent-ink: #1a0f0c; --accent-soft: #4a2015;
  --good: #7fd08a; --warn: #ffbf4d; --bad: #ff7b72;
  --bar: #ff6a3d; --gold: #f0b84c;
  --shadow: none; color-scheme: dark;
}
:root[data-theme="forest"] {
  --bg: #0c1610; --surface: #132219; --surface-2: #1a2e22; --border: #284432;
  --text: #e5f2e8; --text-2: #a8c6b0; --muted: #739381;
  --accent: #5fd37f; --accent-ink: #0c1610; --accent-soft: #1b3d27;
  --good: #7fe0a0; --warn: #e8c05a; --bad: #ff8a7a;
  --bar: #5fd37f; --gold: #d9bb5c;
  --shadow: none; color-scheme: dark;
}
/* ---------- gillen: tvåfärgade teman ---------- */
:root[data-theme="azorius"] {
  --bg: #eef3f9; --surface: #fbfdff; --surface-2: #e2eaf4; --border: #cbd8e8;
  --text: #18263a; --text-2: #4a5d78; --muted: #7d8ea6;
  --accent: #2a6fb8; --accent-ink: #ffffff; --accent-soft: #dbe8f7;
  --good: #3d7a2a; --warn: #a35c00; --bad: #b3261e;
  --bar: #2a6fb8; --gold: #a87a12;
  --shadow: 0 1px 3px rgba(0, 0, 0, .1); color-scheme: light;
}
:root[data-theme="dimir"] {
  --bg: #090d14; --surface: #10161f; --surface-2: #18202c; --border: #26303f;
  --text: #e2e8f2; --text-2: #a3afc2; --muted: #717d91;
  --accent: #45b8cc; --accent-ink: #090d14; --accent-soft: #14323a;
  --good: #7fd08a; --warn: #e8c05a; --bad: #ff7b72;
  --bar: #45b8cc; --gold: #c9aa5a;
  --shadow: none; color-scheme: dark;
}
:root[data-theme="rakdos"] {
  --bg: #0e0809; --surface: #1a0f11; --surface-2: #241518; --border: #3a2227;
  --text: #f2e4e5; --text-2: #c4a7aa; --muted: #8f7276;
  --accent: #e8414a; --accent-ink: #0e0809; --accent-soft: #45161b;
  --good: #7fd08a; --warn: #e8c05a; --bad: #ff7b72;
  --bar: #e8414a; --gold: #e0b050;
  --shadow: none; color-scheme: dark;
}
:root[data-theme="gruul"] {
  --bg: #14110b; --surface: #1f1a11; --surface-2: #2a2318; --border: #433825;
  --text: #f1ead9; --text-2: #c9bb9c; --muted: #968a6e;
  --accent: #e86a35; --accent-ink: #14110b; --accent-soft: #45240f;
  --good: #7fd08a; --warn: #e8c05a; --bad: #ff7b72;
  --bar: #e86a35; --gold: #e0b84c;
  --shadow: none; color-scheme: dark;
}
:root[data-theme="selesnya"] {
  --bg: #f1f5ea; --surface: #fcfdf8; --surface-2: #e5ecd9; --border: #cfdcbe;
  --text: #1d2a17; --text-2: #4f6343; --muted: #839477;
  --accent: #3b8a34; --accent-ink: #ffffff; --accent-soft: #dcebcf;
  --good: #3d7a2a; --warn: #a35c00; --bad: #b3261e;
  --bar: #3b8a34; --gold: #a87a12;
  --shadow: 0 1px 3px rgba(0, 0, 0, .1); color-scheme: light;
}
:root[data-theme="orzhov"] {
  --bg: #111013; --surface: #1b1a1e; --surface-2: #25232a; --border: #3a3740;
  --text: #f0ece4; --text-2: #bdb6aa; --muted: #8a8478;
  --accent: #dcbc6a; --accent-ink: #111013; --accent-soft: #3a321e;
  --good: #7fd08a; --warn: #e8c05a; --bad: #ff7b72;
  --bar: #dcbc6a; --gold: #dcbc6a;
  --shadow: none; color-scheme: dark;
}
:root[data-theme="izzet"] {
  --bg: #0b111c; --surface: #121b2b; --surface-2: #1a263a; --border: #2a3a55;
  --text: #e8eef8; --text-2: #a9b7cc; --muted: #7586a0;
  --accent: #ff6a3d; --accent-ink: #0b111c; --accent-soft: #4a2015;
  --good: #7fd08a; --warn: #e8c05a; --bad: #ff7b72;
  --bar: #ff6a3d; --gold: #5fb6ff;
  --shadow: none; color-scheme: dark;
}
:root[data-theme="golgari"] {
  --bg: #0d0f0a; --surface: #161a11; --surface-2: #1f2418; --border: #323a26;
  --text: #e8ecdc; --text-2: #b0b89c; --muted: #7f876c;
  --accent: #9ac24f; --accent-ink: #0d0f0a; --accent-soft: #2c3a17;
  --good: #7fd08a; --warn: #e8c05a; --bad: #ff7b72;
  --bar: #9ac24f; --gold: #c9aa5a;
  --shadow: none; color-scheme: dark;
}
:root[data-theme="boros"] {
  --bg: #f9f1ea; --surface: #fffbf7; --surface-2: #f1e4d8; --border: #e2cdb9;
  --text: #2e1a12; --text-2: #6e4d3d; --muted: #9c7f70;
  --accent: #c4372b; --accent-ink: #ffffff; --accent-soft: #f6dcd3;
  --good: #3d7a2a; --warn: #a35c00; --bad: #b3261e;
  --bar: #c4372b; --gold: #a87a12;
  --shadow: 0 1px 3px rgba(0, 0, 0, .1); color-scheme: light;
}
:root[data-theme="simic"] {
  --bg: #08130f; --surface: #0f1d18; --surface-2: #162a23; --border: #244036;
  --text: #e2f3ee; --text-2: #a2c4ba; --muted: #6f9388;
  --accent: #3fd2b0; --accent-ink: #08130f; --accent-soft: #123d33;
  --good: #7fd08a; --warn: #e8c05a; --bad: #ff7b72;
  --bar: #3fd2b0; --gold: #d9bb5c;
  --shadow: none; color-scheme: dark;
}
.themes-label { margin: .7rem 0 0; }
.themes { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.themes button { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem .35rem .4rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; font-size: .9rem; }
.themes button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); font-weight: 600; }
.themes .sw { width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); }
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
/* webbläsarens autofyll ska följa temat, inte bli vit med ljus text */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--text);
  transition: background-color 9999s;
}
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin: 1rem 0 .35rem; }

.top { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; gap: .5rem; align-items: center; font-weight: 700; text-decoration: none; color: var(--text); }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.top nav { display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
.top nav a { padding: .35rem .7rem; border-radius: 8px; text-decoration: none; color: var(--text-2); }
.top nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

main { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
@media (max-width: 860px) { .cols-2 { grid-template-columns: 1fr; } }

.btn { border: 1px solid var(--border); background: var(--surface); padding: .45rem .85rem; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--bad); }
.btn.small { padding: .2rem .55rem; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: .15rem .35rem; border-radius: 6px; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
input[type=text], input[type=search], input[type=number], input[type=url], select, textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .45rem .6rem; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { width: 100%; min-height: 220px; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin: 1rem 0; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: .55rem .9rem; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }

/* leklista */
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-top: 1rem; }
.deck-tile { display: block; text-decoration: none; color: inherit; overflow: hidden; padding: 0; }
.deck-tile .art { height: 110px; background: var(--surface-2) center 20% / cover; }
.deck-tile .body { padding: .75rem 1rem; }
.deck-tile:hover { border-color: var(--accent); }
.pill { display: inline-block; font-size: .75rem; padding: .05rem .5rem; border-radius: 99px; background: var(--surface-2); color: var(--text-2); }
.pill.good { color: var(--good); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); }

/* kortlistan */
.add-bar { position: relative; flex: 1; min-width: 220px; }
.add-bar input { width: 100%; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-top: 2px; max-height: 320px; overflow: auto; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.suggest div { padding: .4rem .7rem; cursor: pointer; }
.suggest div.on, .suggest div:hover { background: var(--accent-soft); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.clist { list-style: none; margin: 0; padding: 0; }
.clist li { display: flex; align-items: center; gap: .5rem; padding: .22rem .3rem; border-radius: 6px; }
.clist li:hover { background: var(--surface-2); }
.clist .q { width: 1.8rem; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.clist .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.clist .nm.missing { color: var(--muted); font-style: italic; }
.clist li.owned .nm { color: var(--text-2); }
.clist .acts { display: flex; gap: .1rem; opacity: .35; }
.clist li:hover .acts { opacity: 1; }
.own { display: inline-flex; align-items: center; gap: .25rem; cursor: pointer; user-select: none; }
.own input { width: 1.05rem; height: 1.05rem; accent-color: var(--good); cursor: pointer; }
.own .part { font-size: .75rem; color: var(--warn); font-variant-numeric: tabular-nums; }
.mana { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; color: var(--text-2); white-space: nowrap; }
.sym { display: inline-block; width: 1.05em; height: 1.05em; line-height: 1.05em; text-align: center; border-radius: 50%; font-size: .7rem; font-weight: 700; margin-left: 1px; border: 1px solid rgba(0,0,0,.25); color: #1d1a26; background: #cac5c0; }
.sym.W { background: #f8f6d8; } .sym.U { background: #aae0fa; } .sym.B { background: #b8aca8; } .sym.R { background: #f9aa8f; } .sym.G { background: #9bd3ae; }
.cols-cards { columns: 2 300px; column-gap: 1.5rem; }
.cols-cards > section { break-inside: avoid; margin-bottom: .5rem; }

.issues { margin: 0; padding-left: 1.1rem; }
.issues li { margin: .15rem 0; }
.issues li.bad { color: var(--bad); } .issues li.warn { color: var(--warn); } .issues li.good { color: var(--good); }

/* statistik */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.stat { background: var(--surface-2); border-radius: 8px; padding: .6rem .8rem; }
.stat b { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; color: var(--text-2); }
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-wrap .bar { fill: var(--bar); }
.chart-wrap .hit { fill: transparent; cursor: default; }
.chart-wrap .hit:hover + .bar, .chart-wrap g:hover .bar { opacity: .8; }
.chart-wrap text { fill: var(--text-2); font-size: 12px; }
.chart-wrap .val { fill: var(--text); font-weight: 600; }
.chart-wrap .axis { stroke: var(--border); }
.tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); padding: .3rem .55rem; border-radius: 6px; font-size: .8rem; white-space: nowrap; transform: translate(-50%, -110%); }
.hbars { display: grid; grid-template-columns: auto 1fr auto; gap: .35rem .6rem; align-items: center; }
.hbars .track { background: var(--surface-2); border-radius: 4px; height: 10px; overflow: hidden; }
.hbars .fill { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }
.hbars .n { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: .85rem; }

/* köp */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.offer { font-size: .85rem; }
.offer .price { font-weight: 700; font-variant-numeric: tabular-nums; }
.links { display: flex; gap: .3rem; flex-wrap: wrap; }
.links a { font-size: .8rem; padding: .1rem .45rem; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; white-space: nowrap; }
.links a:hover { border-color: var(--accent); }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.progress div { height: 100%; background: var(--accent); transition: width .2s; }
.steps { margin: .3rem 0 0; padding-left: 1.2rem; }

/* sök */
.search-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-top: .8rem; }
.search-results figure { margin: 0; position: relative; }
.search-results img { width: 100%; border-radius: 7px; display: block; background: var(--surface-2); aspect-ratio: 488/680; }
.search-results figcaption { display: flex; gap: .3rem; margin-top: .25rem; }
.search-results figcaption button { flex: 1; }

.preview { position: fixed; z-index: 50; pointer-events: none; }
.preview img { width: 250px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
@media (hover: none) { .preview { display: none !important; } }

.modal { position: fixed; inset: 0; background: rgba(10, 5, 20, .55); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box { background: var(--surface); border-radius: 14px; padding: 1.2rem; max-width: 720px; width: 100%; max-height: 90vh; overflow: auto; }
.card-detail { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; }
.card-detail img { width: 100%; border-radius: 12px; }
.card-detail .oracle { white-space: pre-wrap; font-size: .9rem; }
@media (max-width: 600px) { .card-detail { grid-template-columns: 1fr; } .card-detail img { max-width: 260px; } }

.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .55rem 1rem; border-radius: 8px; z-index: 70; }
/* segmentknappar */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--surface); padding: .35rem .7rem; cursor: pointer; color: var(--text-2); font-size: .85rem; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }

/* bildläge */
.vgrid { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .5rem; }
.vgrid li { position: relative; }
.vgrid img, .vgrid .noimg { width: 100%; aspect-ratio: 488/680; border-radius: 6px; display: block; cursor: pointer; background: var(--surface-2); }
.vgrid .noimg { display: flex; align-items: center; justify-content: center; text-align: center; font-size: .8rem; padding: .4rem; }
.vgrid li.lack img { filter: grayscale(.85) brightness(.8); }
.vgrid li.lack:hover img { filter: none; }
.qbadge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.75); color: #fff; font-weight: 700; font-size: .8rem; padding: 0 .4rem; border-radius: 6px; }
.own-badge { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.7); color: #fff; border-radius: 6px; padding: .1rem .3rem; display: flex; gap: .2rem; align-items: center; font-size: .75rem; cursor: pointer; }
.own-badge input { accent-color: var(--good); width: 1rem; height: 1rem; cursor: pointer; }

/* provhand */
.hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .45rem; margin: .8rem 0; }
.hand figure { margin: 0; }
.hand img, .hand .noimg { width: 100%; aspect-ratio: 488/680; border-radius: 6px; display: block; background: var(--surface-2); }
.hand .noimg { display: flex; align-items: center; justify-content: center; font-size: .8rem; text-align: center; padding: .4rem; }
.hand figure.pickable { cursor: pointer; }
.hand figure.pickable:hover img { outline: 3px solid var(--warn); outline-offset: -3px; }

/* hur stor del man äger */
.ownbar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: .5rem; }
.ownbar div { height: 100%; background: var(--good); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }

.auth { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box p { margin: .6rem 0; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-2); }

/* små märken */
.gc { font-size: .62rem; font-weight: 700; color: var(--warn); border: 1px solid currentColor; border-radius: 4px; padding: 0 .2rem; vertical-align: 1px; }
.lent { color: var(--accent); font-weight: 700; }
.badge { display: inline-block; min-width: 1.2rem; padding: 0 .35rem; border-radius: 99px; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.2rem; }
tr.alert td { background: var(--accent-soft); }
.offline { background: var(--warn); color: #1d1a26; text-align: center; padding: .4rem 1rem; font-size: .85rem; }

/* kombos */
.combo { border-top: 1px solid var(--border); padding: .6rem 0; }
.combo .pill { margin: .2rem .2rem 0 0; }
.combo details p { margin: .4rem 0; }

/* skanning */
.scan { position: relative; background: #000; border-radius: 10px; overflow: hidden; margin: .6rem 0; }
.scan video { width: 100%; display: block; max-height: 60vh; object-fit: cover; }
.scan .guide { position: absolute; left: 8%; right: 8%; top: 30%; height: 15%; border: 3px solid #e0b84c; border-radius: 8px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }

/* livräknare */
body.life-on .top, body.life-on .offline { display: none; }
body.life-on main { max-width: none; padding: 0; }
.life { position: fixed; inset: 0; display: grid; gap: 4px; background: #000; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; padding-bottom: 44px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.life.n2 { grid-template-columns: 1fr; }
.life.n3 .pl:first-child, .life.n5 .pl:first-child { grid-column: 1 / -1; }
.pl { position: relative; border-radius: 12px; color: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pl:nth-child(6n+1) { background: #5b3fd0; } .pl:nth-child(6n+2) { background: #1f7a45; } .pl:nth-child(6n+3) { background: #b3261e; }
.pl:nth-child(6n+4) { background: #1d5fa8; } .pl:nth-child(6n+5) { background: #9a6200; } .pl:nth-child(6n+6) { background: #4a4458; }
.pl.flip { transform: rotate(180deg); }
.pl.out { filter: grayscale(1) brightness(.55); }
.pl .lifeval { font-size: clamp(3rem, 16vmin, 9rem); font-weight: 800; font-variant-numeric: tabular-nums; pointer-events: none; }
.pl.hitfx::before, .pl.healfx::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1; animation: plflash .6s ease-out forwards; }
.pl.hitfx::before { background: radial-gradient(circle at 50% 50%, rgba(255,60,40,.65), rgba(255,20,20,.25) 60%, rgba(255,0,0,0) 85%); }
.pl.healfx::before { background: radial-gradient(circle at 50% 60%, rgba(140,255,180,.6), rgba(80,255,150,.15) 60%, rgba(80,255,150,0) 85%); animation-duration: .9s; }
.pl.hitfx:not(.flip) { animation: plhit .4s ease-out; }
.pl.flip.hitfx { animation: plhitflip .4s ease-out; }
@keyframes plhitflip { 0% { transform: rotate(180deg); } 20% { transform: rotate(180deg) translate(-7px, 2px); } 40% { transform: rotate(180deg) translate(6px, -2px); } 60% { transform: rotate(180deg) translate(-4px, 1px); } 80% { transform: rotate(180deg) translate(2px, 0); } 100% { transform: rotate(180deg); } }
@keyframes plflash { from { opacity: 1; } to { opacity: 0; } }
@keyframes plhit { 0% { transform: none; } 20% { transform: translate(-7px, 2px); } 40% { transform: translate(6px, -2px); } 60% { transform: translate(-4px, 1px); } 80% { transform: translate(2px, 0); } 100% { transform: none; } }
.fx-bolt { position: fixed; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; pointer-events: none; z-index: 65;
  background: radial-gradient(circle, #fff 0 18%, #ffd27a 30%, #ff6a2b 55%, rgba(255,60,20,0) 72%); box-shadow: 0 0 22px 8px rgba(255,100,30,.65); }
.fx-bolt.cmd { background: radial-gradient(circle, #fff 0 18%, #e2c6ff 30%, #9b5cff 55%, rgba(120,60,255,0) 72%); box-shadow: 0 0 22px 8px rgba(150,90,255,.65); }
.fx-bolt.heal { background: radial-gradient(circle, #fff 0 18%, #d4ffe2 30%, #3fe08a 55%, rgba(60,220,130,0) 72%); box-shadow: 0 0 22px 8px rgba(70,230,140,.6); }
.fx-spark { position: fixed; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; z-index: 65; background: #ffcf6b; box-shadow: 0 0 8px 2px rgba(255,110,40,.8); }
.fx-plus { position: absolute; pointer-events: none; z-index: 2; color: #d8ffe6; font-weight: 800; font-size: clamp(1rem, 5vmin, 1.8rem); text-shadow: 0 0 10px rgba(70,255,150,.9); }
@media (prefers-reduced-motion: reduce) { .pl.hitfx:not(.flip), .pl.flip.hitfx { animation: none; } }
.pl .ldelta { position: absolute; top: calc(50% - clamp(3.2rem, 15vmin, 8rem)); left: 0; right: 0; text-align: center; font-size: clamp(1.3rem, 6vmin, 2.4rem); font-weight: 800; font-variant-numeric: tabular-nums; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.5); animation: ldpop .18s ease-out; }
.pl .ldelta[hidden] { display: none; }
.pl .ldelta.neg { color: #ffd1cc; } .pl .ldelta.pos { color: #c9ffd9; }
.life.shared .pl:not(.mine) .ldelta { top: calc(50% - clamp(2.4rem, 10vmin, 5.5rem)); font-size: clamp(1.1rem, 4.5vmin, 1.8rem); }
@keyframes ldpop { from { transform: scale(1.35); } to { transform: scale(1); } }
.pl .pname { position: absolute; top: .5rem; left: 0; right: 0; text-align: center; font-weight: 600; opacity: .9; pointer-events: none; }
.pl .extra { position: absolute; bottom: .5rem; left: .5rem; right: 3rem; display: flex; gap: .5rem; flex-wrap: wrap; font-size: .85rem; pointer-events: none; }
.pl .hit { position: absolute; top: 0; bottom: 0; width: 50%; border: 0; background: transparent; cursor: pointer; }
.pl .hit.minus { left: 0; } .pl .hit.plus { right: 0; }
.pl .hit:active { background: rgba(255,255,255,.12); }
.pl .hit.minus::after, .pl .hit.plus::after { position: absolute; top: 50%; transform: translateY(-50%); font-size: 2rem; opacity: .5; color: #fff; }
.pl .hit.minus::after { content: '−'; left: 1rem; } .pl .hit.plus::after { content: '+'; right: 1rem; }
.pl .more { position: absolute; bottom: .4rem; right: .4rem; z-index: 2; border: 0; border-radius: 8px; background: rgba(0,0,0,.3); color: #fff; font-size: 1.2rem; width: 2.4rem; height: 2rem; cursor: pointer; }
.lbar { position: fixed; left: 0; right: 0; bottom: 0; height: 44px; display: flex; gap: .5rem; justify-content: center; align-items: center; background: #000; }

/* proxyutskrift: syns bara när man skriver ut */
#print { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; }
  #print .sheet { display: grid; grid-template-columns: repeat(3, 63mm); grid-auto-rows: 88mm; gap: 0; justify-content: center; break-after: page; }
  #print .sheet:last-child { break-after: auto; }
  #print img { width: 63mm; height: 88mm; object-fit: cover; outline: .2mm solid #999; }
}

/* smal skärm: menyn får egen rad och kan svepas */
@media (max-width: 720px) {
  .top { flex-wrap: wrap; gap: .4rem; }
  .top nav { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .top nav a { white-space: nowrap; }
}

/* v4: foil */
.foil { color: #e0b84c; font-size: .85em; }

.shared { color: var(--warn); font-weight: 700; }
/* delad livräknare: min spelare överst och störst */
.life.shared .pl.mine { order: -1; grid-column: 1 / -1; box-shadow: inset 0 0 0 3px rgba(255,255,255,.6); }
.life.shared .pl:not(.mine) .lifeval { font-size: clamp(2.2rem, 11vmin, 6rem); }
.lbar #lPeers { margin: 0 .3rem; }
/* regler */
.rules li { margin: .35rem 0; }
.rule { padding: .5rem 0; border-top: 1px solid var(--border); font-size: .92rem; }
.rule mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: inherit; border-radius: 2px; }

/* notisklockan */
.bell { position: relative; border: 0; background: transparent; color: var(--text-2); font-size: 1.15rem; width: 2.3rem; height: 2.3rem; border-radius: 8px; cursor: pointer; }
.bell:hover { background: var(--surface-2); }
.bell .badge { position: absolute; top: 0; right: 0; font-size: .65rem; min-width: 1.1rem; padding: 0 .25rem; }
.notes { position: fixed; top: 3.2rem; right: .6rem; width: min(360px, calc(100vw - 1.2rem)); max-height: 70vh; overflow: auto; z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.notes a.note { display: block; padding: .6rem .8rem; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.notes a.note:hover { background: var(--surface-2); }
.notes a.note.new { border-left: 3px solid var(--accent); }
.notes .note small { display: block; color: var(--muted); }
@media (max-width: 720px) {
  .bell { margin-left: auto; order: 1; }
  .top nav { order: 2; }
}
.chart-wrap .line { fill: none; stroke: var(--bar); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-wrap .dot { fill: var(--bar); stroke: var(--surface); stroke-width: 2; }
.picks { list-style: none; margin: .2rem 0; padding: 0; }
.picks li { padding: .15rem 0; }
.picks label:has(input:checked) { color: var(--text-2); text-decoration: line-through; }
.next { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; padding: .5rem .8rem; margin-bottom: .8rem; background: var(--surface-2); border-radius: 8px; }
.next .btn { margin-left: .3rem; }
.shared[title], .lent[title] { cursor: help; }
/* tärning i livräknaren: en d20-siluett som snurrar och landar */
.die { position: absolute; left: 50%; top: 50%; width: min(42%, 34vmin, 9rem); aspect-ratio: 1; margin: 0; transform: translate(-50%, -50%); z-index: 3; pointer-events: none; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff, #e8e2d0 55%, #b9ae8f); color: #222; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); transition: opacity .3s, filter .3s; }
.die span { font-size: clamp(1.6rem, 9vmin, 3.6rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.die.rolling { animation: dieroll .45s linear infinite; }
.die.done { animation: dieland .35s ease-out; }
.die.dim { opacity: .45; }
.die.win { background: radial-gradient(circle at 35% 30%, #fff8d6, #ffd54a 55%, #c99400); animation: diewin .8s ease-in-out infinite alternate; }
@keyframes dieroll { 0% { transform: translate(-50%, -50%) rotate(0) scale(1); } 25% { transform: translate(-30%, -65%) rotate(100deg) scale(.9); } 50% { transform: translate(-50%, -40%) rotate(190deg) scale(1.05); } 75% { transform: translate(-70%, -60%) rotate(280deg) scale(.92); } 100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); } }
@keyframes dieland { 0% { transform: translate(-50%, -50%) scale(1.25); } 100% { transform: translate(-50%, -50%) scale(1); } }
@keyframes diewin { from { transform: translate(-50%, -50%) scale(1); } to { transform: translate(-50%, -50%) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .die.rolling, .die.done, .die.win { animation: none; } }
.clist .pr { min-width: 3.4rem; text-align: right; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pbadge { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.75); color: #fff; font-size: .75rem; padding: 0 .35rem; border-radius: 6px; pointer-events: none; }
.clist .pr.own { color: var(--text-2); font-weight: 600; }
/* jämför lekar */
.cmpcurve { display: flex; gap: .4rem; align-items: stretch; height: 140px; }
.cmpcurve > div { flex: 1; display: flex; flex-direction: column; align-items: center; }
.cmpcurve .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; gap: 2px; }
.cmpcurve .bars span { flex: 1; border-radius: 3px 3px 0 0; min-height: 1px; }
.cmpcurve .a, .dot.a { background: var(--accent); }
.cmpcurve .b, .dot.b { background: #e0a030; }
.dot.a, .dot.b { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; vertical-align: middle; }
.cmplist { margin: .2rem 0; padding-left: 1.1rem; columns: 2 11rem; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* billigare alternativ */
.alts { display: grid; gap: .5rem; margin-top: .5rem; }
.alt { display: flex; gap: .6rem; align-items: flex-start; padding: .4rem; border: 1px solid var(--border); border-radius: 8px; }
.alt img { width: 56px; border-radius: 4px; cursor: pointer; flex: none; }
.alt .grow { flex: 1; min-width: 0; }
.alt .altbtn { display: flex; flex-direction: column; gap: .3rem; align-items: flex-end; }
.alt .clamp { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* lekanalys */
.formrow { display: flex; flex-wrap: wrap; gap: 4px; }
.form { width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); opacity: .5; }
.form.win { background: #2e9d5b; opacity: 1; }
.form.loss { background: #d0464b; opacity: 1; }
.wbar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; min-width: 40px; }
.wbar > div { height: 100%; background: #2e9d5b; }
tr.few { opacity: .55; }

/* förbättra */
.gap { border-top: 1px solid var(--border); padding: .45rem 0; }
.gap:first-of-type { border-top: 0; }
.gap .row { gap: .4rem; }
/* provspela */
.board { display: flex; flex-wrap: wrap; gap: .3rem; }
.board figure { margin: 0; width: 64px; }
.board figure img { width: 100%; border-radius: 4px; display: block; }
.board figure.tapped img { transform: rotate(90deg) scale(.8); opacity: .7; }
.board .noimg { font-size: .65rem; border: 1px solid var(--border); border-radius: 4px; padding: .2rem; min-height: 88px; }

/* ---------- turnering ---------- */
.dlist { list-style: none; padding: 0; margin: .3rem 0 0; } .dlist li { padding: .3rem 0; border-bottom: 1px solid var(--border); } .dlist li:last-child { border: 0; }
.dpairs li { padding: .6rem 0; }
.dstand { width: 100%; border-collapse: collapse; font-size: .9rem; } .dstand th, .dstand td { text-align: left; padding: .35rem .3rem; border-bottom: 1px solid var(--border); }
.dstand tr.win td { color: var(--good); font-weight: 700; }

/* ---------- lugnare utseende ---------- */
.tabs, .top nav { scrollbar-width: none; }
.tabs::-webkit-scrollbar, .top nav::-webkit-scrollbar { display: none; }
/* långa förklaringar ligger bakom ⓘ (Inställningar → Visa förklaringar direkt) */
details.help { margin: .35rem 0; }
details.help > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; color: var(--text-2); font-size: .8rem; opacity: .75; user-select: none; }
details.help > summary::-webkit-details-marker { display: none; }
details.help > summary:hover { opacity: 1; }
details.help[open] > summary { opacity: 1; }
details.help > p { margin: .3rem 0 0; }
@media (max-width: 720px) {
  main { padding: .75rem; }
  .card { padding: .85rem; }
  .grid { gap: .75rem; }
  h1 { font-size: 1.35rem; }
}
.ihelp { border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: .85em; margin-left: .4rem; padding: 0 .2rem; opacity: .7; vertical-align: middle; font-weight: 400; }
.ihelp:hover, .ihelp[aria-expanded="true"] { opacity: 1; color: var(--accent); }
.chk { display: flex; gap: .5rem; align-items: center; margin-top: .7rem; font-size: .9rem; flex-wrap: wrap; }
.chk input[type=checkbox] { margin: 0; width: auto; }
.settings h1 { margin-bottom: 0; }
a.btn { text-decoration: none; }
.pill.grp { font-size: .72rem; padding: 0 .4rem; opacity: .85; }
#grpF { max-width: 11rem; }
.tour-live { margin-bottom: .75rem; padding: .5rem .8rem; border: 1px dashed var(--border); border-radius: 10px; gap: .5rem; flex-wrap: wrap; }

/* ================= Manakeep: borg & guld =================
   Ligger sist och bygger bara på temats färger, så alla teman får samma stil. */
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 600 700; font-display: swap; src: url(fonts/cinzel-latin.woff2) format('woff2'); }
:root {
  --radius: 14px;
  --display: 'Cinzel', Georgia, 'Times New Roman', serif;
  --line: color-mix(in srgb, var(--gold) 28%, var(--border));
  --line-strong: color-mix(in srgb, var(--gold) 60%, var(--border));
  --glow: color-mix(in srgb, var(--accent) 35%, transparent);
  --lift: 0 10px 28px -12px rgba(0, 0, 0, .45);
}
body {
  background:
    radial-gradient(1100px 520px at 50% -180px, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(700px 400px at 100% 100%, color-mix(in srgb, var(--bar) 10%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
h1 { font-family: var(--display); font-weight: 700; letter-spacing: .02em; font-size: 1.6rem; }
.card > h2:first-child, .card > .row:first-child > h2, .modal-box > h2:first-child { font-family: var(--display); font-weight: 700; letter-spacing: .02em; }

/* menyraden: halvgenomskinlig, guldlinje i underkant */
.top {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--line-strong), transparent) 1;
}
.brand { font-family: var(--display); font-size: 1.15rem; letter-spacing: .06em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line-strong), 0 0 14px -2px var(--glow); }
.top nav a { border-radius: 10px; transition: background .15s, color .15s; }
.top nav a:hover { color: var(--text); background: var(--surface-2); }
.top nav a.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

/* kort: tunn guldkant, ljus överkant */
.card { border-color: var(--line); box-shadow: var(--shadow), inset 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent); }
.modal-box { border: 1px solid var(--line-strong); box-shadow: var(--lift); }
.modal { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }

/* lekbrickor: större bild som tonar ut, lyfts och glöder vid hover */
.deck-grid { gap: 1.1rem; }
.deck-tile { position: relative; transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.deck-tile .art { height: 150px; position: relative; }
.deck-tile .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, var(--surface) 100%); }
.deck-tile .body { margin-top: -1.6rem; position: relative; }
.deck-tile .body > b:first-child { font-family: var(--display); font-size: 1.05rem; letter-spacing: .02em; display: block; }
.deck-tile:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--lift), 0 0 0 1px var(--line-strong), 0 0 26px -6px var(--glow); }

/* knappar */
.btn { border-radius: 10px; border-color: var(--line); transition: border-color .15s, box-shadow .15s, transform .1s; }
.btn:hover { border-color: var(--line-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent) 55%, color-mix(in srgb, var(--accent) 82%, #000));
  border-color: color-mix(in srgb, var(--accent) 70%, #000);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 4px 14px -6px var(--glow);
}
.btn.primary:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 20px -6px var(--accent); }
input[type=text], input[type=search], input[type=number], input[type=url], input[type=email], input[type=password], select, textarea { border-radius: 10px; border-color: var(--line); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }

/* flikar och val */
.tabs { border-bottom-color: var(--line); }
.tabs a, .tabs button { transition: color .15s; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs a.on, .tabs button.on { border-image: linear-gradient(90deg, transparent, var(--accent), transparent) 1; }
.seg { border-color: var(--line); border-radius: 10px; }
.seg button + button { border-left-color: var(--line); }
.pill { border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
th { color: color-mix(in srgb, var(--gold) 55%, var(--text-2)); }
.ownbar { height: 5px; }
.ownbar div { background: linear-gradient(90deg, color-mix(in srgb, var(--good) 70%, var(--gold)), var(--good)); }
.toast { border-radius: 12px; box-shadow: var(--lift); border: 1px solid var(--line-strong); }
.empty { border-style: dashed; }

/* inloggning: stor logga med glöd */
.auth { background:
    radial-gradient(600px 420px at 50% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--bg); }
.auth-box { border-color: var(--line-strong); box-shadow: var(--lift), 0 0 40px -10px var(--glow); padding: 1.6rem 1.4rem; }
.auth-box .brand { flex-direction: column; gap: .6rem; font-size: 1.6rem !important; }
.auth-box .brand img { width: 88px; height: 88px; border-radius: 20px; box-shadow: 0 0 0 1px var(--line-strong), 0 0 40px -4px var(--glow); }

@media (max-width: 600px) {
  h1 { font-size: 1.35rem; }
  .deck-tile .art { height: 130px; }
  .brand { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) {
  .deck-tile, .btn, .top nav a { transition: none; }
  .deck-tile:hover { transform: none; }
}

/* ---------- mobil: hamburgermeny ---------- */
.menu-btn { display: none; position: relative; width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; }
.menu-btn span { display: block; width: 1.15rem; height: 2px; border-radius: 2px; background: var(--text); transition: transform .2s, opacity .2s; }
.menu-btn.has-badge::after { content: ''; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.top.open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.top.open .menu-btn span:nth-child(2) { opacity: 0; }
.top.open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 720px) {
  .top { flex-wrap: nowrap; gap: .5rem; }
  .menu-btn { display: inline-flex; order: 2; }
  .bell { margin-left: auto; order: 1; }
  .top nav { display: none; order: 3; position: absolute; top: 100%; left: 0; right: 0; width: auto; margin: 0;
    flex-direction: column; flex-wrap: nowrap; gap: .15rem; overflow: auto; max-height: calc(100dvh - 4rem);
    padding: .5rem .75rem .9rem; background: var(--surface); border-bottom: 1px solid var(--line-strong); box-shadow: var(--lift); }
  .top.open nav { display: flex; }
  .top nav a { padding: .8rem 1rem; font-size: 1.05rem; box-shadow: none; }
  .top nav a.on { box-shadow: inset 3px 0 0 var(--accent); }
}
@media (prefers-reduced-motion: reduce) { .menu-btn span { transition: none; } }

/* turneringar */
.tour-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .1rem .8rem; }
.tour-pick .chk { margin-top: .35rem; }
.tour-tile .body { margin-top: 0; }
