:root {
  /* Palette tuned to Lorcana vibe */
  --lc-ink-900: #0a0b16;
  --lc-ink-800: #0f1224;
  --lc-ink-700: #141738;
  --lc-violet:  #6a5bd2;
  --lc-amethyst:#9a7cff;
  --lc-cyan:    #6ed6ff;
  --lc-aurora:  #19b4ff;
  --lc-aurora-2:#b36bff;
  --lc-gold-1:  #f6e6b8;
  --lc-gold-2:  #ffdf8b;
  --lc-gold-3:  #f3b84e;
  --lc-foil:    linear-gradient(135deg, #fff7d6 0%, #ffd86a 22%, #ffb347 38%, #ffe8a6 52%, #ffd86a 66%, #ffb347 82%, #fff7d6 100%);
  --lc-foil-soft: linear-gradient(135deg, rgba(255,248,214,.9), rgba(255,216,106,.7), rgba(255,179,71,.7), rgba(255,232,166,.85));
  --lc-blue-glow: 0 0 22px rgba(110,214,255,.25), 0 0 60px rgba(155,130,255,.18);
}

/* --------------------------------
   BACKDROP LAYERS
   -------------------------------- */
.theme-lorcana .lt-aether,
.theme-lorcana .lt-aurora,
.theme-lorcana .lt-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -3;
}

.theme-lorcana .lt-aether {
  background:
    radial-gradient(1000px 600px at 12% -10%, rgba(155,130,255,.18), transparent 60%),
    radial-gradient(900px 520px at 88% 110%, rgba(110,214,255,.12), transparent 60%),
    radial-gradient(1200px 900px at 50% 120%, rgba(15,18,36,.85), rgba(8,10,18,.96));
  filter: saturate(1.1);
}

.theme-lorcana .lt-aurora {
  background:
    conic-gradient(from 210deg at 30% 20%, rgba(179,107,255,.18), transparent 25%),
    conic-gradient(from 320deg at 70% 10%, rgba(25,180,255,.14), transparent 30%);
  mix-blend-mode: screen;
  animation: aurora-swim 26s linear infinite;
  z-index: -2;
}

.theme-lorcana .lt-stars {
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 30% 80%, rgba(255,255,255,.25), transparent 60%),
    radial-gradient(1px 1px at 70% 15%, rgba(255,255,255,.28), transparent 60%),
    radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,.2), transparent 60%),
    radial-gradient(1px 1px at 50% 45%, rgba(255,255,255,.22), transparent 60%);
  opacity: .5;
  animation: star-drift 90s linear infinite;
  z-index: -1;
}

@keyframes aurora-swim {
  0%   { transform: translate3d(0,0,0) }
  50%  { transform: translate3d(0,-1.5%,0) }
  100% { transform: translate3d(0,0,0) }
}
@keyframes star-drift {
  0%   { transform: translateY(0) }
  100% { transform: translateY(-120px) }
}

/* --------------------------------
   GLOBAL / TYPOGRAPHY
   -------------------------------- */
.theme-lorcana body {
  background: radial-gradient(1400px 900px at 50% -10%, rgba(106,91,210,.18), transparent 55%), var(--lc-ink-900) !important;
}
.theme-lorcana .lt-header {
  background:
    linear-gradient(180deg, rgba(19,23,56,.66), rgba(12,14,30,.66)),
    radial-gradient(900px 400px at 2% -40%, rgba(154,124,255,.18), transparent 60%),
    #0b0e1a;
  border-bottom: 1px solid rgba(255,255,255,.04);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.03), 0 18px 40px rgba(0,0,0,.45);
}
.theme-lorcana .lt-header h1,
.theme-lorcana .lt-header .brand,
.theme-lorcana h2, .theme-lorcana h3, .theme-lorcana h4 {
  font-family: "Cinzel", ui-serif, Georgia, Cambria, "Times New Roman", serif;
  letter-spacing: .3px;
}

