/* ========================================
 * AFK Together - Design Update (v2)
 * Loaded after ui.css on every page.
 * ======================================== */

:root {
  --v2-accent: rgb(167, 139, 250);
  --v2-accent-2: rgb(124, 92, 246);
  --v2-panel: rgba(17, 17, 28, 0.72);
  --v2-border: rgba(255, 255, 255, 0.08);
  --v2-input: rgba(6, 6, 12, 0.6);
  --v2-t1: #d08a4a;
  --v2-t2: #c7cbd6;
  --v2-t3: #facc15;
}

/* ---------- smoother everything ---------- */
.dashboard-panel,
.stat-card,
.plan-card,
.primary-action,
a,
button {
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease, background-color .18s ease, filter .18s ease;
}

.dashboard-panel:hover,
.stat-card:hover {
  border-color: rgba(167, 139, 250, 0.22);
}

.stat-card.accent {
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(167, 139, 250, 0.18), transparent 60%),
    var(--v2-panel);
}

.primary-action:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -10px rgba(167, 139, 250, 0.7);
}

.primary-action:active {
  transform: translateY(0);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--v2-accent);
  outline-offset: 2px;
}

/* ---------- left column: stacked panels ---------- */
.dashboard-main-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ---------- tier badge in the Package card ---------- */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tier-badge::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.tier-badge.t1 { color: var(--v2-t1); }
.tier-badge.t2 { color: var(--v2-t2); }
.tier-badge.t3 { color: var(--v2-t3); }
.tier-badge.t0 { color: rgba(246, 244, 255, 0.55); }

/* ---------- plans card ---------- */
.plans-panel .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.plans-discord {
  font-size: 13px;
  font-weight: 700;
  color: var(--v2-accent);
  text-decoration: none;
  padding: 8px 12px;
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 10px;
  white-space: nowrap;
}

.plans-discord:hover {
  background: rgba(167, 139, 250, 0.12);
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.plan-card {
  position: relative;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--v2-border);
  background: rgba(6, 6, 12, 0.45);
  overflow: hidden;
}

.plan-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tier);
  opacity: .9;
}

.plan-card.t1 { --tier: var(--v2-t1); }
.plan-card.t2 { --tier: var(--v2-t2); }
.plan-card.t3 { --tier: var(--v2-t3); }

.plan-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tier) 45%, transparent);
}

.plan-card.current {
  border-color: color-mix(in srgb, var(--tier) 70%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tier) 35%, transparent), 0 12px 30px -18px var(--tier);
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--tier) 16%, transparent), transparent 70%),
    rgba(6, 6, 12, 0.45);
}

.plan-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.plan-badge {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--tier);
}

.plan-current {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--tier);
  color: #111;
}

.plan-bots {
  margin-top: 14px;
  font-size: 13px;
  opacity: .8;
}

.plan-bots b {
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  font-weight: 700;
  opacity: 1;
  margin-right: 4px;
  color: #fff;
}

.plan-sub {
  font-size: 11px;
  opacity: .5;
  margin-top: 2px;
}

.plans-features {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  font-size: 13px;
  opacity: .85;
}

.plans-features li::before {
  content: "";
  color: var(--v2-accent);
  font-weight: 800;
  margin-right: 8px;
}

.plans-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.18);
}

/* ---------- referral card ---------- */
.referral-link-row {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.referral-link-row input {
  flex: 1;
  min-width: 0;
  height: 45px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: var(--v2-input);
  color: rgb(246, 244, 255);
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.referral-link-row .primary-action {
  height: 45px;
  padding: 0 18px;
}

.referral-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.referral-stats > div {
  border: 1px solid var(--v2-border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  background: rgba(6, 6, 12, 0.45);
}

.referral-stat-value {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.referral-stat-label {
  display: block;
  font-size: 11px;
  opacity: .6;
  margin-top: 2px;
}

.referral-recent {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  font-size: 13px;
  opacity: .8;
}

.referral-recent li {
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---------- scrollbar ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 139, 250, 0.35) transparent;
}

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .plans-grid { grid-template-columns: 1fr; }
  .plans-features { grid-template-columns: 1fr; }
}

/* ---------- live view ---------- */
.live-panel {
  margin-bottom: 20px;
}

.live-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.live-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
}

.live-badge {
  font: 800 10px Inter, sans-serif;
  letter-spacing: 1px;
  color: #fff;
  background: #ef4444;
  padding: 4px 8px;
  border-radius: 999px;
  animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.live-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.live-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: rgba(6, 6, 12, 0.6);
  border: 1px solid var(--v2-border);
}

.live-toggle button {
  border: 0;
  background: transparent;
  color: rgba(246, 244, 255, .7);
  font: 600 12px Inter, sans-serif;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
}

.live-toggle button.is-active {
  background: rgba(167, 139, 250, .18);
  color: #fff;
}

.live-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: .85;
  cursor: pointer;
}

