/* MEET.PLAY-OUT — mörkt "broadcast studio"-tema (samma färger som Lovable-versionen) */
:root {
  --bg: #0b141c;
  --surface: #121c25;
  --elev: #1b2631;
  --elev2: #24313d;
  --fg: #eef3f8;
  --muted: #93a1b0;
  --border: rgba(255,255,255,.08);
  --input: rgba(255,255,255,.10);
  --primary: #1fd0dd;
  --primary-2: #43e6f0;
  --on-primary: #08151c;
  --accent: #f5795a;
  --danger: #e5484d;
  --ok: #3cc775;
  --warn: #f2c14e;
  --radius: 14px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,.6);
  --glow: 0 0 40px -8px rgba(31,208,221,.55);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 2rem; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; margin: 0 0 .8em; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1.2em 0 .2em; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mt { margin-top: 2rem; } .mt-s { margin-top: .8rem; }
[hidden] { display: none !important; }

/* Knappar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; border: 1px solid transparent; border-radius: 10px; padding: .6em 1.05em; font: inherit; font-weight: 600; cursor: pointer; color: var(--fg); background: var(--elev); transition: .15s; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--elev2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--on-primary); box-shadow: var(--glow); }
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--elev); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #f05a5f; }
.btn-sm { padding: .35em .75em; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: .8em 1.4em; font-size: 1.02rem; }
.btn-icon { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: .3em .5em; border-radius: 8px; font-size: 1rem; }
.btn-icon:hover { color: var(--fg); background: var(--elev); }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Formulär */
input, select, textarea { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--input); border-radius: 10px; padding: .6em .8em; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,208,221,.18); }
label { display: grid; gap: .3em; font-size: .88rem; color: var(--muted); }
.form-grid { display: grid; gap: .9rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
textarea.code { font-family: var(--mono); font-size: .8rem; }
.w80 { width: 80px; }

/* Ramar */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px); padding: 1.5rem; }
.flash { margin: 1rem auto 0; max-width: 1180px; padding: .8rem 1rem; border-radius: 10px; background: rgba(60,199,117,.12); border: 1px solid rgba(60,199,117,.35); }
.flash-err, .err-box { background: rgba(229,72,77,.12); border: 1px solid rgba(229,72,77,.4); padding: .7rem 1rem; border-radius: 10px; }
.ok-box { background: rgba(60,199,117,.12); border: 1px solid rgba(60,199,117,.35); padding: .7rem 1rem; border-radius: 10px; }
.warn-box { background: rgba(242,193,78,.12); border: 1px solid rgba(242,193,78,.35); padding: .7rem 1rem; border-radius: 10px; }
.tag { display: inline-block; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: .1em .55em; border-radius: 99px; background: var(--elev2); color: var(--muted); margin-left: .4em; vertical-align: middle; }
.tag.live { background: rgba(229,72,77,.18); color: #ff8e91; }
.pill { display: inline-block; padding: .3em .9em; border-radius: 99px; border: 1px solid rgba(31,208,221,.35); background: rgba(31,208,221,.08); color: var(--primary); font-size: .8rem; font-weight: 600; }

/* Sidhuvud */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(1rem, 4vw, 2.5rem); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(11,20,28,.85); backdrop-filter: blur(12px); z-index: 10; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--fg); font-weight: 800; letter-spacing: .12em; }
.brand img { height: 30px; }
.brand span { font-size: .8rem; padding: .15em .5em; border: 1px solid var(--border); border-radius: 6px; color: var(--primary); }
.site-header nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-header nav a:not(.btn) { color: var(--muted); font-weight: 500; }
.site-header nav a:not(.btn):hover { color: var(--fg); text-decoration: none; }
.who { color: var(--muted); font-size: .85rem; }
.site-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 3rem 1rem 2rem; }