/* Subtle embossed header title */
.theme-lorcana .lt-header h1,
.theme-lorcana .brand {
  text-shadow:
    0 1px 0 rgba(255,255,255,.05),
    0 8px 22px rgba(106,91,210,.35);
}

/* --------------------------------
   GOLD "FOIL" BORDERS
   Reusable utility for panels and frames
   -------------------------------- */
.theme-lorcana .foil,
.theme-lorcana .panel,
.theme-lorcana .side,
.theme-lorcana .remote-area,
.theme-lorcana #bottomBar,
.theme-lorcana .scan-card,
.theme-lorcana .card {
  position: relative;
  border-radius: 16px;
  background-clip: padding-box;
}

.theme-lorcana .panel,
.theme-lorcana .side,
.theme-lorcana .remote-area,
.theme-lorcana #bottomBar,
.theme-lorcana .scan-card,
.theme-lorcana .card {
  border: 1px solid transparent;
}

.theme-lorcana .panel::before,
.theme-lorcana .side::before,
.theme-lorcana .remote-area::before,
.theme-lorcana #bottomBar::before,
.theme-lorcana .scan-card::before,
.theme-lorcana .card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px; /* foil thickness */
  background: var(--lc-foil);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: .8;
}

/* Soft inner glow */
.theme-lorcana .panel::after,
.theme-lorcana .side::after,
.theme-lorcana .remote-area::after,
.theme-lorcana #bottomBar::after,
.theme-lorcana .scan-card::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 60px rgba(255, 226, 163, .06), inset 0 0 18px rgba(154, 124, 255, .08);
  pointer-events: none;
}

/* --------------------------------
   BUTTONS β gold edge + shimmer
   -------------------------------- */
/* Make the button a clipping container for the shine */
.theme-lorcana button,
.theme-lorcana .btn,
.theme-lorcana .btn-discord {
  position: relative;              /* for pseudos */
  overflow: hidden;                /* clips sheen */
  border-radius: 12px;
  border: 1px solid transparent;   /* keeps layout consistent */
  background-image: linear-gradient(180deg, rgba(26,32,61,.96), rgba(16,20,39,.96));
  background-clip: padding-box;    /* face stays inside the padding */
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  transition: transform .12s ease, filter .18s ease;
  isolation: isolate;              /* keeps z-index layering predictable */
}

/* GOLD FOIL BORDER  same mask trick as panels */
.theme-lorcana button::before,
.theme-lorcana .btn::before,
.theme-lorcana .btn-discord::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;                    /* border thickness */
  background: var(--lc-foil);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: .85;
  z-index: 1;                      /* sits above face bg, below sheen */
}

/* SHIMMER  slim diagonal glint */
.theme-lorcana button::after,
.theme-lorcana .btn::after,
.theme-lorcana .btn-discord::after {
  content:"";
  position:absolute;
  top:-40%;
  left:-30%;
  width:28%;
  height:180%;
  transform: translateX(-60%) rotate(20deg);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,.10) 40%,
    rgba(255,255,255,.24) 50%,
    rgba(255,255,255,.10) 60%,
    transparent 100%
  );
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease;
  will-change: transform, opacity;
  z-index: 2;                      /* above border */
}

.theme-lorcana button:hover::after,
.theme-lorcana .btn:hover::after,
.theme-lorcana .btn-discord:hover::after {
  opacity:.9;
  animation: lc-sheen 900ms cubic-bezier(.2,.6,.2,1);
}

@keyframes lc-sheen {
  0%   { transform: translateX(-60%) rotate(20deg); }
  100% { transform: translateX(260%) rotate(20deg); }
}
/* --------------------------------
   REMOTE VIDEO FRAME β ornate corners
   -------------------------------- */
.theme-lorcana .remote-frame {
  background:
    radial-gradient(60% 140% at 50% 0%, rgba(106,91,210,.18), transparent 60%),
    #000;
  box-shadow: var(--lc-blue-glow);
}