.live-icon,
.live-stop {
  height: 38px;
  min-width: 38px;
  border-radius: 10px;
  border: 1px solid var(--v2-border);
  background: rgba(6, 6, 12, 0.6);
  color: #fff;
  cursor: pointer;
  font: 600 13px Inter, sans-serif;
  padding: 0 12px;
}

.live-stop:hover { border-color: rgba(239, 68, 68, .6); color: #fca5a5; }
.live-actions .primary-action { height: 38px; padding: 0 16px; }

.live-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(80% 80% at 50% 0%, rgba(167, 139, 250, .12), transparent 70%),
    #05050a;
  border: 1px solid var(--v2-border);
}

.live-panel.is-live .live-stage {
  border-color: rgba(167, 139, 250, .35);
  box-shadow: 0 20px 60px -30px rgba(167, 139, 250, .6);
}

.live-panel.low-health .live-stage {
  box-shadow: inset 0 0 80px rgba(239, 68, 68, .45);
}

.live-stage:fullscreen {
  border-radius: 0;
  aspect-ratio: auto;
}

.live-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.live-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 20px;
}

.live-placeholder-icon {
  font-size: 34px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(167, 139, 250, .14);
  border: 1px solid rgba(167, 139, 250, .3);
  margin-bottom: 8px;
}

.live-placeholder strong { font: 700 17px "Space Grotesk", sans-serif; }
.live-placeholder span { font-size: 13px; opacity: .6; max-width: 360px; }

.live-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
}

.live-hud[hidden], .live-placeholder[hidden], .live-message[hidden], .live-stage iframe[hidden] { display: none; }

.live-hud-top,
.live-hud-bottom {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.hud-chip {
  font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #fff;
  background: rgba(7, 7, 12, .62);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .1);
  padding: 6px 10px;
  border-radius: 10px;
}

.hud-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(7, 7, 12, .62);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .1);
  padding: 6px 10px;
  border-radius: 10px;
  font: 600 12px Inter, sans-serif;
  color: #fff;
}

.hud-bar div {
  width: 90px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.hud-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width .4s ease;
}

.hud-health i { background: linear-gradient(90deg, #ef4444, #f87171); }
.hud-food i { background: linear-gradient(90deg, #d97706, #fbbf24); }

.live-message {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: rgba(7, 7, 12, .85);
  border: 1px solid rgba(167, 139, 250, .3);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  max-width: 90%;
  text-align: center;
}

@media (max-width: 760px) {
  .live-actions { width: 100%; }
  .hud-bar div { width: 60px; }
}

/* ---------- live view: control ---------- */
.live-control-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, .35);
  background: rgba(167, 139, 250, .1);
  color: #fff;
  font: 700 13px Inter, sans-serif;
  cursor: pointer;
}

.live-control-btn:disabled { opacity: .4; cursor: not-allowed; }
.live-control-btn.is-active {
  background: var(--v2-accent);
  color: rgb(17, 11, 32);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, .25);
}

.live-stage iframe { z-index: 1; }
.live-control-layer { position: absolute; inset: 0; z-index: 2; cursor: crosshair; touch-action: none; }
.live-control-layer[hidden] { display: none; }
.mouse-locked .live-control-layer { cursor: none; }
.live-hud { z-index: 3; }
.live-hotbar { z-index: 4; }
.live-hint { z-index: 4; }
.live-pad { z-index: 5; }
.live-inventory { z-index: 6; }
.live-message { z-index: 7; }

.live-panel.is-controlling .live-stage {
  border-color: var(--v2-accent);
  box-shadow: 0 0 0 1px var(--v2-accent), 0 20px 60px -30px rgba(167, 139, 250, .8);
}

.live-crosshair {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
}

.live-crosshair::before,
.live-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, .85);
  box-shadow: 0 0 2px rgba(0, 0, 0, .8);
}

