/* ══════════════════════════════════════════════════════════
   Content Check Calendar — styles.css
   Lighter premium dark theme, portrait iPhone 12 Pro Max
   ══════════════════════════════════════════════════════════ */

/* Fonts loaded via <link> in HTML with preconnect for performance */

:root {
  /* Background: slightly lighter for better readability on OLED */
  --bg:             #15131a;
  --bg-2:           #1c1928;
  --surface:        rgba(255,255,255,0.07);
  --surface-hover:  rgba(255,255,255,0.11);
  --surface-active: rgba(255,255,255,0.16);
  --border:         rgba(255,255,255,0.10);
  --border-hover:   rgba(255,255,255,0.18);

  /* Accents */
  --violet:         #8B73FF;
  --pink:           #FF6B8A;
  --cyan:           #22D3EE;
  --violet-dim:     rgba(139,115,255,0.18);
  --cyan-dim:       rgba(34,211,238,0.12);

  /* Text — AA/AAA contrast on dark bg */
  --text-1:         #F2F2F2;   /* 95% white — AA+ on #15131a */
  --text-2:         #C8C8D8;   /* solid colour, not opacity — readable */
  --text-3:         #8888A0;   /* secondary labels — AA on dark */

  --font-display:   'Syne', system-ui, sans-serif;
  --font-body:      'DM Sans', system-ui, sans-serif;

  /* ── Spring Physics Easing ── */
  /* Snabb studs — knappar, checkboxar */
  --spring-snap:    cubic-bezier(0.175, 0.885, 0.32, 1.275);
  /* Mjuk landning — modaler, sheets */
  --spring-soft:    cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Snabb respons utan studs — sidebar, overlay */
  --spring-crisp:   cubic-bezier(0.4, 0, 0.2, 1);
  /* Micro-bounce — icons, badges */
  --spring-bounce:  cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Legacy (behålls för bakåtkompatibilitet) */
  --t-fast:   0.12s var(--spring-crisp);
  --t-normal: 0.22s var(--spring-soft);
  --t-slow:   0.35s var(--spring-crisp);
  --r-sm:           6px;
  --r-md:           10px;
  --r-lg:           14px;
  --r-xl:           20px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --header-h:   60px;
  --footer-h:   64px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100dvh;
  overflow: hidden;
  /* Crisp subpixel rendering on iPhone Retina */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Prevent iOS bounce scroll on wrong elements */
  overscroll-behavior: none;
  /* Dark scrollbars / keyboard on iOS */
  color-scheme: dark;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }
ul, ol { list-style: none; }
img, svg { display: block; }

/* ══ AMBIENT ══ */
.bg-ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.22; animation: glowDrift 22s ease-in-out infinite alternate; }
.glow-1 { width: 420px; height: 420px; background: radial-gradient(circle,rgba(139,115,255,0.7),transparent 70%); top: -120px; left: -80px; }
.glow-2 { width: 340px; height: 340px; background: radial-gradient(circle,rgba(0,229,255,0.6),transparent 70%); bottom: 80px; right: -60px; animation-duration: 18s; animation-delay: -9s; }
.glow-3 { width: 280px; height: 280px; background: radial-gradient(circle,rgba(255,107,138,0.45),transparent 70%); top: 42%; left: 28%; animation-duration: 26s; animation-delay: -15s; }
@keyframes glowDrift { from { transform: translate(0,0) scale(1); } to { transform: translate(30px,18px) scale(1.08); } }

/* ══ GLASS ══ */
.glass-panel {
  background: rgba(22,22,38,0.82);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border);
}

