/* Boozery Festival — στυλ (κινητό, κάθετο) */
:root {
  --bg-0: #12051f;
  --bg-1: #2a0b3d;
  --ink: #fff6ea;
  --muted: #c9b7d9;
  --gold: #ffc23d;
  --gold-2: #ff8a1f;
  --pink: #ff3fa4;
  --cyan: #3ff0ff;
  --green: #5dff6b;
  --red: #ff4d5e;
  --panel: rgba(28, 10, 44, 0.78);
  --line: rgba(255, 255, 255, 0.14);
  --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);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  background:
    radial-gradient(120% 60% at 50% 105%, rgba(255, 120, 40, 0.35), transparent 60%),
    radial-gradient(90% 50% at 50% -10%, rgba(255, 63, 164, 0.25), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.hidden { display: none !important; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: calc(12px + var(--safe-top)) calc(16px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(16px + var(--safe-left));
}

/* κεντράρισμα όταν χωράει, κανονικό scroll όταν δεν χωράει */
.screen > :first-child { margin-top: auto; }
.screen > :last-child { margin-bottom: auto; }

.logo {
  width: min(100%, 520px);
  height: auto;
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(255, 63, 164, 0.25), 0 0 0 1px rgba(255, 194, 61, 0.25);
  margin: 4px 0 18px;
  user-select: none;
  -webkit-user-drag: none;
}
.logo-small { width: min(70%, 320px); margin-bottom: 14px; }

.panel {
  width: min(100%, 420px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.field { display: block; margin-bottom: 14px; }
.field span {
  display: block;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px 2px;
}
.field input {
  width: 100%;
  font-size: 18px; /* ≥16px: το iPhone δεν κάνει zoom */
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  outline: none;
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 194, 61, 0.25); }

.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 800;
  font-size: 18px;
  padding: 14px 18px;
  width: 100%;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-gold {
  color: #2a1200;
  background: linear-gradient(180deg, #ffe08a, var(--gold) 45%, var(--gold-2));
  box-shadow: 0 6px 20px rgba(255, 138, 31, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  margin-top: 12px;
}

.error {
  min-height: 1.3em;
  margin: 12px 2px 0;
  color: #ff9aa5;
  font-size: 15px;
  line-height: 1.35;
}

.muted { color: var(--muted); }

h1 { font-size: 24px; margin: 0 0 6px; }

.online-list { list-style: none; padding: 0; margin: 14px 0 4px; display: grid; gap: 6px; }
.online-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #6b5a78; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }

.toast {
  position: absolute;
  left: 50%;
  top: calc(14px + var(--safe-top));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(10, 4, 18, 0.88);
  border: 1px solid var(--line);
  font-size: 15px;
  z-index: 50;
  pointer-events: none;
  text-align: center;
}

.netbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: calc(6px + var(--safe-top)) 12px 6px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 77, 94, 0.92);
  z-index: 60;
}

/* ---------- Κάρτα FIFA (Στάδιο 2) ---------- */
.fut-card {
  --c-a: #fdfdfd;
  --c-b: #c9d1d9;
  --c-c: #eef2f5;
  --c-d: #a3aeb9;
  --c-ink: #22262d;
  --c-line: rgba(34, 38, 45, 0.35);
  --c-glow: rgba(210, 225, 240, 0.55);
  position: relative;
  width: min(84vw, 340px);
  aspect-ratio: 340 / 520;
  flex: none;
  padding: 6px;
  color: var(--c-ink);
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.55));
  user-select: none;
  -webkit-user-select: none;
}
.fut-card.tier-gold {
  --c-a: #fff6c8;
  --c-b: #eec05a;
  --c-c: #fff0a8;
  --c-d: #c98f2b;
  --c-ink: #3a2803;
  --c-line: rgba(58, 40, 3, 0.35);
  --c-glow: rgba(255, 214, 102, 0.6);
}
.fut-card.tier-icon {
  --c-a: #ffffff;
  --c-b: #efe3c2;
  --c-c: #fffaf0;
  --c-d: #d8bf82;
  --c-ink: #3d300c;
  --c-line: rgba(160, 120, 30, 0.5);
  --c-glow: rgba(255, 240, 200, 0.8);
}
.fut-card::before,
.fut-inner {
  clip-path: polygon(14% 0, 86% 0, 100% 7%, 100% 90%, 50% 100%, 0 90%, 0 7%);
}
.fut-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, var(--c-d), var(--c-a) 30%, var(--c-d) 60%, var(--c-a));
}
.fut-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(70% 45% at 55% 32%, var(--c-glow), transparent 70%),
    linear-gradient(155deg, var(--c-a) 0%, var(--c-b) 28%, var(--c-c) 50%, var(--c-d) 76%, var(--c-a) 100%);
}
.tier-icon .fut-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.65) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: shine 3.2s linear infinite;
  pointer-events: none;
}
@keyframes shine {
  from { background-position: 150% 0; }
  to { background-position: -100% 0; }
}