.live-crosshair::before { left: 8px; top: 0; width: 2px; height: 18px; }
.live-crosshair::after { top: 8px; left: 0; height: 2px; width: 18px; }
.is-controlling .live-crosshair { display: block; }

/* hotbar like in Minecraft */
.live-hotbar {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(7, 7, 12, .7);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .1);
}

.live-hotbar[hidden] { display: none; }
.is-controlling .live-hud-bottom { margin-bottom: 64px; }

.inv-slot {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  color: #fff;
}

.inv-slot.empty { cursor: default; }
.inv-slot:not(.empty):hover { border-color: rgba(167, 139, 250, .6); background: rgba(167, 139, 250, .1); }
.inv-slot.selected { border: 2px solid #fff; box-shadow: 0 0 12px rgba(255, 255, 255, .35); }

.inv-slot img {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
  pointer-events: none;
}

.inv-slot b {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font: 800 11px Inter, sans-serif;
  text-shadow: 1px 1px 0 #000;
}

.inv-slot i {
  position: absolute;
  left: 4px;
  top: 2px;
  font: 700 9px Inter, sans-serif;
  font-style: normal;
  opacity: .5;
}

.inv-fallback { font: 800 11px Inter, sans-serif; opacity: .8; }

/* key hints */
.live-hint {
  position: absolute;
  top: 52px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  font-size: 11px;
  color: rgba(255, 255, 255, .8);
  pointer-events: none;
  transition: opacity .3s;
}

.live-hint[hidden] { display: none; }
.mouse-locked .live-hint { opacity: .35; }

.live-hint span {
  background: rgba(7, 7, 12, .6);
  padding: 4px 8px;
  border-radius: 8px;
}

.live-hint kbd {
  font: 700 10px ui-monospace, monospace;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 2px;
}

/* inventory window */
.live-inventory {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
}

.live-inventory[hidden] { display: none; }

.inv-window {
  background: rgba(17, 17, 28, .96);
  border: 1px solid rgba(167, 139, 250, .3);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
  max-width: calc(100% - 24px);
}

.inv-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.inv-head strong { font: 700 16px "Space Grotesk", sans-serif; }
.inv-head span { font-size: 12px; opacity: .55; flex: 1; }
.inv-head button {
  border: 0;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(9, 44px);
  gap: 4px;
}

.inv-hotbar-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

/* mobile pad */
.live-pad {
  position: absolute;
  inset: auto 10px 70px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

.live-pad[hidden] { display: none; }

.pad-move {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(2, 46px);
  gap: 6px;
  pointer-events: auto;
}

.pad-move .up { grid-column: 2; grid-row: 1; }
.pad-move .left { grid-column: 1; grid-row: 2; }
.pad-move .down-btn { grid-column: 2; grid-row: 2; }
.pad-move .right { grid-column: 3; grid-row: 2; }

.pad-actions {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  gap: 6px;
  pointer-events: auto;
}

.pad-btn {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(7, 7, 12, .55);
  backdrop-filter: blur(6px);
  color: #fff;
  font: 700 17px Inter, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.pad-btn.down {
  background: rgba(167, 139, 250, .55);
  border-color: var(--v2-accent);
  transform: scale(.95);
}

@media (max-width: 760px) {
  .inv-grid { grid-template-columns: repeat(9, 32px); gap: 3px; }
  .inv-slot { width: 32px; height: 32px; }
  .inv-slot img { width: 22px; height: 22px; }
  .live-hotbar .inv-slot { width: 30px; height: 30px; }
  .live-stage { aspect-ratio: 4 / 3; }
}

/* ---------- live view v3: chat, joysticks, fullscreen ---------- */
.live-chat { z-index: 5; }
.live-touch { z-index: 5; }
.live-fs-exit { z-index: 8; }

.live-hud-bars {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0;
  transition: margin .2s;
}

.is-controlling .live-hud-bars { margin-bottom: 64px; }

/* chat like in Minecraft */
.live-chat {
  position: absolute;
  left: 12px;
  bottom: 56px;
  width: min(420px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.live-chat[hidden] { display: none; }
.is-controlling .live-chat { bottom: 120px; }

.chat-lines {
  max-height: 150px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-line {
  align-self: flex-start;
  max-width: 100%;
  font: 500 12.5px/1.35 Inter, sans-serif;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .7);
  background: rgba(0, 0, 0, .42);
  padding: 3px 8px;
  border-radius: 6px;
  word-break: break-word;
  transition: opacity .6s;
}

.chat-line.old { opacity: 0; }

.live-chat.open { pointer-events: auto; }
.live-chat.open .chat-lines { max-height: 220px; overflow-y: auto; }
.live-chat.open .chat-line.old { opacity: .85; }

.chat-form {
  display: flex;
  gap: 6px;
}

.chat-form[hidden] { display: none; }

.chat-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, .5);
  background: rgba(7, 7, 12, .85);
  color: #fff;
  font: 14px Inter, sans-serif;
}

.chat-form .primary-action { height: 40px; padding: 0 14px; }

.chat-close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--v2-border);
  background: rgba(7, 7, 12, .85);
  color: #fff;
}

/* touch controls */
.live-touch {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.live-touch[hidden] { display: none; }

.joy {
  position: absolute;
  bottom: 18px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03) 70%);
  border: 2px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(4px);
  pointer-events: auto;
  touch-action: none;
  display: grid;
  place-items: center;
}