/* ══ GRADIENT TEXT ══ */
.gradient-text {
  background: linear-gradient(110deg, var(--violet), var(--cyan));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ══ APP SHELL ══ */
.app-shell {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column; overflow: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  /* Subtle gradient lift — less flat than solid black */
  background: linear-gradient(160deg, #1c1928 0%, #15131a 60%, #0f0e14 100%);
}

/* ══ HEADER ══ */
.app-header {
  height: var(--header-h);
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 0 var(--sp-3);
  border-bottom: 1px solid var(--border);
  border-radius: 0; z-index: 100; flex-shrink: 0;
  background: rgba(21,19,26,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateZ(0);
  will-change: transform;
}
.sidebar-toggle {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); color: var(--text-2); flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-toggle:hover { background: var(--surface); color: var(--text-1); }

/* Header-actions döljs på välkomstsidan, visas när spel är aktiva */
.header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.welcome-visible .header-actions { display: none; }

/* Liten CCC-badge centrerad i headern på välkomstsidan */
.welcome-visible .app-header::after {
  content: 'CCC';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: linear-gradient(110deg, var(--violet), var(--cyan));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  pointer-events: none;
}

/* ══ BUTTONS ══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  border-radius: var(--r-md); font-size: 13px; font-weight: 600;
  height: 38px; padding: 0 var(--sp-4);
  transition: all var(--t-fast);
  white-space: nowrap; flex-shrink: 0;
  -webkit-user-select: none; user-select: none;
}
.btn:active { transform: scale(0.95); transition: transform 0.08s var(--spring-crisp); }
.btn-icon {
  width: 34px; height: 34px; padding: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--text-2);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
  position: relative;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.btn-icon svg { width: 14px; height: 14px; }
.btn-icon:hover { background: rgba(255,255,255,0.11); color: var(--text-1); border-color: rgba(255,255,255,0.16); }
.btn-icon:active { transform: scale(0.88); transition: transform 0.08s var(--spring-crisp); }

.btn-upload:hover { border-color: rgba(139,115,255,0.5); color: var(--violet); }
.btn-export:hover { border-color: rgba(0,229,255,0.4); color: var(--cyan); }
.btn-home:hover   { border-color: rgba(255,107,138,0.5); color: var(--pink); }
.btn-paste:hover  { border-color: rgba(100,220,160,0.5); color: #64DCa0; }
.btn-backup:hover { border-color: rgba(34,211,238,0.5); color: var(--cyan); }
.btn-restore:hover { border-color: rgba(139,115,255,0.5); color: var(--violet); }
.btn-primary {
  background: linear-gradient(135deg, #7C3AED, #8B5CF6);
  color: #fff;
  box-shadow: 0 2px 16px rgba(124,58,237,0.4);
}
.btn-primary:hover { box-shadow: 0 4px 24px rgba(139,92,246,0.55); filter: brightness(1.08); }
.btn-primary:focus-visible {
  outline: 3px solid rgba(139,92,246,0.5);
  outline-offset: 2px;
}
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text-1); }
.btn-danger { background: linear-gradient(135deg, #c0392b, #922b21); color: #fff; }
.btn-sm  { height: 34px; padding: 0 var(--sp-3); font-size: 12px; border-radius: var(--r-sm); }
.btn-lg  { height: 48px; padding: 0 var(--sp-6); font-size: 15px; border-radius: var(--r-lg); min-width: 130px; }

/* ══ LAYOUT ══ */
.layout-main { flex: 1; display: flex; overflow: hidden; position: relative; }

/* ══ SIDEBAR OVERLAY ══ */
.sidebar-overlay {
  position: absolute; inset: 0; z-index: 70;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: none;
}
.sidebar-overlay.visible { display: block; }

/* ══ SIDEBAR ══ */
.sidebar {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 82vw; max-width: 320px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border-hover);
  border-radius: 0 var(--r-xl) var(--r-xl) 0;
  z-index: 80;
  transform: translateX(-102%) translateZ(0);
  transition: transform 0.38s var(--spring-soft);
  overflow: hidden;
  padding-left: var(--safe-left);
  background: rgba(21,19,30,0.98);
  will-change: transform;
  backface-visibility: hidden;
}
.sidebar.open { transform: translateX(0); transition: transform 0.32s var(--spring-snap); }

.sidebar-header {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-4);
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
  background: rgba(139,115,255,0.08);
}
.sidebar-title { font-family: var(--font-display); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); flex: 1; }
.console-count-badge { background: var(--violet-dim); border: 1px solid rgba(139,115,255,0.35); color: var(--violet); font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; font-family: var(--font-display); }
.sidebar-close { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); color: var(--text-3); transition: all var(--t-fast); }
.sidebar-close:hover { background: var(--surface); color: var(--text-1); }

.sidebar-filters {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: var(--sp-2);
  flex-shrink: 0;
  background: rgba(255,255,255,0.02);
}
.filter-select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text-2);
  font-size: 13px; font-weight: 500; padding: 7px 26px 7px 10px;
  width: 100%; outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(240,240,248,0.4)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.filter-select option { background: #1a1a2e; }
.filter-pills { display: flex; gap: 6px; }
.filter-pill {
  flex: 1; height: 32px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-3);
  transition: all var(--t-fast);
}
.filter-pill.active { background: var(--violet-dim); border-color: rgba(139,115,255,0.45); color: var(--violet); }

/* ══ CONSOLE LIST ══ */
.console-list {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.console-list::-webkit-scrollbar { width: 3px; }
.console-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

/* ── Category separator — heavy divider ── */
.console-category-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4) var(--sp-2);
  margin-top: var(--sp-2);
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-3);
  font-family: var(--font-display);
  position: relative;
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease;
}
.console-category-label:active { opacity: 0.6; }
.console-category-label span { flex: 1; }
.cat-chevron {
  width: 12px; height: 12px; flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
  opacity: 0.5;
}
.console-category-label.collapsed .cat-chevron { transform: rotate(-90deg); }
.console-category-label::before {
  content: '';
  display: block;
  height: 2px;
  width: 100%;
  position: absolute;
  top: 0; left: 0; right: 0;
  background: linear-gradient(90deg, rgba(139,115,255,0.5), transparent);
}
.console-category-label:first-child::before { display: none; }

/* Färgad accent per kategori */
.console-category-label[data-cat^="home_"]   { color: rgba(139,115,255,0.85); }
.console-category-label[data-cat="addon"]    { color: rgba(144,238,144,0.75); }
.console-category-label[data-cat="handheld"] { color: rgba(0,229,255,0.8); }
.console-category-label[data-cat="computer"] { color: rgba(255,165,0,0.8); }
.console-category-label[data-cat="amiga"]    { color: rgba(255,165,0,0.7); }
.console-category-label[data-cat="pc"]       { color: rgba(200,200,220,0.7); }
.console-category-label[data-cat="arcade"]   { color: rgba(255,107,138,0.85); }
.console-category-label[data-cat="niche"]    { color: rgba(255,220,100,0.8); }
.console-category-label[data-cat="imported"] { color: rgba(240,240,248,0.45); }