.fut-top {
  position: absolute;
  left: 9%;
  top: 7%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  line-height: 1;
}
.fut-ovr { font-size: clamp(34px, 12vw, 48px); font-weight: 900; letter-spacing: -0.03em; }
.fut-role { font-size: clamp(22px, 8vw, 30px); margin-top: 6px; }
.fut-tier {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}
.fut-photo {
  display: block;
  width: 74%;
  margin: 7% 0 0 12%;
  aspect-ratio: 440 / 480;
  object-fit: cover;
  object-position: top;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  pointer-events: none;
}
.fut-name {
  width: 80%;
  margin-top: -2%;
  padding-bottom: 4px;
  text-align: center;
  font-size: clamp(20px, 7vw, 27px);
  font-weight: 900;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--c-line);
  z-index: 1;
}
.fut-ability {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
}
.fut-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 84%;
  margin-top: 8px;
  gap: 2px;
}
.fut-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}
.fut-stat b { font-size: clamp(19px, 6.4vw, 24px); font-weight: 900; }
.fut-stat span { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; opacity: 0.8; }
.fut-plus {
  margin-top: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  background: linear-gradient(180deg, #3ad15a, #138a2d);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
}
.fut-plus:disabled { background: #9aa3ad; opacity: 0.6; }
.fut-points {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #0d6e22;
}
.fut-meta {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 10px;
  width: 78%;
  margin-top: auto;
  margin-bottom: 13%;
  padding-top: 8px;
  border-top: 1px solid var(--c-line);
  line-height: 1.1;
}
.fut-meta small { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.05em; opacity: 0.75; }
.fut-meta b { font-size: 18px; font-weight: 900; }
.fut-money { text-align: right; }
.fut-xpbar {
  height: 6px;
  margin-top: 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.fut-xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #6a3df0, #ff3fa4); }

.fut-online {
  position: absolute;
  right: 12%;
  top: 8%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7d7387;
  border: 2px solid rgba(255, 255, 255, 0.9);
  z-index: 3;
}
.fut-online.on { background: var(--green); box-shadow: 0 0 8px var(--green); }

/* μικρή κάρτα για τη λίστα */
.fut-card.mini { width: 100%; padding: 3px; }
.fut-card.mini .fut-ovr { font-size: 22px; }
.fut-card.mini .fut-role { font-size: 15px; margin-top: 3px; }
.fut-card.mini .fut-tier,
.fut-card.mini .fut-ability,
.fut-card.mini .fut-meta { display: none; }
.fut-card.mini .fut-name { font-size: 12px; padding-bottom: 2px; }
.fut-card.mini .fut-stats { width: 92%; margin-top: 4px; margin-bottom: 16%; }
.fut-card.mini .fut-stat b { font-size: 12px; }
.fut-card.mini .fut-stat span { font-size: 7px; }
.fut-card.mini .fut-online { width: 10px; height: 10px; }

/* ---------- Οθόνη κάρτας ---------- */
.screen-top > :first-child { margin-top: 0; }
.topbar {
  width: min(100%, 460px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.topbar-logo {
  height: 46px;
  width: auto;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 194, 61, 0.3);
}
.btn-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  touch-action: manipulation;
  cursor: pointer;
}
.card-slot {
  margin-top: auto;
  display: flex;
  justify-content: center;
  padding: 6px 0 4px;
}
.card-actions {
  width: min(100%, 360px);
  margin-top: 14px;
  margin-bottom: auto;
}
.btn-enter { font-size: 20px; padding: 16px 18px; }
.btn-link {
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  margin-top: 6px;
  padding: 10px;
}

/* ---------- φύλλο με τις κάρτες ---------- */
.sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  background: rgba(12, 4, 22, 0.97);
  padding: calc(12px + var(--safe-top)) calc(14px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(14px + var(--safe-left));
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 4px 0; font-size: 22px; }
.sheet-sub { margin: 2px 0 12px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.btn-close {
  appearance: none;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
  touch-action: manipulation;
  cursor: pointer;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 8px;
  max-width: 520px;
  margin: 0 auto;
}
.cards-grid .fut-card { cursor: pointer; }
.cards-grid .fut-card.me { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 10px; }

.modal {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  background: rgba(8, 2, 16, 0.92);
  overflow-y: auto;
}
.modal-close { width: min(84vw, 340px); }
/* με κουμπιά «+» η κάρτα ψηλώνει όσο χρειάζεται */
.fut-card.assigning { aspect-ratio: auto; }
.fut-card.assigning .fut-inner { height: auto; }
.fut-card.assigning .fut-meta { margin-top: 10px; }
.fut-ability span { margin-right: 3px; }
.modal .sheet-sub { text-align: center; margin: 0; }

/* ---------- Οθόνη φεστιβάλ (Στάδιο 3+) ---------- */
.screen-game {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0b0614;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#game-root { position: absolute; inset: 0; }
#game-root canvas { display: block; touch-action: none; }

.game-loading {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: calc(60px + var(--safe-bottom));
  background: #12051f url('/build/ui/loading.webp') center / cover no-repeat;
  font-weight: 800;
  font-size: 18px;
  text-shadow: 0 2px 8px #000;
}

.hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }
.hud-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + var(--safe-top)) calc(10px + var(--safe-right)) 8px calc(10px + var(--safe-left));
  background: linear-gradient(180deg, rgba(10, 3, 18, 0.75), rgba(10, 3, 18, 0));
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-me {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.hud-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: #2a1a3a;
  border: 2px solid var(--gold);
  flex: none;
}
.hud-name { font-weight: 800; font-size: 15px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-sub { font-size: 12px; color: var(--muted); font-weight: 700; }
.hud-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(20, 8, 34, 0.75);
  color: var(--ink);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 20px;
  position: relative;
  touch-action: manipulation;
  cursor: pointer;
  flex: none;
}
.hud-btn .badge {
  position: absolute;
  right: -3px;
  top: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid #12051f;
}

.zone-hint {
  position: absolute;
  left: 50%;
  top: calc(96px + var(--safe-top));
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(10, 3, 18, 0.72);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* joystick: αριστερό κάτω μέρος της οθόνης */
.joy-zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 62%;
  height: 46%;
  touch-action: none;
}
.joy-base {
  position: absolute;
  width: 124px;
  height: 124px;
  margin: -62px 0 0 -62px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.16));
  border: 2px solid rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
.joy-base.run { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 194, 61, 0.55); }
.joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #d9cde6 60%, #a99abb);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.joy-help {
  position: absolute;
  left: calc(14px + var(--safe-left));
  bottom: calc(16px + var(--safe-bottom));
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}
.screen-game { display: block; padding: 0; }
.screen-game > * { margin: 0 !important; }
.hud-who { min-width: 0; }

