:root { --ink: #1d2433; --mut: #6b7486; --card: #fffaf0; --line: #e7dcc5; --pri: #ff5d5d; --pri2: #ff8a3d; --ok: #2fbf71; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #bfe6ff; color: var(--ink); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
canvas#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 12px; padding: 10px 16px; background: #fff; color: var(--ink); box-shadow: 0 3px 0 rgba(0,0,0,.15); }
button:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.15); }
button.primary { background: linear-gradient(180deg, var(--pri2), var(--pri)); color: #fff; font-weight: 700; }
button.big { font-size: 18px; padding: 14px 18px; width: 100%; text-align: left; font-weight: 600; }
button.link { background: none; box-shadow: none; padding: 4px 0; text-decoration: underline; color: var(--mut); }
.hidden { display: none !important; }
.small { font-size: 13px; color: var(--mut); }
input, select { font: inherit; padding: 9px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }

/* ---- menü ---- */
.screen { position: fixed; inset: 0; overflow: auto; display: none; padding: 24px 16px 60px; gap: 18px; justify-content: center; align-items: flex-start; flex-wrap: wrap; background: linear-gradient(180deg, rgba(124,198,255,.55), rgba(255,233,199,.75)); }
.screen.show { display: flex; }
.menu-card { background: var(--card); border-radius: 22px; padding: 22px 22px 18px; width: min(460px, 100%); box-shadow: 0 10px 0 rgba(0,0,0,.08), 0 20px 50px rgba(0,0,0,.12); }
.menu-card h1 { font-size: clamp(40px, 9vw, 58px); margin: 6px 0 0; letter-spacing: -1px; line-height: 1; background: linear-gradient(90deg, #ff5d5d, #ffb02e, #4d9bff, #4fd37a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { font-size: 20px; margin: 6px 0 10px; }
.explain { color: #3a4255; }
.actions { display: grid; gap: 10px; margin: 16px 0 8px; }
.code { display: flex; gap: 8px; }
.code input { flex: 1; text-transform: uppercase; letter-spacing: 6px; font-weight: 700; text-align: center; }
.online { color: var(--mut); font-size: 13px; margin: 6px 0 0; min-height: 18px; }
.back { color: var(--mut); text-decoration: none; font-size: 14px; }
.side { display: grid; gap: 14px; width: min(380px, 100%); }
.panel { background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: 0 6px 0 rgba(0,0,0,.06); }
.panel h3 { margin: 0 0 8px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel label { display: flex; gap: 8px; align-items: center; }
.panel label input { flex: 1; }
.colors { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.colors i { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.colors i.on { box-shadow: 0 0 0 3px var(--ink); }
.coins { margin: 6px 0; }
.hats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.hats button { padding: 6px 10px; font-size: 13px; }
.hats button.on { outline: 3px solid var(--ok); }
.hats button.lock { opacity: .75; }
#board ol { margin: 0; padding-left: 22px; font-size: 14px; }
#board li { margin: 3px 0; }
#board li b { font-variant-numeric: tabular-nums; }
.how p { margin: 6px 0; font-size: 14px; }
.foot { width: 100%; text-align: center; font-size: 12px; color: #55607a; }
.foot a { color: inherit; }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
.tl { position: absolute; left: 12px; top: 10px; background: rgba(255,250,240,.92); border-radius: 14px; padding: 8px 14px; display: flex; gap: 12px; align-items: baseline; box-shadow: 0 3px 0 rgba(0,0,0,.1); pointer-events: none !important; }
.tl span { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--pri); }
.tr { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.pill { border-radius: 999px; padding: 8px 14px; font-size: 14px; background: rgba(255,250,240,.95); }
.pill.icon { padding: 8px 12px; }
.role { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); background: rgba(29,36,51,.85); color: #fff; border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: 15px; pointer-events: none !important; white-space: nowrap; }
.limbs { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 92vw; }
.limbs button { padding: 8px 12px; font-size: 14px; }
.limbs button.on { background: var(--ink); color: #fff; }
.limbs button.assist { font-size: 12px; opacity: .85; }
.emotes { position: absolute; left: 10px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.emotes button { padding: 6px 9px; font-size: 20px; background: rgba(255,250,240,.9); }
.grip { position: absolute; right: 18px; bottom: 80px; width: 110px; height: 110px; border-radius: 50%; font-weight: 800; font-size: 18px; background: rgba(255,93,93,.9); color: #fff; display: none; }
.grip.down { background: #c0392b; transform: scale(.95); }
body.touch .grip { display: block; }
.respawn { position: absolute; right: 12px; bottom: 14px; }
.feed { position: absolute; right: 12px; top: 60px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none !important; }
.feed div { background: rgba(29,36,51,.78); color: #fff; padding: 4px 10px; border-radius: 10px; font-size: 13px; animation: fade 6s forwards; }
@keyframes fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
.center { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); text-align: center; pointer-events: none !important; font-weight: 900; color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,.25), 0 0 30px rgba(0,0,0,.25); }
.center .n { font-size: 110px; line-height: 1; }
.center .t { font-size: 34px; }
.center .s { font-size: 18px; font-weight: 700; }

/* ---- lebegő ablakok ---- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(29,36,51,.35); overflow: auto; }
.ov-card { background: var(--card); border-radius: 20px; padding: 18px 20px; width: min(560px, 100%); max-height: 100%; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.ov-card.wide { width: min(860px, 100%); }
.ov-card h2 { margin: 0 0 6px; }
.linkrow { display: flex; gap: 6px; margin: 8px 0 12px; }
.linkrow input { flex: 1; min-width: 0; font-size: 13px; }
.teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.team { border-radius: 14px; padding: 10px 12px; background: #fff; border: 3px solid var(--c); }
.team h4 { margin: 0 0 6px; color: var(--c); display: flex; justify-content: space-between; align-items: center; }
.team h4 button { font-size: 12px; padding: 4px 8px; }
.team ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.team li { padding: 2px 0; }
.team li i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.row { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.res-grid { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
@media (max-width: 760px) { .res-grid { grid-template-columns: 1fr; } #hlCv { width: 100%; height: auto; } }
#resTable { width: 100%; border-collapse: collapse; font-size: 14px; }
#resTable td, #resTable th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.hl { background: #1d2433; border-radius: 14px; padding: 8px; color: #fff; text-align: center; }
.hl canvas { border-radius: 10px; display: block; margin: 0 auto; max-width: 100%; }
.hl-cap { font-weight: 700; margin: 6px 0 0; }
.hl .small { color: #b8c0d0; }

#mf-toasts { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.mf-toast { background: #1d2433; color: #fff; padding: 9px 16px; border-radius: 12px; font-size: 14px; transition: opacity .4s; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.mf-toast.out { opacity: 0; }

@media (max-width: 600px) {
  .tl { font-size: 13px; padding: 6px 10px; }
  .pill { padding: 7px 10px; font-size: 13px; }
  .role { top: 54px; font-size: 13px; }
  .center .n { font-size: 80px; }
  .emotes { bottom: 70px; }
  .limbs { bottom: 10px; }
}

/* a lobbi oldalpanel: mögötte a bemelegítő pályán lehet gyakorolni */
#lobby { background: none; pointer-events: none; align-items: flex-start; justify-content: flex-start; padding: 64px 12px 12px; }
#lobby .ov-card { pointer-events: auto; width: min(400px, 100%); max-height: calc(100vh - 150px); background: rgba(255,250,240,.96); }
#lobby .teams { grid-template-columns: 1fr; }
@media (max-width: 760px) { #lobby { padding-top: 96px; } #lobby .ov-card { max-height: 42vh; padding: 12px 14px; } #lobby .ov-card h2 { font-size: 18px; } }
.menu-card h1.rv { background: linear-gradient(90deg, #c0392b, #ff9f43, #ffd23f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mine { position: absolute; left: 12px; top: 56px; background: rgba(29,36,51,.85); color: #fff; border-radius: 12px; padding: 6px 12px; font-size: 14px; pointer-events: none !important; }
.mine b { color: #ffe14d; }
.score { position: absolute; right: 12px; top: 58px; margin: 0; padding: 8px 10px 8px 30px; background: rgba(255,250,240,.92); border-radius: 12px; font-size: 13px; min-width: 170px; pointer-events: none !important; box-shadow: 0 3px 0 rgba(0,0,0,.1); }
.score li { margin: 1px 0; white-space: nowrap; }
.score li.me { font-weight: 800; }
.score i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.score small { color: var(--mut); }
.feed { top: auto; bottom: 150px; }
.alarm { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); background: #c0392b; color: #fff; font-weight: 900; font-size: 22px; padding: 8px 20px; border-radius: 14px; animation: blink .5s infinite alternate; pointer-events: none !important; }
@keyframes blink { from { opacity: 1; } to { opacity: .55; } }
.hint { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); background: rgba(29,36,51,.85); color: #fff; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; pointer-events: none !important; white-space: nowrap; }
.hint:empty { display: none; }
.upg { position: absolute; left: 50%; bottom: 118px; transform: translateX(-50%); display: flex; gap: 6px; }
.upg button { font-size: 13px; padding: 7px 10px; }
.upg button:disabled { opacity: .45; }
.dark { position: absolute; inset: 0; pointer-events: none !important; }
.touchpad { display: none; }
body.touch .touchpad { display: block; }
.touchpad > div { position: absolute; bottom: 14px; display: flex; gap: 8px; }
.tleft { left: 12px; }
.tright { right: 12px; flex-wrap: wrap; justify-content: flex-end; width: 180px; }
.touchpad button { width: 64px; height: 64px; border-radius: 50%; font-size: 24px; font-weight: 800; background: rgba(255,250,240,.9); padding: 0; touch-action: none; }
.touchpad button.sm { width: 48px; height: 48px; font-size: 18px; align-self: flex-end; }
.touchpad button.down { background: #ffe14d; transform: scale(.94); }
body.touch .emotes { bottom: 100px; }
body.touch .hint { bottom: 160px; }
body.touch .upg { bottom: 196px; }
.settings { display: grid; gap: 8px; margin: 6px 0 10px; }
.settings .srow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.settings .srow > span { min-width: 140px; font-weight: 600; font-size: 14px; }
.settings .seg { display: flex; gap: 4px; }
.settings .seg button { padding: 6px 10px; font-size: 13px; }
.settings .seg button.on { background: var(--ink); color: #fff; }
.settings .num { display: flex; align-items: center; gap: 6px; }
.settings .num b { min-width: 24px; text-align: center; font-size: 18px; }
.settings .num button { padding: 4px 12px; font-size: 18px; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 10px; font-size: 14px; }
.plist i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
@media (max-width: 600px) {
  .tl { top: 8px; left: 8px; } .tr { top: 8px; right: 8px; gap: 4px; }
  #bInvite { font-size: 0; padding: 8px 11px; } #bInvite::before { content: '🔗'; font-size: 15px; } #bInvite b { font-size: 13px; margin-left: 4px; }
  .mine { top: 88px; left: 8px; font-size: 11px; padding: 4px 9px; }
  .score { font-size: 10px; min-width: 0; top: 116px; left: 8px; right: auto; padding: 5px 8px 5px 24px; background: rgba(255,250,240,.82); }
  .score li:nth-child(n+5):not(.me) { display: none; }
  .alarm { font-size: 17px; top: 200px; }
  .feed div { font-size: 11px; }
  .tl { font-size: 12px; padding: 6px 10px; } #stInfo { display: none; }
}

.guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 10px; }
.guide div { background: #fff; border-radius: 10px; padding: 6px 8px; font-size: 12px; line-height: 1.3; border: 2px solid var(--line); }
.guide b { display: block; font-size: 13px; margin-bottom: 2px; }
kbd { background: #1d2433; color: #fff; border-radius: 4px; padding: 0 5px; font-size: 11px; }
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 10px; }
.aw { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 9px; display: flex; flex-direction: column; font-size: 13px; }
.aw b { font-size: 14px; } .aw span { font-weight: 800; } .aw small { color: var(--mut); font-size: 11px; }
@media (max-width: 600px) { .guide { grid-template-columns: 1fr; } .guide div { padding: 4px 8px; } }

@media (min-width: 601px) and (max-width: 760px) { .mine { top: 88px; } .score { top: 88px; } }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; box-shadow: 0 0 0 1.5px rgba(0,0,0,.35); vertical-align: 0; }
.upg button { white-space: nowrap; }
body.touch .feed { top: 260px; bottom: auto; right: 8px; max-width: 62vw; }
body.touch .feed div:nth-child(n+4) { display: none; }
body.touch .hint { bottom: 168px; font-size: 12px; }
body.touch .upg { bottom: 204px; gap: 4px; }
body.touch .upg button { font-size: 11px; padding: 6px 7px; }

.upg { flex-direction: column; align-items: center; }
.upg .urow { display: flex; gap: 6px; }
.daily ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; }
.daily li { margin: 3px 0; } .daily li.done { color: var(--ok); text-decoration: line-through; }
#dailyRes { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-bottom: 10px; }
#dailyRes:empty, #dailyMenu:empty { display: none; }
.touchpad button.empty { opacity: .5; }
body.touch .upg .urow button { font-size: 10px; padding: 5px 6px; }

/* ===== Loot Express kiegészítések ===== */
.menu-card h1.logo { font-size: clamp(44px, 10vw, 64px); background: linear-gradient(90deg, #c0392b, #ff9f43, #ffd23f); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: -1.5px; }
.skins { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 8px; }
.skins canvas { width: 96px; height: 120px; background: radial-gradient(circle at 50% 70%, #ffe9c7, #f3d9a4); border-radius: 14px; }
.skins button { padding: 8px 12px; }
.seo { width: min(860px, 100%); background: rgba(255,250,240,.88); border-radius: 18px; padding: 16px 20px; color: #2c3446; font-size: 15px; }
.seo h2 { font-size: 19px; margin: 10px 0 6px; }
.seo li { margin: 4px 0; }
/* asztali akciógombok */
.actbar { position: absolute; right: 12px; bottom: 60px; display: flex; flex-direction: column; gap: 6px; }
.actbar button { display: flex; flex-direction: column; align-items: center; width: 74px; padding: 6px 4px; font-size: 22px; background: rgba(255,250,240,.92); }
.actbar small { font-size: 10px; font-weight: 700; color: var(--mut); }
.actbar button.down { background: #ffe14d; }
body.touch .actbar { display: none; }
.respawn { display: none; }
/* irányítás-bemutató */
.ctrls { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.ctrls div { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 13px; }
.ctrls b { display: block; font-size: 15px; margin-bottom: 2px; }
.goal { background: #1d2433; color: #fff; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
#howto { z-index: 20; }
/* mobil: nagyobb, áttetsző gombok; fekvő módban kényelmes */
body.touch .touchpad button { background: rgba(255,250,240,.72); width: 70px; height: 70px; }
body.touch .touchpad button.sm { width: 52px; height: 52px; }
@media (orientation: landscape) and (max-height: 500px) {
  body.touch .touchpad > div { bottom: 8px; } body.touch .tright { width: 230px; }
  body.touch .emotes { display: none; } body.touch .feed { top: 60px; max-width: 40vw; }
  .score { display: none; } .mine { top: 50px; }
}