.console-category-label[data-cat^="home_"]::before   { background: linear-gradient(90deg, rgba(139,115,255,0.5), transparent); }
.console-category-label[data-cat="addon"]::before    { background: linear-gradient(90deg, rgba(144,238,144,0.35), transparent); }
.console-category-label[data-cat="handheld"]::before { background: linear-gradient(90deg, rgba(0,229,255,0.45), transparent); }
.console-category-label[data-cat="computer"]::before { background: linear-gradient(90deg, rgba(255,165,0,0.45), transparent); }
.console-category-label[data-cat="amiga"]::before    { background: linear-gradient(90deg, rgba(255,165,0,0.35), transparent); }
.console-category-label[data-cat="pc"]::before       { background: linear-gradient(90deg, rgba(200,200,220,0.3), transparent); }
.console-category-label[data-cat="arcade"]::before   { background: linear-gradient(90deg, rgba(255,107,138,0.45), transparent); }
.console-category-label[data-cat="niche"]::before    { background: linear-gradient(90deg, rgba(255,220,100,0.35), transparent); }
.console-category-label[data-cat="imported"]::before { background: linear-gradient(90deg, rgba(255,255,255,0.12), transparent); }

.console-item {
  display: block; width: 100%;
  padding: 10px var(--sp-4) 10px var(--sp-5);
  cursor: pointer; text-align: left;
  border-left: 3px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.console-item:hover { background: var(--surface-hover); }
.console-item.active { background: var(--violet-dim); border-left-color: var(--violet); }
.console-item-name {
  font-size: 13.5px;  /* slightly larger for sidebar legibility */
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; margin-bottom: 4px; line-height: 1.25;
  letter-spacing: 0.01em;
}
.console-item.active .console-item-name { color: #d4c4ff; }
.console-item-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); margin-bottom: 5px; }
.ci-checked { color: rgba(0,229,255,0.7); font-weight: 600; }
.console-item-bar { height: 2px; background: rgba(255,255,255,0.07); border-radius: 2px; overflow: hidden; }
.console-item-bar-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--violet), var(--cyan)); transition: width 0.4s ease; }

.sidebar-empty { padding: var(--sp-8) var(--sp-5); text-align: center; color: var(--text-3); font-size: 13px; line-height: 1.7; }
.sidebar-empty .empty-icon { font-size: 28px; margin-bottom: var(--sp-3); }

/* ══ CONTENT AREA ══ */
.content-area { flex: 1; overflow: hidden; position: relative; display: flex; flex-direction: column; }

/* Drop overlay */
.drop-overlay { position: absolute; inset: 0; z-index: 200; background: rgba(11,11,22,0.9); backdrop-filter: blur(10px); display: none; align-items: center; justify-content: center; }
.drop-overlay.active { display: flex; }
.drop-inner { display: flex; flex-direction: column; align-items: center; gap: var(--sp-5); padding: var(--sp-8) var(--sp-6); border: 2px dashed rgba(139,115,255,0.5); border-radius: var(--r-xl); background: rgba(139,115,255,0.07); animation: dropPulse 1.5s ease-in-out infinite; }
.drop-inner p { font-size: 18px; font-weight: 700; color: var(--text-2); }
@keyframes dropPulse { 0%,100% { border-color: rgba(139,115,255,0.4); } 50% { border-color: rgba(0,229,255,0.6); } }

/* ══ WELCOME STATE ══ */
.welcome-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 28px 0 48px;
}
.welcome-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 340px;
  padding: 0 16px;
  gap: 0;
}
.welcome-gfx { position: relative; width: 88px; height: 88px; display: flex; align-items: center; justify-content: center; }
.ring { position: absolute; border-radius: 50%; border: 1px solid; animation: ringPulse 3s ease-in-out infinite; }
.ring-1 { inset: 0; border-color: rgba(139,115,255,0.5); }
.ring-2 { inset: -10px; border-color: rgba(0,229,255,0.28); animation-delay: 0.9s; }
.ring-3 { inset: -22px; border-color: rgba(255,107,138,0.16); animation-delay: 1.8s; }
@keyframes ringPulse { 0%,100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
.welcome-emoji { font-size: 36px; position: relative; z-index: 1; }
.welcome-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--text-1); line-height: 1.2; }
.welcome-desc { font-size: 14px; color: var(--text-2); line-height: 1.65; }
.welcome-chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); display: flex; flex-direction: column; gap: 2px; min-width: 88px; }
.chip-cat { font-size: 10px; font-weight: 700; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-display); }
.chip-n { font-size: 18px; font-weight: 800; color: var(--text-1); font-family: var(--font-display); }
.welcome-btns { display: flex; gap: var(--sp-3); }

/* ══ GAMES VIEW ══ */
.games-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ══ TXT UPLOAD PANEL ══ */
.txt-upload-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--sp-8) var(--sp-5); }
.txt-upload-panel[hidden] { display: none; }
.tup-inner { display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); text-align: center; max-width: 300px; }
.tup-icon { font-size: 44px; }
.tup-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--text-1); }
.tup-desc { font-size: 14px; color: var(--text-2); line-height: 1.65; }
.tup-desc strong { color: var(--cyan); font-weight: 600; }
.tup-hint {
  background: rgba(139,115,255,0.1);
  border: 1px solid rgba(139,115,255,0.25);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: 12px; color: var(--text-2); line-height: 1.6;
  text-align: left; width: 100%;
}
.tup-hint code { color: var(--cyan); font-family: monospace; font-size: 12px; }