/* --------------------------------
   SCORES β βLore orbsβ
   -------------------------------- */
.theme-lorcana .score {
  background:
    linear-gradient(180deg, rgba(19,23,56,.72), rgba(10,12,26,.72));
  border-color: rgba(255, 226, 163, .28);
  box-shadow: inset 0 0 14px rgba(155,130,255,.14), 0 8px 22px rgba(0,0,0,.35);
}

.theme-lorcana .score h4 { color: #e9e8ff; text-shadow: 0 0 10px rgba(110,214,255,.25); }

.theme-lorcana .score input {
  background: radial-gradient(120% 160% at 50% -40%, rgba(255,234,164,.18), rgba(11,13,20,1));
  border: 1px solid rgba(255,226,163,.25);
  box-shadow: inset 0 6px 14px rgba(0,0,0,.55);
  font-weight: 800;
}

/* Tiny crystal divider inside score groups */
.theme-lorcana .score .btns::before {
  content:"";
  width:1px; height:18px;
  background: linear-gradient(var(--lc-gold-1), var(--lc-gold-3));
  opacity:.5; border-radius:999px;
}

/* --------------------------------
   BOTTOM BAR β glassy console
   -------------------------------- */
.theme-lorcana #bottomBar {
  background:
    linear-gradient(180deg, rgba(18,24,38,.72), rgba(14,18,28,.72));
  border-color: rgba(255,226,163,.25);
  box-shadow: var(--lc-blue-glow), inset 0 0 24px rgba(154,124,255,.12);
}
.theme-lorcana #bottomBar select {
  color: #f4f6ff;            /* bright text */
  caret-color: #ffeab7;      /* visible caret */
  font-weight: 700;          /* crisper glyphs */
  text-shadow: none;         /* avoid blur on dark bg */
  background:
    radial-gradient(160% 220% at 50% -60%, rgba(30,40,72,.25), rgba(11,13,20,1));
  border-color: rgba(255, 234, 183, .55); /* higher-contrast edge */
}

/* --------------------------------
   SIDEBAR / SCAN CARD β enchanted frame
   -------------------------------- */
.theme-lorcana .side {
  background:
    linear-gradient(180deg, rgba(21,28,43,.9), rgba(16,21,34,.92));
}
.theme-lorcana .side h3 {
  color: #ffeab7;
  text-shadow: 0 6px 18px rgba(255,226,163,.25);
  letter-spacing: .4px;
}

.theme-lorcana .scan-card {
  border-style: solid;
  background:
    radial-gradient(120% 200% at 0% 0%, rgba(154,124,255,.10), transparent 60%),
    radial-gradient(120% 200% at 100% 100%, rgba(110,214,255,.06), transparent 60%),
    linear-gradient(180deg, #151c2b, #101522);
}
.theme-lorcana .scan-preview img {
  border: 1px solid rgba(255,226,163,.35);
  box-shadow: 0 10px 28px rgba(0,0,0,.35), 0 0 40px rgba(155,130,255,.18);
}

/* --------------------------------
   DISCORD CARD β keep micro widget, add sheen
   -------------------------------- */
.theme-lorcana .microdcw .card {
  background:
    linear-gradient(180deg, rgba(14,18,34,.9), rgba(14,18,34,.92)),
    radial-gradient(120% 200% at 0% 0%, rgba(154,124,255,.08), transparent 60%),
    radial-gradient(120% 200% at 100% 100%, rgba(110,214,255,.06), transparent 60%);
}
.theme-lorcana .microdcw .card::before {
  content:"";
  position:absolute; inset:0;
  border-radius:16px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  opacity: .0; pointer-events:none;
}
.theme-lorcana .microdcw .card:hover::before { opacity: .4; animation: shimmer 1.5s ease; }

/* --------------------------------
   LOCAL THUMB STATES
   -------------------------------- */
.theme-lorcana #localThumb.cam-off::after {
  backdrop-filter: blur(2px);
  letter-spacing: .4px;
}
.theme-lorcana #localThumb .thumb-btn {
  border: 1px solid rgba(255,226,163,.28);
  background: linear-gradient(180deg, rgba(20,24,45,.8), rgba(10,12,26,.8));
}

