
:root{
  --afk-lr-bg-a: rgba(10,14,16,0.92);
  --afk-lr-bg-b: rgba(4,6,8,0.92);
  --afk-lr-line: rgba(0,255,120,0.22);
  --afk-lr-text: rgba(250,252,255,0.92);
  --afk-lr-dim: rgba(250,252,255,0.74);
  --afk-lr-accent: rgba(0,255,120,0.85);
}
.afk-lr-theme-blue{
  --afk-lr-line: rgba(120,170,255,0.26);
  --afk-lr-accent: rgba(120,170,255,0.85);
}

.afk-lr-open-btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 14px; border-radius:14px;
  background: linear-gradient(180deg, rgba(14,18,20,0.95), rgba(6,8,10,0.98));
  border:1px solid var(--afk-lr-line);
  color:var(--afk-lr-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  letter-spacing:.14em; text-transform:uppercase; font-weight:900;
  cursor:pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.28), 0 0 18px rgba(0,255,120,0.10);
}
.afk-lr-open-btn:hover{ border-color: rgba(0,255,120,0.65); }

.afk-lr-modal{ position:fixed; inset:0; z-index:999999; display:none; }
.afk-lr-modal[aria-hidden="false"]{ display:block; }
.afk-lr-modal-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,0.62); }

.afk-lr-crt{
  display:flex;
  flex-direction:column;
  height:min(88vh, 720px);

  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:min(860px,92vw); height:auto; max-height:92vh;
  display:block;
  border-radius:18px;
  background:
    radial-gradient(130% 130% at 18% 15%, rgba(0,255,120,0.06), rgba(0,0,0,0.20)),
    linear-gradient(180deg, var(--afk-lr-bg-a), var(--afk-lr-bg-b));
  border:1px solid var(--afk-lr-line);
  box-shadow: 0 18px 60px rgba(0,0,0,0.48);
  overflow:hidden;
}

.afk-lr-close,.afk-lr-mute{ position:absolute; top:10px; z-index:3; }
.afk-lr-close{ right:10px; }
.afk-lr-mute{ right:58px; }

.afk-lr-crt::before{
  content:""; position:absolute; inset:0;
  background: radial-gradient(120% 120% at 50% 50%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.48) 100%);
  pointer-events:none;
}
.afk-lr-crt::after{
  content:""; position:absolute; inset:0;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.045), rgba(255,255,255,0.045) 1px, rgba(0,0,0,0) 5px, rgba(0,0,0,0) 6px);
  opacity:.14; pointer-events:none; mix-blend-mode:overlay;
}

.afk-lr-close,.afk-lr-mute{
  background:rgba(0,0,0,0.25);
  border:1px solid var(--afk-lr-line);
  color:var(--afk-lr-text);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
  font-family: ui-monospace, monospace;
  letter-spacing:.12em; text-transform:uppercase; font-weight:900;
}

.afk-lr-mute{
  font-size:10px;
  padding:6px 8px;
  letter-spacing:.10em;
  opacity:0.92;
}

.afk-lr-stage{ position:relative; padding:10px; flex:1; min-height:240px; }
.afk-lr-canvas{
  width:100%; height:100%;
  border-radius:16px;
  border:1px solid rgba(0,255,120,0.12);
  background:rgba(0,0,0,0.25);
}

.afk-lr-overlay{
  position:absolute; inset:10px 14px 14px 14px;
  display:flex; align-items:center; justify-content:center;
  pointer-events:none;
}
.afk-lr-overlay[data-hidden="1"]{ display:none; }
.afk-lr-overlay-inner{
  pointer-events:auto;
  padding:16px; border-radius:18px;
  background:rgba(0,0,0,0.38);
  border:1px solid rgba(0,255,120,0.18);
  text-align:center;
}
.afk-lr-overlay-title{
  font-family: ui-monospace, monospace;
  letter-spacing:.18em; text-transform:uppercase;
  font-weight:900; color:var(--afk-lr-text);
}
.afk-lr-overlay-sub{
  margin-top:8px;
  color:var(--afk-lr-dim);
  font-family: ui-monospace, monospace;
}
.afk-lr-start{
  margin-top:12px;
  padding:10px 14px;
  border-radius:14px;
  background: linear-gradient(180deg, rgba(14,18,20,0.95), rgba(6,8,10,0.98));
  border:1px solid rgba(0,255,120,0.35);
  color:var(--afk-lr-text);
  font-family: ui-monospace, monospace;
  letter-spacing:.14em; text-transform:uppercase; font-weight:900;
  cursor:pointer;
}

.afk-lr-help{
  padding:0 14px 14px 14px;
  display:flex; flex-wrap:wrap; gap:10px;
  color:var(--afk-lr-dim);
  font-family: ui-monospace, monospace;
}
.afk-lr-help .tag{
  padding:4px 8px;
  border-radius:12px;
  border:1px solid rgba(0,255,120,0.18);
  background:rgba(0,0,0,0.22);
  color:var(--afk-lr-text);
  font-weight:900;
  text-transform:uppercase;
}

.afk-lr-floating{
  position:fixed;
  z-index:999998;
  border-radius:0;
  background:transparent;
  border:none;
  box-shadow:none;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  user-select:none;
  touch-action: manipulation;
}
.afk-lr-ship{ width:100%; height:100%; display:block; }

.afk-lr-mobile-controls{
  position:static;
  left:10px; right:10px; bottom:10px;
  display:none;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:nowrap;
  z-index:4;
  pointer-events:auto;
}
.afk-lr-ctrl{
  border-radius:14px;
  padding:10px 12px;
  background:rgba(0,0,0,0.25);
  border:1px solid rgba(0,255,120,0.20);
  color:var(--afk-lr-text);
  font-family: ui-monospace, monospace;
  letter-spacing:.10em; text-transform:uppercase; font-weight:900;
}

@media (max-width: 760px){
  .afk-lr-crt{
  display:flex;
  flex-direction:column;
  height:min(88vh, 720px);

    width:100vw;
    height:auto;
    max-height:92vh;
    border-radius:0;
  }
  .afk-lr-stage{ padding:6px; }
  .afk-lr-canvas{ border-radius:12px; }
  .afk-lr-mobile-controls{ display:flex; }
  .afk-lr-ctrl{ flex:1; padding:12px 10px; }
}

@media (max-width: 420px){
  .afk-lr-ctrl{ font-size:12px; letter-spacing:.08em; }
}

.afk-lr-help{ display:none !important; }

/* mobile controls under screen */
@media (max-width: 760px){
  .afk-lr-stage{ display:flex; flex-direction:column; }
  .afk-lr-canvas{ flex:1; }
  .afk-lr-mobile-controls{
    margin-top:8px;
    padding:8px 6px;
    background:rgba(0,0,0,0.25);
    border:1px solid rgba(0,255,120,0.20);
    border-radius:14px;
  }
}

@media (max-width: 760px){
  .afk-lr-mobile-controls button{
    max-width:90px !important;
    height:56px !important;
    font-size:16px !important;
  }
  .afk-lr-mobile-controls button:active{
    transform: translateY(1px);
  }
}