/* ══ TXT PREVIEW PANEL ══ */
.txt-preview-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.txt-preview-panel[hidden] { display: none; }
.tpp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: rgba(139,115,255,0.08);
  flex-shrink: 0;
}
.tpp-info { display: flex; flex-direction: column; gap: 2px; }
.tpp-count { font-family: var(--font-display); font-size: 14px; font-weight: 800; color: var(--violet); }
.tpp-sub { font-size: 11px; color: var(--text-3); }
.tpp-actions { display: flex; gap: var(--sp-2); }
.tpp-list { flex: 1; overflow-y: auto; padding: var(--sp-3) var(--sp-4); -webkit-overflow-scrolling: touch; }
.tpp-list::-webkit-scrollbar { width: 3px; }
.tpp-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.tpp-item { display: flex; align-items: center; gap: var(--sp-3); padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 13px; color: var(--text-1); }
.tpp-item:last-child { border-bottom: none; }
.tpp-num { font-size: 11px; color: var(--text-3); min-width: 28px; text-align: right; font-family: var(--font-display); font-weight: 600; }
.tpp-game { flex: 1; }

/* ══ CONSOLE HEADER ══ */
.console-header { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); flex-shrink: 0; background: rgba(0,0,0,0.25); }
.ch-title-row { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.ch-emoji { font-size: 16px; }
.ch-name { font-family: var(--font-display); font-size: 16px; font-weight: 800; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.ch-category { font-size: 10px; font-weight: 700; color: var(--violet); background: var(--violet-dim); border: 1px solid rgba(139,115,255,0.28); border-radius: 99px; padding: 2px 8px; text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0; font-family: var(--font-display); }
.ch-progress-row { display: flex; align-items: center; gap: var(--sp-2); }
.progress-track { flex: 1; height: 5px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--violet), var(--cyan)); transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }
.progress-pct { font-size: 12px; font-weight: 800; color: var(--text-2); font-family: var(--font-display); min-width: 32px; text-align: right; }
.progress-detail { font-size: 11px; color: var(--text-3); }

/* ══ VS WRAPPER — håller scroll + alfa-nav sida vid sida ══ */
.vs-wrapper {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  position: relative;
}

/* ══ VIRTUAL SCROLL ══ */
.virtual-scroll-container {
  flex: 1; overflow-y: auto; overflow-x: hidden; position: relative;
  padding: var(--sp-3); outline: none;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  transform: translateZ(0);
  will-change: scroll-position;
}
.virtual-scroll-container::-webkit-scrollbar { width: 3px; }
.virtual-scroll-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.virtual-scroll-spacer { width: 100%; position: absolute; top: 0; left: 0; pointer-events: none; }
.virtual-scroll-items { position: absolute; left: var(--sp-3); right: var(--sp-3); top: var(--sp-3); }

/* ══ ALFA-NAV ══ */
.alpha-nav {
  width: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  background: transparent;
  z-index: 10;
}
.alpha-nav-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  height: 100%;
  justify-content: space-evenly;
}
.alpha-btn {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-3);
  border-radius: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  line-height: 1;
}
.alpha-btn:active,
.alpha-btn.active {
  background: var(--violet);
  color: white;
  transform: scale(1.2);
}
.alpha-btn.has-entries {
  color: var(--text-2);
}
.alpha-btn.empty {
  opacity: 0.25;
  pointer-events: none;
}

/* ══ GAME CARD ══ */
.game-card {
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-lg);
  padding: 7px 10px 8px;
  display: flex; flex-direction: column; gap: 5px;
  position: absolute; left: 0; right: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 2px 8px rgba(0,0,0,0.25);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
  will-change: transform;
}

/* Glass lift — premium tap-feedback */
.game-card:active {
  transform: scale(0.982) translateY(-1px);
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 8px 24px rgba(0,0,0,0.4),
    0 2px 8px rgba(0,0,0,0.3);
}

.game-card.fully-checked {
  border-color: rgba(34,211,238,0.28);
  background: rgba(34,211,238,0.05);
  box-shadow: inset 0 1px 0 rgba(34,211,238,0.1), 0 2px 8px rgba(0,0,0,0.25);
}
.game-card.fully-checked:active {
  background: rgba(34,211,238,0.10);
  border-color: rgba(34,211,238,0.5);
  box-shadow:
    inset 0 1px 0 rgba(34,211,238,0.2),
    0 8px 24px rgba(34,211,238,0.15),
    0 2px 8px rgba(0,0,0,0.3);
}

/* Status: subtil vänsterkant + svag bakgrundston */
.game-card.status-red {
  border-left: 2px solid rgba(255,80,100,0.35);
}
.game-card.status-yellow {
  border-left: 2px solid rgba(255,190,50,0.35);
}
.game-card.status-green {
  border-left: 2px solid rgba(34,211,130,0.35);
}

/* Global search console badge */
.global-console-badge {
  font-size: 10px;
  color: var(--text-3);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

.game-card-top { display: flex; align-items: flex-start; gap: var(--sp-2); }
.game-info { flex: 1; min-width: 0; }
.game-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.25;
  letter-spacing: 0.01em;
}
.game-date {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 1px;
}
.complete-badge { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); flex-shrink: 0; margin-top: 4px; opacity: 0; transition: opacity var(--t-normal); }
.game-card.fully-checked .complete-badge { opacity: 1; }