.joy-move { left: 18px; }
.joy-look { right: 18px; }

.joy-knob {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  border: 2px solid rgba(255, 255, 255, .45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
  pointer-events: none;
}

.joy.active { border-color: rgba(167, 139, 250, .7); }
.joy.active .joy-knob { background: rgba(167, 139, 250, .55); border-color: #fff; }

.touch-buttons {
  position: absolute;
  right: 150px;
  bottom: 20px;
  display: grid;
  grid-template-columns: repeat(3, 46px);
  gap: 8px;
  pointer-events: auto;
}

.tbtn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(7, 7, 12, .5);
  backdrop-filter: blur(6px);
  color: #fff;
  font: 700 18px Inter, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.tbtn.down {
  background: rgba(167, 139, 250, .6);
  border-color: #fff;
  transform: scale(.94);
}

.tbtn-attack { background: rgba(239, 68, 68, .35); }
.tbtn-jump { background: rgba(34, 197, 94, .3); }

.is-controlling.has-touch .live-hotbar { bottom: 150px; }
.is-controlling.has-touch .live-hud-bars { margin-bottom: 200px; }

/* fullscreen (real and iPhone fallback) */
.live-fs-exit {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(7, 7, 12, .7);
  color: #fff;
  font: 700 16px Inter, sans-serif;
}

.live-fs-exit[hidden] { display: none; }

.live-stage:fullscreen .live-hint { top: 60px; }

.live-panel.pseudo-fs .live-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  aspect-ratio: auto;
  border-radius: 0;
  border: 0;
  z-index: 9999;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

html.live-noscroll,
html.live-noscroll body {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.pseudo-fs .live-hud { padding-top: max(12px, env(safe-area-inset-top)); padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(56px, env(safe-area-inset-right)); }
.pseudo-fs .joy-move { left: max(18px, env(safe-area-inset-left)); }
.pseudo-fs .joy-look { right: max(18px, env(safe-area-inset-right)); }

@media (max-width: 760px) {
  .hud-hide-sm { display: none; }
  .hud-bar div { width: 50px; }
  .live-chat { bottom: 50px; }
  .is-controlling .live-chat { top: 52px; bottom: auto; width: min(300px, calc(100% - 24px)); }
  .chat-lines { max-height: 90px; }
  .touch-buttons { right: 146px; grid-template-columns: repeat(3, 40px); gap: 6px; }
  .tbtn { width: 40px; height: 40px; font-size: 16px; }
  .joy { width: 104px; height: 104px; }
  .joy-knob { width: 46px; height: 46px; }
}

@media (orientation: portrait) and (max-width: 760px) {
  .pseudo-fs .touch-buttons { right: 18px; bottom: 140px; }
}

/* ---------- v4: icon system + calmer controls ---------- */
.ico {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.live-head h2 { font-size: 20px; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 700 10px Inter, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fca5a5;
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .35);
  padding: 4px 9px 4px 8px;
  border-radius: 999px;
  animation: none;
}

.live-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: liveDot 1.4s ease-in-out infinite;
}

@keyframes liveDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); }
  50% { opacity: .55; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

.live-actions { gap: 8px; }

.live-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--v2-border);
  background: rgba(255, 255, 255, .03);
  color: rgba(246, 244, 255, .9);
  font: 600 13px Inter, sans-serif;
  cursor: pointer;
}