/* --------------------------------
   HEADINGS / TITLES
   -------------------------------- */
.theme-lorcana h2 {
  color: #ffeab7;
  text-shadow: 0 0 24px rgba(255,226,163,.25), 0 6px 24px rgba(155,130,255,.25);
}
.theme-lorcana #lobby h2 { margin-bottom: 8px; }

/* --------------------------------
   FORM POLISH
   -------------------------------- */
.theme-lorcana #roomForm input,
.theme-lorcana #lobbyForm input {
  border:1px solid rgba(154,124,255,.28);
  background:
    radial-gradient(140% 180% at 50% -40%, rgba(154,124,255,.14), rgba(11,13,20,1));
  box-shadow: inset 0 6px 14px rgba(0,0,0,.55);
}
.theme-lorcana #roomForm input:focus,
.theme-lorcana #lobbyForm input:focus,
.theme-lorcana #bottomBar select:focus {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(20, 24, 45, .9),
        0 0 0 4px rgba(255, 234, 183, .45);
    border-color: rgba(255, 234, 183, .85);
}

/* --------------------------------
   ACCESSIBILITY FOCUS
   -------------------------------- */
.theme-lorcana :focus-visible {
  outline: 2px solid #ffeab7;
  outline-offset: 2px;
  border-radius: 10px;
}

/* --------------------------------
   RESPONSIVE TWEAK
   -------------------------------- */
@media (max-width: 1024px){
  .theme-lorcana .remote-frame::before,
  .theme-lorcana .remote-frame::after { inset: 8px; }
}

/* ===== Readability fix: inputs + selects ========================= */
.theme-lorcana #roomForm input,
.theme-lorcana #lobbyForm input,
.theme-lorcana #bottomBar select {
  color: #f4f6ff;            /* bright text */
  caret-color: #ffeab7;      /* visible caret */
  font-weight: 700;          /* crisper glyphs */
  text-shadow: none;         /* avoid blur on dark bg */
  background:
    radial-gradient(160% 220% at 50% -60%, rgba(30,40,72,.25), rgba(11,13,20,1));
  border-color: rgba(255, 234, 183, .55); /* higher-contrast edge */
}

/* Focus ring: clearer and accessible */
.theme-lorcana #roomForm input:focus,
.theme-lorcana #lobbyForm input:focus,
.theme-lorcana #bottomBar select:focus {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(20, 24, 45, .9),
    0 0 0 4px rgba(255, 234, 183, .45);
  border-color: rgba(255, 234, 183, .85);
}

/* Placeholder text: lighter but readable */
.theme-lorcana #roomForm input::placeholder,
.theme-lorcana #lobbyForm input::placeholder {
  color: #cfd6ff; /* soft-light */
  opacity: .9;
}

/* Dropdown list items (where supported) */
.theme-lorcana #bottomBar select,
.theme-lorcana #bottomBar select option {
  background-color: #0e1222; /* solid, dark */
  color: #f4f6ff;            /* bright text */
}

/* Disabled state still readable */
.theme-lorcana #roomForm input:disabled,
.theme-lorcana #lobbyForm input:disabled,
.theme-lorcana #bottomBar select:disabled {
  color: #c7cce6;
  border-color: rgba(255, 234, 183, .35);
  opacity: .9;
}

/* High-contrast bump for very small screens */
@media (max-width: 520px) {
  .theme-lorcana #roomForm input,
  .theme-lorcana #lobbyForm input,
  .theme-lorcana #bottomBar select {
    font-weight: 800;
  }
}