/* ══ PLATFORM ICONS ══ */
.platform-icons { display: flex; gap: 4px; }
.platform-btn {
  flex: 1;
  height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  transition:
    transform 0.18s var(--spring-snap),
    box-shadow 0.18s var(--spring-crisp),
    border-color 0.18s var(--spring-crisp),
    background 0.18s var(--spring-crisp);
  position: relative; overflow: hidden; cursor: pointer;
  -webkit-tap-highlight-color: transparent; min-width: 0;
  will-change: transform;
}
.platform-btn::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  transition: opacity 0.22s var(--spring-crisp);
}
/* Press-down — snabb komprimering */
.platform-btn:active {
  transform: scale(0.86);
  transition: transform 0.08s var(--spring-crisp);
}
/* Checked state — spring-bounce på ikonen */
.platform-btn.checked {
  transform: scale(1.0);
}
.platform-icon {
  width: 15px; height: 15px; position: relative; z-index: 1;
  font-size: 12px; line-height: 1;
  color: rgba(255,255,255,0.35);
  transition: color 0.18s var(--spring-crisp), transform 0.25s var(--spring-bounce);
  display: flex; align-items: center; justify-content: center;
}
/* Ikon studsar när checked */
.platform-btn.checked .platform-icon {
  transform: scale(1.15);
}

/* ══════════════════════════════════════════════════════════
   PLATFORM IDENTITY MICRO-COLORWAYS
   Vila: monokrom + subtil border
   Checked: varumärkesfärger + glow + icon-color
   URL sparad: extra ring + starkare glow
   ══════════════════════════════════════════════════════════ */