.live-btn:hover:not(:disabled) { border-color: rgba(167, 139, 250, .45); color: #fff; }
.live-btn:disabled { opacity: .4; cursor: not-allowed; }
.live-btn-icon { width: 38px; padding: 0; justify-content: center; }
.live-btn[data-control].is-active {
  background: rgba(167, 139, 250, .16);
  border-color: rgba(167, 139, 250, .7);
  color: #fff;
}

.live-stop:hover { border-color: rgba(239, 68, 68, .6) !important; color: #fca5a5 !important; }

.live-start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px !important;
  padding: 0 16px !important;
}

.live-start .ico { width: 14px; height: 14px; }
.live-start .ico use[href="#lv-play"] { fill: currentColor; }
.is-connecting .live-start .ico { animation: liveSpin .8s linear infinite; }
@keyframes liveSpin { to { transform: rotate(360deg); } }

.live-toggle button { font-size: 12px; padding: 8px 12px; }

/* switch instead of checkbox */
.live-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 12px Inter, sans-serif;
  color: rgba(246, 244, 255, .75);
  cursor: pointer;
  user-select: none;
}

.live-switch input { position: absolute; opacity: 0; pointer-events: none; }

.live-switch span {
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  transition: background .2s;
}

.live-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}

.live-switch input:checked + span { background: var(--v2-accent); }
.live-switch input:checked + span::after { transform: translateX(12px); }
.live-switch input:focus-visible + span { outline: 2px solid var(--v2-accent); outline-offset: 2px; }

/* placeholder */
.live-placeholder-icon {
  font-size: 0;
  color: var(--v2-accent);
}

.live-placeholder-icon .ico { width: 28px; height: 28px; stroke-width: 1.75; }
.live-placeholder strong { font-size: 18px; }
.live-placeholder span { max-width: 420px; line-height: 1.5; }

/* HUD */
.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 12px Inter, sans-serif;
  font-variant-numeric: tabular-nums;
  background: rgba(10, 10, 16, .55);
  border-color: rgba(255, 255, 255, .08);
}

.hud-chip .ico { width: 13px; height: 13px; opacity: .7; }

.hud-bar { gap: 8px; background: rgba(10, 10, 16, .55); border-color: rgba(255, 255, 255, .08); }
.hud-bar .ico { width: 14px; height: 14px; }
.hud-health .ico { color: #f87171; fill: rgba(248, 113, 113, .35); }
.hud-food .ico { color: #fbbf24; }
.hud-bar b { font-variant-numeric: tabular-nums; font-weight: 600; opacity: .85; }

/* fullscreen exit */
.live-fs-exit { display: grid; place-items: center; }
.live-fs-exit .ico { width: 18px; height: 18px; }

/* chat */
.chat-line {
  font: 500 12.5px/1.4 Inter, sans-serif;
  background: rgba(10, 10, 16, .5);
  text-shadow: none;
  border-radius: 7px;
}

.chat-form input {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(10, 10, 16, .88);
}

.chat-form input:focus { border-color: var(--v2-accent); outline: none; }

.chat-send,
.chat-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  cursor: pointer;
}

.chat-send { border: 0; background: var(--v2-accent); color: rgb(17, 11, 32); }
.chat-close { border: 1px solid rgba(255, 255, 255, .12); background: rgba(10, 10, 16, .88); color: #fff; }

/* hints */
.live-hint span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 10, 16, .55);
  font: 500 11px Inter, sans-serif;
}

.live-hint kbd { margin: 0 2px 0 6px; }
.live-hint kbd:first-child { margin-left: 0; }

/* touch */
.tbtn {
  display: grid;
  place-items: center;
  background: rgba(10, 10, 16, .5);
  border-color: rgba(255, 255, 255, .16);
}