/* ---------- Χορός (Στάδιο 5) ---------- */
.hud-xp {
  height: 5px;
  width: 120px;
  margin-top: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.hud-xp i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6a3df0, #ff3fa4);
  transition: width 0.25s ease-out;
}
.hud-chip {
  position: absolute;
  left: 50%;
  top: calc(138px + var(--safe-top));
  transform: translateX(-50%);
  appearance: none;
  border: 1px solid rgba(255, 194, 61, 0.6);
  background: rgba(20, 8, 34, 0.85);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 9px 14px;
  border-radius: 999px;
  white-space: nowrap;
  touch-action: manipulation;
  z-index: 3;
}
.btn-action {
  position: absolute;
  right: calc(16px + var(--safe-right));
  bottom: calc(26px + var(--safe-bottom));
  min-width: 112px;
  height: 64px;
  padding: 0 18px;
  border: 0;
  border-radius: 32px;
  font: inherit;
  font-size: 19px;
  font-weight: 900;
  color: #2a1200;
  background: linear-gradient(180deg, #ffe08a, var(--gold) 45%, var(--gold-2));
  box-shadow: 0 8px 26px rgba(255, 138, 31, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  touch-action: manipulation;
  animation: pulse-btn 1.6s ease-in-out infinite;
  z-index: 4;
}
@keyframes pulse-btn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.dance-ui { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.dance-zone {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  pointer-events: auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.btn-stop {
  position: absolute;
  right: calc(12px + var(--safe-right));
  top: calc(140px + var(--safe-top));
  pointer-events: auto;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(20, 8, 34, 0.85);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 12px;
  touch-action: manipulation;
}
.dance-help {
  position: absolute;
  left: 50%;
  bottom: calc(14px + var(--safe-bottom));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 420px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 4px #000;
  pointer-events: none;
}
.level-up {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  padding: 14px 22px;
  border-radius: 18px;
  font-size: 26px;
  font-weight: 900;
  text-align: center;
  color: #2a1200;
  background: linear-gradient(180deg, #fff1a8, var(--gold) 50%, var(--gold-2));
  box-shadow: 0 10px 40px rgba(255, 138, 31, 0.6);
  z-index: 30;
  pointer-events: none;
  animation: lvl 2.4s ease-out forwards;
}
.level-up small { display: block; font-size: 14px; font-weight: 800; }
@keyframes lvl {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.8); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1); }
}

/* νύχτα: σκοτείνιασμα στις άκρες, σαν νυχτερινή λήψη */
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse 75% 65% at 50% 52%, transparent 55%, rgba(4, 0, 12, 0.5) 100%);
}