/* ── TikTok — cyan/magenta glitch ── */
.platform-btn[data-platform="tiktok"]::before {
  background: linear-gradient(135deg, #ff0050 0%, #000 50%, #00f2ea 100%);
}
.platform-btn[data-platform="tiktok"]:not(.checked) .platform-icon { color: rgba(255,255,255,0.28); }
.platform-btn[data-platform="tiktok"].checked {
  border-color: rgba(255,0,80,0.6);
  box-shadow: 0 0 14px rgba(255,0,80,0.35), 0 0 28px rgba(0,242,234,0.12);
}
.platform-btn[data-platform="tiktok"].checked::before { opacity: 0.28; }
.platform-btn[data-platform="tiktok"].checked .platform-icon {
  color: #ff2d6b;
  filter: drop-shadow(0 0 4px rgba(0,242,234,0.7));
}
/* URL-sparad: cyan ring */
.platform-cell:has(.url-dot.has-url) .platform-btn[data-platform="tiktok"].checked {
  box-shadow: 0 0 0 1.5px rgba(0,242,234,0.6), 0 0 16px rgba(255,0,80,0.4);
}

/* ── Instagram — solnedgångsgradient ── */
.platform-btn[data-platform="instagram"]::before {
  background: linear-gradient(135deg, #f58529 0%, #dd2a7b 50%, #8134af 100%);
}
.platform-btn[data-platform="instagram"]:not(.checked) .platform-icon { color: rgba(255,255,255,0.28); }
.platform-btn[data-platform="instagram"].checked {
  border-color: rgba(221,42,123,0.6);
  box-shadow: 0 0 14px rgba(221,42,123,0.35), 0 0 28px rgba(245,133,41,0.12);
}
.platform-btn[data-platform="instagram"].checked::before { opacity: 0.28; }
.platform-btn[data-platform="instagram"].checked .platform-icon {
  color: #f58529;
  filter: drop-shadow(0 0 4px rgba(221,42,123,0.8));
}
.platform-cell:has(.url-dot.has-url) .platform-btn[data-platform="instagram"].checked {
  box-shadow: 0 0 0 1.5px rgba(245,133,41,0.7), 0 0 18px rgba(221,42,123,0.4);
}

/* ── YouTube — signal-röd ── */
.platform-btn[data-platform="youtube"]::before {
  background: linear-gradient(135deg, #ff0000 0%, #c4302b 100%);
}
.platform-btn[data-platform="youtube"]:not(.checked) .platform-icon { color: rgba(255,255,255,0.28); }
.platform-btn[data-platform="youtube"].checked {
  border-color: rgba(255,0,0,0.55);
  box-shadow: 0 0 14px rgba(255,0,0,0.35), 0 0 28px rgba(196,48,43,0.12);
}
.platform-btn[data-platform="youtube"].checked::before { opacity: 0.24; }
.platform-btn[data-platform="youtube"].checked .platform-icon {
  color: #ff4444;
  filter: drop-shadow(0 0 4px rgba(255,0,0,0.7));
}
.platform-cell:has(.url-dot.has-url) .platform-btn[data-platform="youtube"].checked {
  box-shadow: 0 0 0 1.5px rgba(255,68,68,0.7), 0 0 18px rgba(255,0,0,0.4);
}

/* ── Facebook — djupblå ── */
.platform-btn[data-platform="facebook"]::before {
  background: linear-gradient(135deg, #1877f2 0%, #0c4a9e 100%);
}
.platform-btn[data-platform="facebook"]:not(.checked) .platform-icon { color: rgba(255,255,255,0.28); }
.platform-btn[data-platform="facebook"].checked {
  border-color: rgba(24,119,242,0.55);
  box-shadow: 0 0 14px rgba(24,119,242,0.35), 0 0 28px rgba(12,74,158,0.15);
}
.platform-btn[data-platform="facebook"].checked::before { opacity: 0.24; }
.platform-btn[data-platform="facebook"].checked .platform-icon {
  color: #5ba4f5;
  filter: drop-shadow(0 0 4px rgba(24,119,242,0.8));
}
.platform-cell:has(.url-dot.has-url) .platform-btn[data-platform="facebook"].checked {
  box-shadow: 0 0 0 1.5px rgba(91,164,245,0.7), 0 0 18px rgba(24,119,242,0.4);
}

/* ── X — stål-vit ── */
.platform-btn[data-platform="x"]::before {
  background: linear-gradient(135deg, #e7e9ea 0%, #657786 100%);
}
.platform-btn[data-platform="x"]:not(.checked) .platform-icon { color: rgba(255,255,255,0.28); }
.platform-btn[data-platform="x"].checked {
  border-color: rgba(231,233,234,0.38);
  box-shadow: 0 0 12px rgba(231,233,234,0.15), 0 0 24px rgba(101,119,134,0.08);
}
.platform-btn[data-platform="x"].checked::before { opacity: 0.16; }
.platform-btn[data-platform="x"].checked .platform-icon {
  color: #e7e9ea;
  filter: drop-shadow(0 0 3px rgba(231,233,234,0.6));
}
.platform-cell:has(.url-dot.has-url) .platform-btn[data-platform="x"].checked {
  box-shadow: 0 0 0 1.5px rgba(231,233,234,0.5), 0 0 14px rgba(231,233,234,0.18);
}

/* ── Snapchat — elektrisk gul ── */
.platform-btn[data-platform="snapchat"]::before {
  background: linear-gradient(135deg, #fffc00 0%, #29cc41 100%);
}
.platform-btn[data-platform="snapchat"]:not(.checked) .platform-icon { color: rgba(255,255,255,0.28); }
.platform-btn[data-platform="snapchat"].checked {
  border-color: rgba(255,252,0,0.55);
  box-shadow: 0 0 14px rgba(255,252,0,0.28), 0 0 28px rgba(41,204,65,0.1);
}
.platform-btn[data-platform="snapchat"].checked::before { opacity: 0.2; }
.platform-btn[data-platform="snapchat"].checked .platform-icon {
  color: #fffc00;
  filter: drop-shadow(0 0 5px rgba(255,252,0,0.7));
}
.platform-cell:has(.url-dot.has-url) .platform-btn[data-platform="snapchat"].checked {
  box-shadow: 0 0 0 1.5px rgba(255,252,0,0.7), 0 0 18px rgba(255,252,0,0.3);
}

@keyframes platformPulse {
  0%   { transform: scale(0.86); }
  40%  { transform: scale(1.18); }
  65%  { transform: scale(0.95); }
  82%  { transform: scale(1.06); }
  100% { transform: scale(1.0); }
}
.platform-btn.pulse {
  animation: platformPulse 0.42s var(--spring-snap) forwards;
}



/* ══ FOOTER ══ */
.app-footer {
  display: flex; align-items: center;
  padding: 8px 14px calc(8px + var(--safe-bottom));
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0; z-index: 50;
  background: rgba(12,10,20,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateZ(0);
}
.footer-prog    { display: none; }
.footer-actions { display: flex; gap: 8px; width: 100%; }

/* Reset */
.btn-reset {
  flex: 1; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 600; font-family: var(--font-body);
  letter-spacing: 0.01em; color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.15s ease;
  -webkit-user-select: none; user-select: none;
}
.btn-reset:active {
  background: rgba(255,60,90,0.12);
  border-color: rgba(255,60,90,0.3);
  color: #ff6b8a;
  transform: scale(0.96);
}

/* Save */
.btn-save {
  flex: 2; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 14px; font-weight: 700; font-family: var(--font-body);
  letter-spacing: 0.02em; color: #fff;
  background: linear-gradient(135deg, #9B8AFF 0%, #7B61FF 45%, #5B45D4 100%);
  border: 1px solid rgba(155,138,255,0.3);
  box-shadow: 0 4px 16px rgba(123,97,255,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: all 0.15s ease;
  -webkit-user-select: none; user-select: none;
}
.btn-save:active { transform: scale(0.96); box-shadow: 0 2px 8px rgba(123,97,255,0.25); }

/* ══ TOAST ══ */
.toast-container { position: fixed; bottom: calc(80px + var(--safe-bottom) + 10px); left: var(--sp-4); right: var(--sp-4); z-index: 999; display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none; }
.toast { background: rgba(22,22,38,0.96); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); font-size: 13px; font-weight: 500; color: var(--text-1); display: flex; align-items: center; gap: var(--sp-3); box-shadow: 0 8px 32px rgba(0,0,0,0.4); animation: toastIn 0.22s cubic-bezier(0.4,0,0.2,1); pointer-events: auto; }
.toast.toast-out { animation: toastOut 0.18s ease forwards; }
.toast-icon { font-size: 15px; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--cyan); }
.toast-error   { border-left: 3px solid var(--pink); }
.toast-info    { border-left: 3px solid var(--violet); }
@keyframes toastIn  { from { opacity:0; transform:translateY(10px) scale(0.96); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes toastOut { from { opacity:1; transform:translateY(0) scale(1); } to { opacity:0; transform:translateY(6px) scale(0.97); } }

/* ══ MODAL ══ */
.modal-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(0,0,0,0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: flex-end; justify-content: center; padding: var(--sp-4); padding-bottom: calc(var(--sp-4) + var(--safe-bottom)); animation: fadeIn 0.18s var(--spring-crisp); }
.modal-backdrop[hidden] { display: none; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.modal { border-radius: var(--r-xl); padding: var(--sp-6); width: 100%; max-width: 420px; animation: sheetUp 0.34s var(--spring-snap); }
@keyframes sheetUp {
  from { opacity:0; transform: translateY(48px) scale(0.96); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
.modal-title { font-family: var(--font-display); font-size: 17px; font-weight: 800; margin-bottom: var(--sp-2); }
.modal-desc { font-size: 14px; color: var(--text-2); line-height: 1.6; margin-bottom: var(--sp-5); }
.modal-actions { display: flex; gap: var(--sp-3); }
.modal-actions .btn { flex: 1; justify-content: center; }

* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
::selection { background: rgba(139,115,255,0.35); color: var(--text-1); }

.welcome-text { display: flex; flex-direction: column; gap: 4px; align-items: center; margin-bottom: 24px; margin-top: 8px; }
.welcome-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.welcome-desc  { font-size: 12px; color: var(--text-3); line-height: 1.5; margin-top: 2px; letter-spacing: 0.01em; }

/* ══ FUNKTIONSKNAPPAR — 2 rader, 3 per rad ══ */
.welcome-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  margin-bottom: 16px;
}
.wag-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 8px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.wag-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.8; }
.wag-item span {
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.2;
  color: var(--text-3);
}
.wag-item:active { transform: scale(0.93); background: rgba(255,255,255,0.09); transition: transform 0.08s var(--spring-crisp), background 0.1s var(--spring-crisp); }
#wag-sidebar {
  border-color: rgba(139,115,255,0.22);
  background: rgba(139,115,255,0.07);
  color: var(--violet);
}
#wag-sidebar span { color: var(--violet); opacity: 0.9; }
.wag-accent {
  border-color: rgba(34,211,238,0.22);
  background: rgba(34,211,238,0.06);
  color: var(--cyan);
}
.wag-accent span { color: var(--cyan); opacity: 0.9; }

.welcome-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 14px;
  text-align: center;
}
.welcome-hint strong { color: var(--cyan); }

/* ══ SOCIALA PLATTFORMAR ══ */
.welcome-platforms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: 100%;
}
.wp-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 4px 9px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
}
.wp-item svg  { width: 20px; height: 20px; }
.wp-item span { font-size: 9px; font-weight: 700; letter-spacing: 0.05em; font-family: var(--font-display); }
.wp-tiktok { border-color: rgba(255,0,80,0.2);     background: rgba(255,0,80,0.07);    color: #ff6b9d; }
.wp-ig     { border-color: rgba(221,42,123,0.2);   background: rgba(221,42,123,0.07);  color: #f58529; }
.wp-yt     { border-color: rgba(255,0,0,0.2);      background: rgba(255,0,0,0.07);     color: #ff4444; }
.wp-fb     { border-color: rgba(24,119,242,0.2);   background: rgba(24,119,242,0.07);  color: #4e9ff2; }
.wp-x      { border-color: rgba(231,233,234,0.12); background: rgba(231,233,234,0.04); color: #e7e9ea; }
.wp-snap   { border-color: rgba(255,252,0,0.2);    background: rgba(255,252,0,0.06);   color: #fffc00; }

/* ══ PLATFORM ICON SVG sizing ══ */
.platform-icon { width: 16px !important; height: 16px !important; display: flex; align-items: center; justify-content: center; }
.platform-icon svg { width: 16px; height: 16px; display: block; }

/* ══ PLATFORM CELL — wraps btn + url-dot ══ */
.platform-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  min-width: 0;
}
/* platform-btn takes full width inside cell */
.platform-cell .platform-btn {
  flex: none;
  width: 100%;
}

/* ══ URL DOT ══ */
.url-dot {
  width: 100%;
  height: 14px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast), background var(--t-fast);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.url-dot svg {
  width: 9px;
  height: 9px;
  color: rgba(255,255,255,0.25);
  transition: color var(--t-fast);
}
/* Show dot only when platform is checked */
.platform-btn.checked ~ .url-dot,
.platform-cell:has(.platform-btn.checked) .url-dot {
  opacity: 1;
  pointer-events: auto;
}
/* Has a saved URL — glow cyan */
.url-dot.has-url {
  opacity: 1;
  pointer-events: auto;
}
.url-dot.has-url svg {
  color: var(--cyan);
  filter: drop-shadow(0 0 3px rgba(34,211,238,0.6));
}
.url-dot:active { background: rgba(255,255,255,0.08); transform: scale(0.9); }

/* ══ URL MODAL ══ */
.url-modal {
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
}
.url-modal-header {
  margin-bottom: var(--sp-4);
}
.url-modal-header .modal-title {
  margin-bottom: 4px;
}
.url-modal-game {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.url-modal-input-wrap {
  position: relative;
  margin-bottom: var(--sp-4);
}
.url-modal-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-3);
  pointer-events: none;
}
.url-modal-input {
  width: 100%;
  height: 48px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid var(--border-hover);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-size: 14px;
  padding: 0 var(--sp-4) 0 38px;
  outline: none;
  transition: border-color var(--t-fast);
  -webkit-appearance: none;
}
.url-modal-input:focus {
  border-color: var(--violet);
  background: rgba(139,115,255,0.08);
}
.url-modal-input::placeholder { color: var(--text-3); }
.url-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}
.url-modal-main-actions {
  display: flex;
  gap: var(--sp-2);
}
.url-modal-delete-btn {
  color: var(--pink);
  font-size: 13px;
  font-weight: 600;
  gap: 5px;
  height: 38px;
  padding: 0 var(--sp-3);
  border: 1px solid rgba(255,107,138,0.2);
  border-radius: var(--r-md);
  background: rgba(255,107,138,0.06);
  transition: all var(--t-fast);
}
.url-modal-delete-btn:active { background: rgba(255,107,138,0.18); }
.url-modal-cancel { min-width: 72px; }
.url-modal-save   { min-width: 80px; }

/* ══════════════════════════════════════════════════════════
   FAB — Floating Action Button + Context Menu
   ══════════════════════════════════════════════════════════ */

.fab-container {
  position: fixed;
  bottom: calc(90px + var(--safe-bottom));
  right: 18px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Huvud-knapp */
.fab-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9B8AFF 0%, #7B61FF 50%, #5B45D4 100%);
  border: none;
  box-shadow: 0 4px 20px rgba(123,97,255,0.5), 0 0 0 1px rgba(155,138,255,0.3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  position: relative;
}
.fab-btn:active { transform: scale(0.92); }
.fab-btn.open   { transform: rotate(45deg); box-shadow: 0 6px 28px rgba(123,97,255,0.6); }

.fab-icon-plus, .fab-icon-close {
  width: 22px; height: 22px;
  color: white;
  position: absolute;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.fab-icon-close { opacity: 0; transform: rotate(-45deg) scale(0.7); }
.fab-btn.open .fab-icon-plus  { opacity: 0; transform: rotate(45deg) scale(0.7); }
.fab-btn.open .fab-icon-close { opacity: 1; transform: rotate(0) scale(1); }

/* Context menu */
.fab-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  animation: fabMenuIn 0.32s var(--spring-bounce);
}
@keyframes fabMenuIn {
  from { opacity: 0; transform: translateY(12px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fab-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 14px;
  border-radius: 24px;
  background: rgba(30,26,50,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  color: var(--text-1);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  transition: background 0.15s ease, transform 0.12s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.fab-menu-item svg { width: 16px; height: 16px; color: var(--violet); flex-shrink: 0; }
.fab-menu-item:active { background: rgba(139,115,255,0.2); transform: scale(0.96); }

/* FAB döljs på välkomstsidan */
.welcome-visible .fab-container { display: none !important; }

/* ══════════════════════════════════════════════════════════
   RADIAL ACTION MENU — long-press på spelkort
   ══════════════════════════════════════════════════════════ */

.radial-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  pointer-events: all;
  -webkit-user-select: none;
  user-select: none;
}
.radial-overlay[hidden] { display: none; }

.radial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 14, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: radialFadeIn 0.18s var(--spring-crisp) forwards;
}
@keyframes radialFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Centrerad runt fingret */
.radial-ring {
  position: absolute;
  width: 0; height: 0;
  /* left/top sätts dynamiskt via JS */
}

/* Varje åtgärdsknapp */
.radial-item {
  position: absolute;
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(22, 18, 40, 0.97);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  cursor: pointer;
  color: var(--text-1);
  /* Start: kollapserad runt fingret */
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition:
    transform 0.32s var(--spring-bounce),
    opacity 0.2s var(--spring-crisp),
    background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.radial-item.visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.radial-item:active {
  transform: translate(-50%, -50%) scale(0.88);
  transition: transform 0.08s var(--spring-crisp);
}
.radial-item svg {
  width: 20px; height: 20px;
  flex-shrink: 0;
}
.radial-item-label {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: var(--font-display);
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1;
  white-space: nowrap;
}

/* Färgprofiler per åtgärd */
.radial-item.action-check-all {
  border-color: rgba(34,211,238,0.35);
  background: rgba(16, 36, 48, 0.97);
  color: var(--cyan);
}
.radial-item.action-check-all .radial-item-label { color: var(--cyan); opacity: 0.7; }
.radial-item.action-check-all:active { background: rgba(34,211,238,0.15); }

.radial-item.action-clear-all {
  border-color: rgba(255,107,138,0.35);
  background: rgba(40, 14, 22, 0.97);
  color: var(--pink);
}
.radial-item.action-clear-all .radial-item-label { color: var(--pink); opacity: 0.7; }
.radial-item.action-clear-all:active { background: rgba(255,107,138,0.18); }

.radial-item.action-note {
  border-color: rgba(255,200,80,0.35);
  background: rgba(40, 32, 8, 0.97);
  color: #ffd060;
}
.radial-item.action-note .radial-item-label { color: #ffd060; opacity: 0.7; }
.radial-item.action-note:active { background: rgba(255,200,80,0.15); }

/* Label under menyn */
.radial-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 15%;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  pointer-events: none;
  animation: radialFadeIn 0.25s 0.1s var(--spring-crisp) both;
}

/* Fingercentrum-dot */
.radial-ring::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  top: -5px; left: -5px;
  box-shadow: 0 0 12px rgba(255,255,255,0.3);
  animation: radialFadeIn 0.15s var(--spring-crisp) forwards;
}