.tbtn .ico { width: 20px; height: 20px; }
.tbtn-attack { background: rgba(10, 10, 16, .5); border-color: rgba(248, 113, 113, .55); color: #fca5a5; }
.tbtn-jump { background: rgba(10, 10, 16, .5); border-color: rgba(167, 139, 250, .6); color: #ddd6fe; }
.tbtn.down { background: rgba(167, 139, 250, .45); color: #fff; }

.joy { background: rgba(10, 10, 16, .3); border-color: rgba(255, 255, 255, .14); }
.joy-knob { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .35); }

/* inventory */
.inv-head button { display: grid; place-items: center; }
.inv-head .ico { width: 16px; height: 16px; }

/* plans + misc: no glyph icons */
.plans-features li::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 5px;
  margin: 0 10px 3px 2px;
  border-left: 2px solid var(--v2-accent);
  border-bottom: 2px solid var(--v2-accent);
  transform: rotate(-45deg);
}

.plans-note { display: flex; align-items: center; gap: 10px; }
.plans-note .ico { color: var(--v2-accent); width: 18px; height: 18px; }

.is-fullscreen .live-hint { top: 64px; }

/* ---------- discord alerts panel ---------- */
.webhook-panel { margin-bottom: 20px; }
.webhook-panel .panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

.webhook-state {
  font: 700 10px Inter, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--v2-border);
  color: rgba(246, 244, 255, .55);
}

.webhook-state.on { color: #86efac; border-color: rgba(34, 197, 94, .4); background: rgba(34, 197, 94, .1); }
.webhook-state.broken { color: #fca5a5; border-color: rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .1); }

.webhook-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 16px;
}

.webhook-form input {
  flex: 1 1 280px;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: var(--v2-input);
  color: rgb(246, 244, 255);
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.webhook-form input:focus { outline: none; border-color: var(--v2-accent); }
.webhook-form .primary-action { height: 42px; padding: 0 18px; }
.webhook-form .live-btn { height: 42px; }
.webhook-remove:hover { border-color: rgba(239, 68, 68, .6) !important; color: #fca5a5 !important; }

.webhook-events {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  opacity: .55;
  transition: opacity .2s;
}

.webhook-panel.is-set .webhook-events { opacity: 1; }

.webhook-msg { margin: 14px 0 0; font-size: 13px; }
.webhook-msg.ok { color: #86efac; }
.webhook-msg.err { color: #fca5a5; }

.webhook-keywords { margin: 16px 0 10px; }

/* ---------- recent activity panel ---------- */
.activity-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
}

.activity-item {
  display: grid;
  grid-template-columns: 10px 110px 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, .05);
  font-size: 13px;
}

.activity-item:first-child { border-top: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; align-self: center; }
.activity-online .activity-dot { background: #22c55e; }
.activity-kicked .activity-dot { background: #f59e0b; }
.activity-death .activity-dot { background: #ef4444; }
.activity-lowHealth .activity-dot { background: #f97316; }
.activity-chat .activity-dot { background: #38bdf8; }
.activity-text { color: rgba(246, 244, 255, .6); overflow-wrap: anywhere; }
.activity-item time { color: rgba(246, 244, 255, .4); font-size: 12px; white-space: nowrap; }

@media (max-width: 640px) {
  .activity-item { grid-template-columns: 10px 1fr auto; }
  .activity-text { grid-column: 2 / -1; }
}



/* ---------- shop ---------- */
.plans-buy { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.plans-buy .primary-action { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; padding: 12px 22px; }
.plans-buy span { font-size: 13px; opacity: .7; }
.community-card.shop-card { margin-top: 10px; }

/* ---------- bot page tabs ---------- */
.bot-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 20px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(var(--well-rgb), 0.55);
  overflow-x: auto;
  scrollbar-width: none;
}

.bot-tabs::-webkit-scrollbar { display: none; }

.bot-tab {
  flex: 1 0 auto;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition-property: background-color, color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.bot-tab:hover { color: var(--text); }

.bot-tab[aria-selected="true"] {
  background: rgba(var(--accent-rgb), 0.16);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35);
  color: var(--text);
}

.bot-tab:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.6);
  outline-offset: 2px;
}

.bot-tab-panel > .dashboard-panel + .dashboard-panel,
.bot-tab-panel > .dashboard-panel + script + .dashboard-panel { margin-top: 20px; }
.bot-tab-panel .activity-panel { margin-bottom: 0; }

/* Start / Stop gleich hoch (Primary 45px vs. Delete 43px) */
.bot-tab-panel form[action$="/start"] button,
.bot-tab-panel form[action$="/stop"] button {
  height: 44px;
  box-sizing: border-box;
}