/* Startsida */
.landing { background: radial-gradient(ellipse at top, rgba(31,208,221,.16), transparent 60%), radial-gradient(ellipse at bottom right, rgba(245,121,90,.10), transparent 55%), var(--bg); min-height: 100vh; }
.hero { max-width: 980px; margin: 0 auto; padding: clamp(3rem, 10vw, 7rem) 1.5rem 3rem; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); margin-top: .5em; }
.grad { background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.12rem; max-width: 640px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.join-form { display: flex; gap: .6rem; max-width: 480px; margin: 1.6rem auto 0; }
.features { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.feature { background: rgba(18,28,37,.7); border: 1px solid var(--border); border-radius: 18px; padding: 1.3rem; }
.feature p { color: var(--muted); margin: .4em 0 0; font-size: .92rem; }

/* Inloggning */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(ellipse at top, rgba(31,208,221,.14), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 1rem; }
.auth-card.wide { max-width: 640px; }
.auth-logo { height: 40px; justify-self: start; }

/* Dashboard */
.dash { max-width: 1240px; margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 2rem); }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.dash-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.5rem; align-items: start; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.015); flex-wrap: wrap; }
.li-main { min-width: 0; flex: 1 1 220px; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.li-main > div { flex-basis: 100%; }
.li-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.li-actions form { margin: 0; }
.li-actions select { width: auto; max-width: 240px; padding: .35em .6em; font-size: .85rem; }
.pair-form { display: grid; grid-template-columns: 130px 1fr auto; gap: .5rem; margin-bottom: 1rem; }
.inline-rename { flex: 1; } .inline-rename input { background: transparent; border-color: transparent; padding: .25em .4em; font-weight: 600; }
.inline-rename input:hover { border-color: var(--input); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #4b5662; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--border); }
details summary { list-style: none; cursor: pointer; display: inline-flex; }
details summary::-webkit-details-marker { display: none; }

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .pair-form { grid-template-columns: 1fr 1fr; } .pair-form button { grid-column: span 2; }
  .who { display: none; }
}

/* =================== Mötesrum =================== */
.room-body { height: 100vh; height: 100dvh; overflow: hidden; }
.lobby { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1rem; overflow: auto; }
.lobby-card { width: 100%; max-width: 1040px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.6rem; background: rgba(18,28,37,.75); border: 1px solid var(--border); border-radius: 24px; padding: clamp(1rem, 3vw, 2rem); }
.lobby-preview { position: relative; aspect-ratio: 16/9; border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, var(--elev), var(--surface)); border: 1px solid var(--border); }
.lobby-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.lobby-preview .prev-btns { position: absolute; bottom: .8rem; left: 50%; transform: translateX(-50%); display: flex; gap: .6rem; }
.lobby-side { display: flex; flex-direction: column; justify-content: center; gap: .9rem; }
.lobby-side .eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: var(--muted); }
.lobby-side h1 { margin: 0; font-size: 1.8rem; }
.devices { display: grid; gap: .6rem; }
.devices select { font-size: .85rem; padding: .45em .6em; }
.meter { height: 4px; border-radius: 4px; background: var(--elev2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
@media (max-width: 760px) { .lobby-card { grid-template-columns: 1fr; } }

.room { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; height: 100dvh; }
.room-top { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .55rem 1rem; border-bottom: 1px solid var(--border); min-width: 0; }
.room-title { min-width: 0; display: flex; align-items: center; gap: .7rem; }
.room-title img { height: 24px; }
.room-title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.room-title small { color: var(--muted); font-family: var(--mono); }
.badge { display: inline-flex; align-items: center; gap: .25em; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .15em .5em; border-radius: 99px; border: 1px solid rgba(242,193,78,.4); background: rgba(242,193,78,.1); color: var(--warn); }
.badge.lock { border-color: rgba(229,72,77,.4); background: rgba(229,72,77,.1); color: #ff8e91; }
.room-top-actions { display: flex; gap: .4rem; align-items: center; }
.room-main { position: relative; display: flex; min-height: 0; }

.stage { flex: 1; min-width: 0; padding: .6rem; display: grid; gap: .6rem; }
.stage.spot { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
.grid { display: grid; gap: .6rem; height: 100%; min-height: 0; align-content: center; }
.stage.spot .grid { height: auto; grid-auto-flow: column; grid-auto-columns: minmax(150px, 220px); grid-template-columns: none !important; overflow-x: auto; justify-content: center; }
.stage.spot .grid .tile { aspect-ratio: 16/9; height: auto; }
.spotlight { min-height: 0; display: none; }
.stage.spot .spotlight { display: block; }
.spotlight .tile { height: 100%; }

.tile { position: relative; background: linear-gradient(180deg, var(--elev), var(--surface)); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; min-height: 0; min-width: 0; box-shadow: 0 8px 24px -12px rgba(0,0,0,.5); transition: border-color .15s, box-shadow .15s; cursor: pointer; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile.contain video, .tile.screen video { object-fit: contain; }
.tile.local:not(.screen) video { transform: scaleX(-1); }
.tile.local.rear video { transform: none; }
.tile.speaking { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary), var(--glow); }
.tile .avatar { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, var(--elev2), var(--surface)); }
.tile .avatar span { width: clamp(56px, 22%, 120px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: clamp(1.2rem, 3vw, 2.4rem); font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--accent)); color: var(--on-primary); }
.tile .label { position: absolute; left: .5rem; bottom: .5rem; display: flex; align-items: center; gap: .35rem; max-width: calc(100% - 1rem); padding: .2rem .55rem; border-radius: 8px; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); font-size: .8rem; font-weight: 600; }
.tile .label .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .label .ic { opacity: .9; }
.tile .net { position: absolute; right: .5rem; top: .5rem; padding: .1rem .45rem; border-radius: 6px; background: rgba(0,0,0,.5); font-size: .68rem; font-family: var(--mono); color: var(--muted); }
.tile .net.bad { color: #ff8e91; background: rgba(80,0,0,.6); }
.tile .net.relay { color: var(--warn); }
.tile .net.debug { white-space: pre; text-align: right; line-height: 1.45; font-size: .66rem; color: #cfe3ee; background: rgba(0,0,0,.65); max-width: calc(100% - 1rem); overflow: hidden; }
.tile .hand { position: absolute; left: .5rem; top: .5rem; font-size: 1.4rem; animation: wave 1.2s ease-in-out infinite; }
.tile .status { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1rem; background: rgba(11,20,28,.7); font-size: .85rem; color: var(--muted); }
@keyframes wave { 0%,100% { transform: rotate(0); } 50% { transform: rotate(18deg); } }

.controls { display: flex; justify-content: center; align-items: center; gap: .5rem; padding: .6rem .8rem calc(.6rem + var(--safe-b)); border-top: 1px solid var(--border); flex-wrap: wrap; background: rgba(11,20,28,.9); }
.ctl { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border); background: var(--elev); color: var(--fg); display: inline-grid; place-items: center; cursor: pointer; position: relative; transition: .15s; padding: 0; }
.ctl svg { width: 22px; height: 22px; }
.ctl:hover { background: var(--elev2); }
.ctl.off { background: var(--danger); border-color: transparent; color: #fff; }
.ctl.on { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.ctl.leave { width: 64px; border-radius: 24px; background: var(--danger); color: #fff; border: 0; }
.ctl:disabled { opacity: .4; cursor: not-allowed; }
.ctl .count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.ctl-sep { width: 1px; height: 28px; background: var(--border); margin: 0 .2rem; }

.panel { width: 340px; flex: none; border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.panel-head b { font-size: .95rem; }
.panel-body { flex: 1; overflow: auto; padding: .8rem 1rem; min-height: 0; }
.panel-foot { padding: .7rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; }
.msg { margin-bottom: .8rem; }
.msg .meta { font-size: .72rem; color: var(--muted); }
.msg .bubble { display: inline-block; max-width: 100%; padding: .45rem .7rem; border-radius: 12px; background: var(--elev); white-space: pre-wrap; word-wrap: break-word; }
.msg.self { text-align: right; }
.msg.self .bubble { background: rgba(31,208,221,.16); border: 1px solid rgba(31,208,221,.25); text-align: left; }
.ppl { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.ppl li { display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem; border-radius: 10px; }
.ppl li:hover { background: var(--elev); }
.ppl .av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--accent)); color: var(--on-primary); }
.ppl .av.disp { background: var(--elev2); color: var(--fg); }
.ppl .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.ppl .nm small { display: block; color: var(--muted); font-size: .72rem; }
.ppl .acts { display: flex; gap: .1rem; }
.ppl .acts button { font-size: .85rem; }
.mod-tools { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.invite-box { display: grid; gap: .5rem; padding: .8rem; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 1rem; background: rgba(255,255,255,.02); }
.invite-box .mono { font-size: .78rem; word-break: break-all; color: var(--muted); }

.toasts { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 100; pointer-events: none; width: min(92vw, 420px); }
.toast { background: var(--elev2); border: 1px solid var(--border); padding: .6rem 1rem; border-radius: 12px; box-shadow: var(--shadow); font-size: .9rem; animation: tin .25s ease; text-align: center; }
.toast.err { border-color: rgba(229,72,77,.5); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }
.reaction-fly { position: fixed; bottom: 90px; font-size: 2.4rem; pointer-events: none; animation: fly 2.6s ease-out forwards; z-index: 90; }
@keyframes fly { to { transform: translateY(-55vh); opacity: 0; } }
.reactions { position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); display: flex; gap: .3rem; padding: .4rem; border-radius: 99px; background: var(--elev2); border: 1px solid var(--border); box-shadow: var(--shadow); }
.reactions button { font-size: 1.5rem; background: none; border: 0; cursor: pointer; padding: .1rem .3rem; border-radius: 8px; }
.reactions button:hover { background: var(--elev); }

.overlay-msg { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(11,20,28,.92); z-index: 200; padding: 1.5rem; text-align: center; }
.overlay-msg .card { max-width: 440px; display: grid; gap: 1rem; }

.show-m { display: none; }
@media (max-width: 760px) {
  .show-m { display: inline-flex; }
  .room-top { padding: .45rem .6rem; }
  .room-title img, .hide-m { display: none !important; }
  .room-title b { max-width: 52vw; font-size: .9rem; }
  .panel { position: absolute; inset: 0; width: auto; z-index: 20; border-left: 0; }
  .ctl { width: 44px; height: 44px; }
  .ctl.leave { width: 56px; }
  .ctl-sep { display: none; }
  .controls { gap: .35rem; }
  .stage { padding: .4rem; gap: .4rem; }
  .grid { gap: .4rem; }
  .stage.spot .grid { grid-auto-columns: 120px; }
}

/* =================== Display =================== */
.display-body { height: 100vh; overflow: hidden; cursor: none; background: #000; }
.display-body.show-cursor { cursor: default; }
.idle { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; background: radial-gradient(ellipse at top, rgba(31,208,221,.18), transparent 60%), radial-gradient(ellipse at bottom right, rgba(245,121,90,.10), transparent 55%), var(--bg); padding: 4vh 4vw; }
.idle img { height: clamp(40px, 8vh, 90px); }
.idle .code { font-family: var(--mono); font-size: clamp(3rem, 14vw, 12rem); font-weight: 800; letter-spacing: .12em; line-height: 1; margin: 3vh 0; background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.idle .clock { font-size: clamp(3rem, 12vw, 10rem); font-weight: 200; letter-spacing: -.03em; }
.idle .sub { color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.6rem); }
.idle .dname { font-size: clamp(1.2rem, 3vw, 2.2rem); font-weight: 600; margin-top: 2vh; }
.display-stage { position: fixed; inset: 0; padding: .6vw; display: grid; gap: .6vw; background: #000; }
.display-stage .tile { cursor: default; border-radius: 1vw; }
.display-stage .tile .label { font-size: clamp(.8rem, 1.2vw, 1.4rem); }
.display-stage.spot { grid-template-rows: 1fr auto; }
.display-stage.spot .grid { grid-auto-flow: column; grid-auto-columns: minmax(12vw, 18vw); grid-template-columns: none !important; height: 18vh; justify-content: center; }
.display-banner { position: fixed; top: 1vh; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.6); padding: .4em 1em; border-radius: 99px; font-size: clamp(.8rem, 1.1vw, 1.2rem); color: var(--muted); z-index: 5; }
.click-audio { position: fixed; bottom: 2vh; right: 2vw; z-index: 50; }

/* =================== Startsida (Google Meet-stil) =================== */
.gm { min-height: 100vh; display: flex; flex-direction: column; }
.gm-top { display: flex; align-items: center; justify-content: space-between; padding: .9rem clamp(1rem, 3vw, 2rem); }
.gm-top-right { display: flex; align-items: center; gap: 1rem; }
.gm-clock { color: var(--muted); font-size: 1.05rem; }
.gm-applink { color: var(--muted); font-size: .9rem; }
.gm-applink:hover { color: var(--fg); text-decoration: none; }
.gm-user { position: relative; }
.gm-avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; font: inherit; font-weight: 700; color: var(--on-primary); background: linear-gradient(135deg, var(--primary), var(--accent)); }
.gm-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; background: var(--elev); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: .4rem; z-index: 30; display: grid; }
.gm-menu a, .gm-menu button { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: 10px; color: var(--fg); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.gm-menu a:hover, .gm-menu button:hover { background: var(--elev2); text-decoration: none; }
.gm-menu svg { color: var(--muted); }
.gm-menu-head { padding: .6rem .9rem .8rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.gm-menu-head small { display: block; color: var(--muted); }
.gm-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: center; max-width: 1280px; width: 100%; margin: 0 auto; padding: 2rem clamp(1.2rem, 4vw, 3rem) 4rem; }
.gm-left h1 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 500; letter-spacing: -.02em; margin-bottom: .5em; }
.gm-left .lead { margin: 0 0 2.2rem; max-width: 560px; text-align: left; font-size: 1.1rem; }
.gm-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.gm-new { position: relative; }
.gm-new-menu { left: 0; right: auto; min-width: 290px; }
.gm-join { display: flex; align-items: center; gap: .3rem; }
.gm-code { display: flex; align-items: center; gap: .5rem; border: 1px solid rgba(255,255,255,.22); border-radius: 10px; padding: 0 .8rem; color: var(--muted); background: var(--surface); }
.gm-code:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(31,208,221,.25); }
.gm-code input { border: 0; background: transparent; padding: .8em 0; width: 240px; box-shadow: none !important; }
.btn-text { background: none; color: var(--primary); padding: .7em .9em; }
.btn-text:hover { background: rgba(31,208,221,.08); }
.btn-text:disabled { color: var(--muted); background: none; }
.gm-hr { border: 0; border-top: 1px solid var(--border); margin: 2.2rem 0 1.2rem; max-width: 560px; }
.gm-upcoming { display: grid; gap: .4rem; max-width: 560px; }
.gm-upcoming a { color: var(--fg); padding: .45rem .6rem; border-radius: 8px; }
.gm-upcoming a:hover { background: var(--elev); text-decoration: none; }
.gm-upcoming .mono { color: var(--primary); margin-right: .6rem; }

.gm-right { display: flex; justify-content: center; }
.gm-carousel { position: relative; width: 100%; max-width: 460px; text-align: center; }
.gm-slide { display: none; animation: tin .4s ease; }
.gm-slide.active { display: block; }
.gm-slide h2 { font-size: 1.5rem; font-weight: 500; margin: 1.6rem 0 .5rem; }
.gm-slide p { max-width: 380px; margin: 0 auto; }
.gm-art { width: 100%; max-width: 330px; aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(31,208,221,.18), rgba(18,28,37,.9) 70%); border: 1px solid var(--border); position: relative; display: grid; place-items: center; overflow: hidden; }
.gm-arrow { position: absolute; top: 165px; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.gm-arrow:hover { background: var(--elev); color: var(--fg); }
.gm-arrow.prev { left: 0; } .gm-arrow.next { right: 0; }
.gm-dots { display: flex; justify-content: center; gap: .5rem; margin-top: 1.2rem; }
.gm-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--elev2); cursor: pointer; }
.gm-dots i.on { background: var(--primary); }
/* Illustrationer (ritade i CSS) */
.art-grid { place-items: stretch; grid-template-columns: repeat(3, 70px); grid-auto-rows: 52px; gap: 6px; align-content: center; justify-content: center; display: grid; }
.art-tile { border-radius: 8px; display: grid; place-items: center; position: relative; }
.art-tile span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 700; background: rgba(255,255,255,.9); color: #13202b; }
.art-tile i { position: absolute; left: 5px; bottom: 4px; width: 26px; height: 4px; border-radius: 2px; background: rgba(0,0,0,.35); }
.t1 { background: #1fd0dd; } .t2 { background: #f5795a; } .t3 { background: #6c7cf5; } .t4 { background: #3cc775; } .t5 { background: #f2c14e; } .t6 { background: #c56cf0; }
.t1 { box-shadow: 0 0 0 3px #fff; }
.art-display { display: block; }
.art-screen { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); width: 200px; height: 118px; border-radius: 8px; background: #05090d; border: 4px solid #2a3846; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; }
.art-mini { border-radius: 3px; background: linear-gradient(135deg, #1fd0dd, #6c7cf5); }
.art-mini:nth-child(2) { background: linear-gradient(135deg, #f5795a, #f2c14e); } .art-mini:nth-child(3) { background: linear-gradient(135deg, #3cc775, #1fd0dd); } .art-mini:nth-child(4) { background: linear-gradient(135deg, #c56cf0, #f5795a); }
.art-stand { position: absolute; left: 50%; top: calc(30% + 118px); transform: translateX(-50%); width: 60px; height: 26px; background: #2a3846; clip-path: polygon(40% 0, 60% 0, 80% 100%, 20% 100%); }
.art-pin { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); font-family: var(--mono); font-weight: 800; font-size: 1.3rem; letter-spacing: .15em; color: var(--primary); }
.art-handset { width: 120px; height: 220px; border-radius: 22px; border: 5px solid #2a3846; background: linear-gradient(160deg, #6c7cf5, #1fd0dd); position: relative; overflow: hidden; }
.art-face { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.85); }
.art-face::after { content: ''; position: absolute; left: 50%; top: 62px; transform: translateX(-50%); width: 90px; height: 70px; border-radius: 50% 50% 0 0; background: rgba(255,255,255,.85); }
.art-self { position: absolute; right: 8px; top: 8px; width: 30px; height: 42px; border-radius: 6px; background: linear-gradient(135deg, #f5795a, #f2c14e); border: 2px solid #fff; }
.art-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: rgba(5,9,13,.75); display: flex; justify-content: center; align-items: center; gap: 8px; }
.art-bar i { width: 16px; height: 16px; border-radius: 50%; background: #2a3846; } .art-bar i.r { width: 24px; border-radius: 8px; background: #e5484d; }
/* Dialog */
.gm-modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 100; padding: 1rem; }
.gm-modal .card { position: relative; max-width: 440px; width: 100%; display: grid; gap: .8rem; box-shadow: var(--shadow); }
.gm-modal h2 { margin: 0; padding-right: 2rem; }
.gm-close { position: absolute; right: .8rem; top: .8rem; }
.gm-linkbox { display: flex; align-items: center; justify-content: space-between; gap: .5rem; background: var(--elev); border-radius: 10px; padding: .6rem .8rem; }
.gm-linkbox .mono { word-break: break-all; font-size: .85rem; }
@media (max-width: 900px) {
  .gm-main { grid-template-columns: 1fr; text-align: center; padding-top: 1rem; }
  .gm-left .lead, .gm-hr, .gm-upcoming { margin-left: auto; margin-right: auto; text-align: center; }
  .gm-actions { justify-content: center; }
  .gm-clock, .gm-applink { display: none; }
  .gm-code input { width: 180px; }
  .gm-art { max-width: 260px; }
  .gm-arrow { top: 130px; }
}
.check { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .88rem; cursor: pointer; } .check input { width: auto; accent-color: var(--primary); }

/* =================== Fjärrstyrning =================== */
.tile .rc-btn { position: absolute; left: 50%; top: .6rem; transform: translateX(-50%); z-index: 4; box-shadow: var(--shadow); }
.tile.rc-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); cursor: default; }
.rc-layer { position: absolute; inset: 0; z-index: 3; outline: none; cursor: default; touch-action: none; }
.rc-layer:focus-visible { outline: none; }
.rc-layer .rc-bar { position: absolute; left: 50%; bottom: .6rem; transform: translateX(-50%); padding: .3rem .8rem; border-radius: 99px; background: rgba(245,121,90,.92); color: #fff; font-size: .78rem; font-weight: 600; pointer-events: none; white-space: nowrap; }
.rc-layer:not(:focus) .rc-bar::after { content: ' (klicka för att fortsätta styra)'; font-weight: 400; }
.rc-picker .card { max-width: 760px; max-height: 86vh; overflow: auto; }
.rc-picker h3 { margin-top: .4rem; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; }
.src { display: grid; gap: .4rem; padding: .5rem; border-radius: 12px; border: 1px solid var(--border); background: var(--elev); color: var(--fg); cursor: pointer; font: inherit; text-align: left; }
.src:hover { border-color: var(--primary); }
.src img { width: 100%; aspect-ratio: 16/9; object-fit: contain; background: #000; border-radius: 8px; }
.src span { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