/* ---------- Ενέργεια και λιποθυμία (Στάδιο 6) ---------- */
.hud-energy {
  position: relative;
  height: 16px;
  width: 150px;
  margin-top: 5px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.hud-energy i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: linear-gradient(90deg, #2bd46a, #9dff5d);
  transition: width 0.4s ease-out, background 0.4s;
}
.hud-energy.low i { background: linear-gradient(90deg, #ff3b4f, #ff8a3d); }
.hud-energy.low { animation: low-blink 1s ease-in-out infinite; }
@keyframes low-blink { 50% { border-color: #ff5a6a; } }
/* Miss στον χορό: μία κόκκινη λάμψη πάνω στη μπάρα (χάθηκε λίγη ενέργεια) */
.hud-energy.drain::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #ff3b4f;
  pointer-events: none;
  animation: energy-drain 0.5s ease-out forwards;
}
@keyframes energy-drain { from { opacity: 0.65; } to { opacity: 0; } }
.hud-energy span {
  position: relative;
  display: block;
  padding-left: 6px;
  font-size: 11px;
  font-weight: 900;
  line-height: 16px;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
.faint {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: #0b0614 center / cover no-repeat;
  animation: faint-in 0.9s ease-out;
}
@keyframes faint-in { from { filter: brightness(0) blur(6px); } to { filter: none; } }
.faint-photo {
  position: absolute;
  left: 50%;
  bottom: 30%;
  transform: translateX(-50%);
  width: 70%;
  max-width: 340px;
  pointer-events: none;
}
.faint-photo img {
  width: 100%;
  transform: rotate(-82deg) translateX(-10%);
  filter: drop-shadow(0 14px 10px rgba(0, 0, 0, 0.6)) brightness(0.92);
}
.faint.has-photo .faint-photo { display: none; }
.faint-box {
  position: relative;
  margin: 0 16px calc(28px + var(--safe-bottom));
  padding: 16px;
  border-radius: 16px;
  background: rgba(14, 4, 26, 0.86);
  border: 1px solid var(--line);
  text-align: center;
}
.faint-box h2 { margin: 0 0 8px; font-size: 24px; }
.faint-box p { margin: 4px 0; font-size: 15px; line-height: 1.4; }
.faint-wake { color: var(--muted); }

/* ---------- Chat (Στάδιο 7) ---------- */
.nearby {
  position: absolute;
  left: calc(10px + var(--safe-left));
  /* κάτω αριστερά (ΣΧΕΔΙΟ §1), πάνω από τη βοήθεια του joystick· πριν ήταν στη μέση της οθόνης, πάνω στους χαρακτήρες */
  bottom: calc(38px + var(--safe-bottom));
  max-width: min(54%, 300px);
  padding: 6px 9px;
  border-radius: 10px;
  background: rgba(10, 3, 18, 0.55);
  font-size: 12.5px;
  line-height: 1.35;
  pointer-events: none;
  z-index: 2;
}
.near-msg { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.near-msg b { color: var(--gold); }
.sheet-chat { display: flex; flex-direction: column; }
.sheet-chat.hidden { display: none; }
.tabs { display: flex; gap: 6px; margin: 6px 0 10px; }
.tabs button {
  flex: 1;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  padding: 10px;
  border-radius: 12px;
  position: relative;
}
.tabs button.on { background: rgba(255, 194, 61, 0.18); border-color: var(--gold); }
.dot-red { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); vertical-align: middle; }
.chat-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-pane.hidden { display: none; }
.msg-list {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px 8px;
}
.msg {
  align-self: flex-start;
  max-width: 82%;
  padding: 7px 10px;
  border-radius: 12px 12px 12px 4px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.msg.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: rgba(255, 63, 164, 0.25); }
.msg small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.msg-form { display: flex; gap: 8px; padding-top: 8px; }
.msg-form input {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
}
.msg-form .btn { width: auto; padding: 11px 16px; font-size: 16px; }
.pm-friends { display: grid; gap: 6px; overflow-y: auto; }
.pm-friend {
  display: flex;
  align-items: center;
  gap: 10px;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  border-radius: 12px;
}
.pm-friend img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: top; }
.pm-name { flex: 1; }
.pm-count { min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--red); font-size: 12px; text-align: center; }
.pm-convo { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pm-convo.hidden { display: none; }
.pm-head { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

/* ---------- Super δύναμη (σαν τη special ability του GTA 5): μπάρα κάτω από την ενέργεια ---------- */
.hud-power {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  box-sizing: border-box;
  height: 16px;
  width: 150px;
  margin-top: 4px;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.hud-power i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #3a7bff, #4fd8ff);
  transition: width 0.25s linear;
}
.hud-power.ready i { background: linear-gradient(90deg, #ff9d1f, #ffd24a); }
.hud-power.ready { border-color: rgba(255, 214, 102, 0.9); box-shadow: 0 0 10px rgba(255, 200, 80, 0.6); animation: power-ready 1.4s ease-in-out infinite; }
/* δύναμη του v2: γεμίζει, αλλά δεν πατιέται ακόμα → δεν αναβοσβήνει */
.hud-power.soon { animation: none; box-shadow: none; opacity: 0.85; }
@keyframes power-ready { 50% { box-shadow: 0 0 2px rgba(255, 200, 80, 0.2); } }
.hud-power span,
.hud-power b {
  position: relative;
  font-size: 10px;
  font-weight: 900;
  line-height: 14px;
  color: #fff;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}
.hud-power span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hud-power b { flex: none; font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }
.hud-power.ready span,
.hud-power.ready b { color: #2a1500; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-power {
  position: absolute;
  left: 50%;
  top: calc(186px + var(--safe-top));
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  color: #1c1100;
  background: linear-gradient(180deg, #ffe9a0, #ffc23d);
  box-shadow: 0 6px 20px rgba(255, 170, 40, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  touch-action: manipulation;
  z-index: 4;
}

/* ---------- Μίνι-χάρτης σαν GTA: κάτω δεξιά, πάνω από το «Χόρεψε» ---------- */
.radar {
  position: absolute;
  right: calc(12px + var(--safe-right));
  bottom: calc(104px + var(--safe-bottom));
  width: 108px;
  height: 108px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: #0b0714;
  /* σκούρο δαχτυλίδι έξω από το λευκό (ξεχωρίζει και πάνω στην άμμο) + σκιά */
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.7), 0 6px 18px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  z-index: 3;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.radar:active { transform: scale(0.96); }
.radar canvas { display: block; width: 100%; height: 100%; border-radius: 50%; pointer-events: none; }
.bigmap {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(6, 3, 12, 0.97);
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
.bigmap canvas { display: block; width: 100%; height: 100%; }
.bigmap-hint {
  position: absolute;
  left: 50%;
  bottom: calc(12px + var(--safe-bottom));
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.8);
  pointer-events: none;
}

/* ---------- Οριζόντια: κινητό γυρισμένο ή τηλεόραση με AirPlay (ΣΧΕΔΙΟ §3) ---------- */
@media (orientation: landscape) and (max-height: 560px) {
  /* είσοδος: λογότυπο αριστερά, φόρμα δεξιά */
  #screen-login {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 22px;
  }
  #screen-login > :first-child,
  #screen-login > :last-child { margin: 0; }
  #screen-login .logo { width: auto; height: min(74vh, 300px); margin: 0; }
  #screen-login .panel { width: min(44vw, 380px); padding: 14px 14px 10px; }
  #screen-login .field { margin-bottom: 10px; }
  #screen-login .field input { padding: 10px 12px; }

  /* κάρτα: η κάρτα αριστερά (χωράει στο ύψος), λογότυπο/online και κουμπιά δεξιά */
  #screen-card {
    display: grid;
    grid-template-columns: auto minmax(230px, 340px);
    grid-template-rows: 1fr auto auto 1fr;
    column-gap: 26px;
    justify-content: center;
    align-items: center;
  }
  #screen-card > * { margin: 0 !important; }
  #screen-card .card-slot { grid-column: 1; grid-row: 1 / span 4; padding: 0; }
  #screen-card .topbar { grid-column: 2; grid-row: 2; width: 100%; }
  #screen-card .card-actions { grid-column: 2; grid-row: 3; width: 100%; margin-top: 14px !important; }

  /* παιχνίδι: τα μηνύματα πάνω στη μέση, ανάμεσα στο HUD αριστερά και τα κουμπιά δεξιά (όχι πάνω στον χαρακτήρα) */
  .zone-hint { top: calc(12px + var(--safe-top)); max-width: 40vw; }
  .hud-chip { top: calc(52px + var(--safe-top)); }
  /* «Σταμάτα»: στην πάνω σειρά, αριστερά από τα 3 κουμπιά (κάτω τους έπεφτε πάνω του το PERFECT/GOOD του κύκλου) */
  .btn-stop { top: calc(18px + var(--safe-top)); right: calc(170px + var(--safe-right)); }
  .level-up { top: 22%; }

  /* λιποθυμία: η φωτογραφία είναι όρθια· στο οριζόντιο δείχνουμε τη ζώνη με το πρόσωπο / τις σκηνές, και το κουτί μικρό κάτω */
  .faint { background-position: center 30%; }
  .faint.has-photo { background-position: center 66%; }
  .faint-photo { width: 190px; bottom: 22%; }
  .faint-box { width: min(560px, calc(100% - 32px)); margin: 0 auto calc(12px + var(--safe-bottom)); padding: 9px 14px; }
  .faint-box h2 { font-size: 20px; margin-bottom: 4px; }
  .faint-box p { font-size: 14px; margin: 2px 0; }

  /* μενού καρτών: 6 στη σειρά (και οι 12 σε δύο σειρές, σχεδόν χωρίς κύλιση) */
  .cards-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: 900px; }

  /* κάρτα φίλου / μοίρασμα πόντων: κάρτα αριστερά, «Κλείσιμο» δεξιά (όρθια στοίβα κοβόταν πάνω και κάτω) */
  .modal { flex-direction: row; align-items: flex-start; gap: 24px; padding-top: calc(8px + var(--safe-top)); padding-bottom: calc(8px + var(--safe-bottom)); }
  .modal > * { margin-top: auto; margin-bottom: auto; } /* στη μέση όταν χωράει, από πάνω όταν δεν χωράει */
  .modal-close { width: 190px; }

  /* οριζόντια: κάτω στη μέση (πάνω θα έπεφτε στα ονόματα των παικτών) */
  .btn-power { top: auto; bottom: calc(22px + var(--safe-bottom)); padding: 9px 16px; }
  /* μίνι-χάρτης λίγο μικρότερος στο οριζόντιο */
  .radar { width: 92px; height: 92px; bottom: calc(98px + var(--safe-bottom)); }
}
/* η κάρτα μικραίνει όσο χρειάζεται για να χωράει στο ύψος της οθόνης */
@media (orientation: landscape) and (max-height: 400px) { #my-card { zoom: 0.64; } .modal-body { zoom: 0.62; } }
@media (orientation: landscape) and (min-height: 401px) and (max-height: 470px) { #my-card { zoom: 0.74; } .modal-body { zoom: 0.71; } }
@media (orientation: landscape) and (min-height: 471px) and (max-height: 560px) { #my-card { zoom: 0.88; } .modal-body { zoom: 0.8; } }


/* ---------- Μπαρ και πωλητές (client/game/shop.js) ---------- */
/* μέθη κάτω από την ενέργεια: πορτοκαλί, κόκκινη από τα 80 */
.hud-drunk {
  position: relative;
  box-sizing: border-box;
  height: 14px;
  width: 150px;
  margin-top: 4px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.hud-drunk i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #ffb341, #ff7a2f);
  transition: width 0.5s ease-out;
}
.hud-drunk.high i { background: linear-gradient(90deg, #ff6a3d, #ff2f5a); }
.hud-drunk.high { animation: low-blink 1s ease-in-out infinite; }
.hud-drunk span {
  position: relative;
  display: block;
  padding-left: 6px;
  font-size: 10px;
  font-weight: 900;
  line-height: 12px;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
/* οι ουσίες σε δράση: εικονίδιο + πόσο μένει (↓ = πτώση/down) */
.hud-subs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; max-width: 170px; }
.sub-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px 1px 2px;
  border-radius: 9px;
  background: rgba(20, 6, 35, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px #000;
}
.sub-chip img { width: 16px; height: 16px; object-fit: contain; }
.sub-chip.down { border-color: rgba(255, 90, 106, 0.8); color: #ffc3c9; }

/* κουμπί «🍹 Μπαρ» / «💬 Μίλα»: στη θέση του «Χόρεψε» (δεν συμπίπτουν ποτέ) */
.btn-shop {
  max-width: calc(100% - 150px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  background: linear-gradient(180deg, #a8ffe9, #3fe0c0 45%, #17a98f);
  color: #032a22;
  box-shadow: 0 8px 26px rgba(40, 220, 180, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn-shop.vendor {
  background: linear-gradient(180deg, #f4c8ff, #c56bff 45%, #8a2fd6);
  color: #1d0530;
  box-shadow: 0 8px 26px rgba(180, 80, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* K-hole: σκοτεινό μωβ τούνελ, παγωμένος */
.fx-khole {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: calc(var(--hud-h, 100px) + 92px); /* κάτω από την ετικέτα της ζώνης και το «Πάτα για ήχο» */
  background: radial-gradient(ellipse at center, rgba(40, 0, 80, 0) 28%, rgba(30, 0, 60, 0.75) 70%, rgba(5, 0, 12, 0.95) 100%);
  animation: khole 4s ease-in-out infinite;
}
.fx-khole b {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(20, 0, 40, 0.8);
  color: #e6c8ff;
  font-size: 15px;
  font-weight: 900;
}
@keyframes khole { 50% { opacity: 0.8; } }

/* μενού: φύλλο από κάτω (στο οριζόντιο δεξιά), με τον μπάρμαν / πωλητή πάνω αριστερά */
.shop { position: absolute; inset: 0; z-index: 30; }
.shop.hidden { display: none; }
.shop-backdrop { position: absolute; inset: 0; background: rgba(5, 0, 12, 0.45); }
.shop-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 74%;
  display: flex;
  flex-direction: column;
  padding: 10px calc(12px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(12px + var(--safe-left));
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg, rgba(42, 16, 64, 0.98), rgba(16, 5, 28, 0.98));
  border-top: 1px solid rgba(255, 210, 140, 0.35);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  animation: shop-up 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes shop-up { from { transform: translateY(30px); opacity: 0; } }
.shop-head { display: flex; align-items: flex-end; gap: 10px; }
.shop-face {
  position: relative;
  flex: none;
  width: 68px;
  height: 68px;
  margin-top: -40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 210, 140, 0.85);
  background: radial-gradient(circle at 50% 30%, #5a2a7a, #1c0830);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}
/* το πρόσωπο: η εικόνα (880×1168) μεγεθυμένη στο κεφάλι */
.shop-face img { position: absolute; width: 300%; left: -85%; top: -1%; max-width: none; }
.shop[data-look='food_vendor'] .shop-face img { left: -91%; top: 2%; }
.shop[data-look='vendor1'] .shop-face img { left: -106%; top: -8%; }
.shop[data-look='vendor2'] .shop-face img { left: -136%; top: 2%; }
.shop-who { flex: 1; min-width: 0; }
.shop-who b { font-size: 18px; color: #ffe0b0; }
.shop-who p { margin: 2px 0 0; font-size: 13px; color: var(--muted); font-style: italic; }
.shop-stats { margin: 8px 0 6px; font-size: 13px; font-weight: 800; color: #fff; }
.shop-tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.shop-tabs.hidden { display: none; }
.shop-tab {
  flex: 1;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 7px 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  touch-action: manipulation;
}
.shop-tab.on { background: rgba(255, 194, 61, 0.22); border-color: var(--gold); color: #ffe7a8; }
.shop-list { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
.shop-group { margin: 8px 2px 2px; font-size: 11px; font-weight: 900; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.shop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.shop-row.mine { background: rgba(255, 194, 61, 0.1); border-radius: 10px; }
.shop-icon { flex: none; width: 46px; height: 46px; object-fit: contain; }
.shop-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shop-info b { font-size: 15px; }
.shop-info small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.shop-buy {
  flex: none;
  min-width: 76px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  color: #2a1200;
  background: linear-gradient(180deg, #ffe08a, var(--gold));
  touch-action: manipulation;
}
.shop-buy.poor { background: rgba(255, 255, 255, 0.12); color: #c9b7d9; }
.shop-buy:disabled { opacity: 0.55; }
.shop-note { margin: 10px 2px 2px; font-size: 12px; color: #ffb4bd; }

/* «🎒 15 R$» (→ inventory) πάνω, «Πάρ' το τώρα» από κάτω */
.shop-btns { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.shop-now {
  appearance: none;
  border: 1px solid rgba(255, 210, 140, 0.55);
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  color: #ffe0b0;
  background: transparent;
  touch-action: manipulation;
  white-space: nowrap;
}
.shop-now:disabled { opacity: 0.5; }

/* inventory (§9α): ίδιο φύλλο με το μπαρ */
.hud-btn .badge.count {
  width: auto;
  min-width: 18px;
  height: 18px;
  right: -5px;
  top: -5px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 14px;
  color: #2a1200;
  background: var(--gold);
}
.inv-face {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-top: -30px;
  border-radius: 50%;
  font-size: 30px;
  border: 2px solid rgba(255, 210, 140, 0.85);
  background: radial-gradient(circle at 50% 30%, #5a2a7a, #1c0830);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}
.inv-item { border-bottom: 1px solid rgba(255, 255, 255, 0.07); padding-bottom: 8px; }
.inv-item .shop-row { border-bottom: 0; }
.inv-actions { display: flex; gap: 6px; padding-left: 60px; }
.inv-actions .shop-buy { min-width: 0; padding: 7px 12px; font-size: 13px; }
.inv-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 7px 11px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  touch-action: manipulation;
}
.inv-btn.on { border-color: var(--gold); background: rgba(255, 194, 61, 0.2); color: #ffe7a8; }
.inv-who { margin: 8px 0 0 60px; display: flex; flex-direction: column; gap: 6px; }
.inv-price-row { font-size: 13px; font-weight: 800; }
.inv-price {
  width: 84px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font: inherit;
  font-size: 16px; /* 16px: το iPhone δεν κάνει zoom */
  font-weight: 800;
}
.inv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
  border: 1px solid rgba(255, 210, 140, 0.5);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 194, 61, 0.12);
  touch-action: manipulation;
}
.inv-chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: top; background: #2a1a3a; }
.inv-chip:disabled { opacity: 0.5; }
.inv-hint { font-size: 12px; color: var(--muted); }
.inv-empty { margin: 16px 4px; font-size: 14px; color: var(--muted); }
/* φίλος σου πουλάει κάτι: καρτούλα κάτω από το HUD */
.inv-offer {
  position: absolute;
  z-index: 35;
  left: 50%;
  top: max(calc(96px + var(--safe-top)), calc(var(--hud-h, 0px) + 8px));
  transform: translateX(-50%);
  width: min(380px, calc(100% - 20px));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(52, 20, 78, 0.97), rgba(22, 7, 38, 0.97));
  border: 1px solid var(--gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.inv-offer .shop-icon { width: 40px; height: 40px; }
.inv-offer-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inv-offer-text b { font-size: 14px; line-height: 1.25; }
.inv-offer-text small { font-size: 12px; color: var(--muted); }
.inv-offer .shop-buy { min-width: 0; padding: 9px 14px; }
.inv-no {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  touch-action: manipulation;
}

@media (orientation: landscape) and (max-height: 560px) {
  .shop-panel {
    left: auto;
    top: 0;
    width: min(420px, 58%);
    max-height: none;
    border-radius: 20px 0 0 20px;
    padding-top: calc(10px + var(--safe-top));
    animation-name: shop-left;
  }
  .shop-face { margin-top: 0; width: 54px; height: 54px; }
  .inv-face { margin-top: 0; width: 48px; height: 48px; font-size: 26px; }
  /* αριστερά κάτω από το HUD: δεξιά είναι τα κουμπιά του HUD και το φύλλο του inventory/μπαρ */
  .inv-offer { top: calc(64px + var(--safe-top)); left: calc(10px + var(--safe-left)); transform: none; width: min(360px, 42%); }
  .fx-khole { padding-top: calc(96px + var(--safe-top)); }
}
@keyframes shop-left { from { transform: translateX(30px); opacity: 0; } }

/* όρθια (και μεγάλες οθόνες): η ετικέτα της ζώνης και το «Πάτα για ήχο» πάντα κάτω από το HUD, όσο κι αν ψηλώσει */
@media not all and (orientation: landscape) and (max-height: 560px) {
  .zone-hint { top: max(calc(96px + var(--safe-top)), calc(var(--hud-h, 0px) + 4px)); }
  .hud-chip { top: max(calc(138px + var(--safe-top)), calc(var(--hud-h, 0px) + 46px)); }
  .btn-power { top: max(calc(186px + var(--safe-top)), calc(var(--hud-h, 0px) + 94px)); } /* «Δώσε ενέργεια»: κάτω κι από τα δύο */
}

/* bad trip (§8): μωβ σκοτάδι που «αναπνέει» από τις άκρες· η μέση μένει ανοιχτή για τον χαρακτήρα και τον κύκλο */
.fx-badtrip {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 62% 46% at 50% 48%, rgba(40, 0, 80, 0) 22%, rgba(36, 0, 72, 0.62) 62%, rgba(8, 0, 20, 0.96) 100%),
    linear-gradient(180deg, rgba(70, 0, 130, 0.32), rgba(20, 0, 45, 0.4));
  animation: badtrip 5.5s ease-in-out infinite;
}
.fx-badtrip.hidden { display: none; }
@keyframes badtrip {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
.sub-chip.bad { border-color: rgba(176, 108, 255, 0.95); background: rgba(50, 0, 90, 0.85); color: #e6c8ff; padding-left: 6px; }
/* όσο χορεύεις: «τρύπα» στο σκοτάδι γύρω από τον κύκλο (θέση όπως στο dance.js), για να φαίνεται το δαχτυλίδι */
#screen-game:has(#dance-ui:not(.hidden)) .fx-badtrip {
  -webkit-mask-image: radial-gradient(circle at 50% calc(100% - max(150px, 20%)), transparent 125px, #000 185px);
  mask-image: radial-gradient(circle at 50% calc(100% - max(150px, 20%)), transparent 125px, #000 185px);
}
@media (orientation: landscape) and (min-aspect-ratio: 6/5) {
  #screen-game:has(#dance-ui:not(.hidden)) .fx-badtrip {
    -webkit-mask-image: radial-gradient(circle at calc(100% - 78px - max(70px, 9%)) 60%, transparent 125px, #000 185px);
    mask-image: radial-gradient(circle at calc(100% - 78px - max(70px, 9%)) 60%, transparent 125px, #000 185px);
  }
}
