:root {
  --ink: #1b1b2e; --pink: #ff5d8f; --blue: #3a86ff; --yellow: #ffd23f; --green: #2dc653; --purple: #9d4edd;
  --panel: rgba(255, 255, 255, .96); --font: 'Fredoka', 'Arial Rounded MT Bold', system-ui, sans-serif; --title: 'Lilita One', 'Arial Black', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #58b4ff; font-family: var(--font); color: var(--ink); user-select: none; -webkit-user-select: none; touch-action: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; }
.hidden { display: none !important; }
.ingame { display: none; }
body.playing .ingame { display: block; }

/* Schilder in der Welt */
#labels, #floaters { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; text-align: center; white-space: nowrap; font-weight: 700; line-height: 1.15; will-change: transform;
  text-shadow: -1.5px -1.5px 0 #1b1b2e, 1.5px -1.5px 0 #1b1b2e, -1.5px 1.5px 0 #1b1b2e, 1.5px 1.5px 0 #1b1b2e, 0 2px 4px rgba(0,0,0,.5); color: #fff; }
.lbl-cr { font-size: 13px; }
.lbl-cr .nm { font-size: 14px; }
.lbl-cr .hearts { font-size: 11px; text-shadow: none; }
.lbl-char { font-size: 15px; font-family: var(--title); letter-spacing: .5px; }
.lbl-char.me b { color: #9ad1ff; }
.lbl-cash { background: linear-gradient(#5ff08a, #22b14c); border: 2.5px solid #fff; border-radius: 12px; padding: 1px 8px; font-size: 13px; box-shadow: 0 3px 0 #13702f, 0 4px 10px rgba(0,0,0,.3); text-shadow: 0 1px 0 #13702f; }
.lbl-lock { font-size: 12px; background: rgba(27,27,46,.75); padding: 2px 8px; border-radius: 10px; text-shadow: none; }
.lbl-lock.on { background: rgba(220,30,60,.85); }
.lbl-pad { font-size: 14px; background: rgba(27,27,46,.55); padding: 3px 10px; border-radius: 12px; text-shadow: none; }
.lbl-pad small { font-weight: 500; font-size: 11px; opacity: .9; }
.alarm { color: #ff4d5e; animation: blink .4s infinite alternate; font-size: 16px; }
@keyframes blink { to { opacity: .35; } }
.ok { color: #6dff8f; } .no { color: #ff6b6b; } .inc { color: #ffe066; }
.gen { color: #e0aaff; font-size: 11px; }
.r0 { color: #d6dde4; } .r1 { color: #5df07a; } .r2 { color: #c49bff; } .r3 { color: #ffd23f; } .r4 { color: #ff4d5e; }
.r5 { background: linear-gradient(90deg, #ff7ae0, #ffd23f, #5df07a, #4cc9f0, #ff7ae0); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: rb 2s linear infinite; text-shadow: none; filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000); }
.r6 { color: #fff; text-shadow: 0 0 6px #fff, 0 0 12px #c77dff, -1px -1px 0 #000, 1px 1px 0 #000; }
@keyframes rb { to { background-position: 200% 0; } }
.mut { padding: 0 5px; border-radius: 6px; font-size: 11px; text-shadow: none; color: #1b1b2e; }
.mut.gold { background: linear-gradient(#fff3b0, #ffb703); }
.mut.diamant { background: linear-gradient(#e0fbff, #4cc9f0); }
.mut.mond { background: linear-gradient(#d0bfff, #7b2ff7); color: #fff; }
.mut.regenbogen { background: linear-gradient(90deg, #ff5d8f, #ffd23f, #5df07a, #4cc9f0, #b77bff); }
b.mond { color: #c9a7ff; }

.floater { position: absolute; transform: translate(-50%, -50%); font-family: var(--title); font-size: 22px; color: #fff; pointer-events: none;
  text-shadow: -2px -2px 0 #1b1b2e, 2px -2px 0 #1b1b2e, -2px 2px 0 #1b1b2e, 2px 2px 0 #1b1b2e; animation: up 1.3s ease-out forwards; }
.floater.pos { color: #6dff8f; } .floater.neg { color: #ff8fa3; }
.floater.slap { color: #ffd23f; font-size: 30px; animation: slapUp 1.1s ease-out forwards; }
@keyframes up { 0% { opacity: 0; margin-top: 10px; } 15% { opacity: 1; } 100% { opacity: 0; margin-top: -70px; } }
@keyframes slapUp { 0% { transform: translate(-50%,-50%) scale(.3) rotate(-10deg); } 20% { transform: translate(-50%,-50%) scale(1.3) rotate(6deg); } 100% { transform: translate(-50%,-110%) scale(1) rotate(0); opacity: 0; } }

/* HUD */
#hud { position: fixed; left: 16px; top: 14px; pointer-events: none; }
#money { font-family: var(--title); font-size: 46px; color: #6dff8f; line-height: 1;
  text-shadow: -3px -3px 0 #1b1b2e, 3px -3px 0 #1b1b2e, -3px 3px 0 #1b1b2e, 3px 3px 0 #1b1b2e, 0 5px 0 #1b1b2e; }
#income { font-weight: 700; font-size: 18px; color: #ffe066; margin-top: 4px; text-shadow: -1.5px -1.5px 0 #1b1b2e, 1.5px -1.5px 0 #1b1b2e, -1.5px 1.5px 0 #1b1b2e, 1.5px 1.5px 0 #1b1b2e; }
#stars { font-weight: 700; font-size: 14px; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; margin-top: 2px; }
#lockState { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); padding: 7px 18px; border-radius: 30px; font-weight: 700; font-size: 16px; color: #fff; border: 3px solid #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,.25); pointer-events: none; white-space: nowrap; }
#lockState.open { background: #ff8c42; animation: pulse 1.2s infinite; }
#lockState.locked { background: #e5383b; }
#lockState.night { background: #5a189a; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.05); } }
#topbtns { position: fixed; right: 14px; top: 14px; }
#topbtns button { font-size: 20px; min-width: 46px; height: 46px; border-radius: 14px; border: 3px solid #fff; background: var(--blue); color: #fff; margin-left: 6px; font-weight: 700;
  box-shadow: 0 4px 0 #1d4fa8; transition: transform .1s; }
#topbtns button:active { transform: translateY(3px); box-shadow: 0 1px 0 #1d4fa8; }
#topbtns button.off { background: #8d99ae; box-shadow: 0 4px 0 #5c677d; }
#btnLex { background: var(--purple) !important; box-shadow: 0 4px 0 #5a189a !important; }
#minimap { position: fixed; right: 14px; top: 74px; border-radius: 14px; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.3); width: 200px; height: 125px; }
#toasts { position: fixed; left: 16px; top: 120px; width: min(420px, 60vw); pointer-events: none; }
.toast { background: var(--panel); border-radius: 14px; padding: 9px 14px; margin-bottom: 8px; font-size: 15px; font-weight: 500; border-left: 7px solid var(--blue);
  box-shadow: 0 4px 14px rgba(0,0,0,.2); animation: tin .3s cubic-bezier(.2,1.4,.5,1); transition: opacity .4s, transform .4s; }
.toast.good { border-left-color: var(--green); } .toast.bad { border-left-color: #e5383b; } .toast.rare { border-left-color: var(--pink); background: #fff0f6; }
.toast.out { opacity: 0; transform: translateX(-30px); }
@keyframes tin { from { opacity: 0; transform: translateX(-40px) scale(.9); } }
#hint { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .15s; background: rgba(27,27,46,.85); color: #fff; padding: 10px 20px;
  border-radius: 30px; font-size: 18px; font-weight: 600; pointer-events: none; white-space: nowrap; border: 3px solid rgba(255,255,255,.8); }
#hint.show { opacity: 1; transform: translateX(-50%); }
#hint kbd, .help kbd { display: inline-block; background: #fff; color: var(--ink); border-radius: 7px; padding: 0 8px; margin-right: 6px; font-family: var(--title); box-shadow: 0 3px 0 #adb5bd; }
#banner { position: fixed; top: 22%; left: 50%; transform: translate(-50%, -50%) scale(.4); opacity: 0; pointer-events: none; text-align: center; transition: none; }
#banner.show { animation: ban 4.2s cubic-bezier(.2,1.5,.5,1) forwards; }
@keyframes ban { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.4); } 8% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 85% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-70%) scale(.9); } }
#banner .bt { font-family: var(--title); font-size: clamp(34px, 6vw, 64px); color: #ffd23f; white-space: nowrap;
  text-shadow: -4px -4px 0 #1b1b2e, 4px -4px 0 #1b1b2e, -4px 4px 0 #1b1b2e, 4px 4px 0 #1b1b2e, 0 7px 0 #1b1b2e; }
#banner .bs { display: inline-block; margin-top: 8px; background: var(--panel); padding: 8px 18px; border-radius: 16px; font-size: 18px; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
#banner .bs span { text-shadow: -1px -1px 0 #1b1b2e, 1px -1px 0 #1b1b2e, -1px 1px 0 #1b1b2e, 1px 1px 0 #1b1b2e; font-weight: 700; }

/* Touch */
#touch { display: none !important; }
body.touch.playing #touch { display: block !important; }
#joy { position: fixed; left: 28px; bottom: 28px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.25); border: 4px solid rgba(255,255,255,.7); }
#joyKnob { position: absolute; left: 35px; top: 35px; width: 62px; height: 62px; border-radius: 50%; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.3); }
#btnAct, #btnSlap { position: fixed; bottom: 34px; width: 92px; height: 92px; border-radius: 50%; border: 4px solid #fff; font-size: 34px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
#btnAct small, #btnSlap small { font-size: 12px; font-weight: 700; margin-top: 3px; }
#btnAct { right: 26px; background: var(--green); box-shadow: 0 6px 0 #13702f; }
#btnSlap { right: 132px; bottom: 54px; width: 78px; height: 78px; font-size: 28px; background: var(--pink); box-shadow: 0 6px 0 #b51d5a; }
body.touch #hint { bottom: 140px; font-size: 16px; }

/* Fenster */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(20,10,50,.45); z-index: 10; padding: 16px; }
.panel { position: relative; background: var(--panel); border-radius: 26px; padding: 22px 26px; width: min(520px, 100%); max-height: 88vh; overflow: auto; box-shadow: 0 10px 0 rgba(0,0,0,.15), 0 20px 50px rgba(0,0,0,.35); border: 4px solid #fff; animation: pop .25s cubic-bezier(.2,1.5,.5,1); }
.panel.wide { width: min(900px, 100%); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.panel h2 { font-family: var(--title); font-size: 34px; margin: 0 0 12px; color: var(--purple); letter-spacing: .5px; }
.panel h3 { margin: 18px 0 8px; }
.x { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%; border: none; background: #e9ecef; font-size: 18px; font-weight: 700; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: #f3f0ff; margin-bottom: 10px; }
.item .ic { font-size: 36px; width: 50px; text-align: center; }
.item .tx { flex: 1; font-size: 16px; } .item small { color: #555; }
.item button, button.big { border: 3px solid #fff; background: var(--green); color: #fff; font-weight: 700; font-size: 17px; border-radius: 14px; padding: 9px 16px; box-shadow: 0 4px 0 #13702f; min-width: 90px; }
.item button:disabled, button.big:disabled { background: #adb5bd; box-shadow: 0 4px 0 #6c757d; cursor: default; }
.warn { color: #c1121f; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.card { background: linear-gradient(#f7f0ff, #e7dcff); border-radius: 16px; padding: 6px 6px 8px; text-align: center; cursor: pointer; transition: transform .1s; }
.card:hover { transform: translateY(-3px) rotate(-1deg); }
.card img { width: 100%; aspect-ratio: 1; display: block; }
.card .cn { font-weight: 700; font-size: 13px; line-height: 1.1; }
.card .cr { font-size: 12px; font-weight: 700; text-shadow: -1px -1px 0 #1b1b2e, 1px -1px 0 #1b1b2e, -1px 1px 0 #1b1b2e, 1px 1px 0 #1b1b2e; }
.card .cg { font-size: 10px; color: #7a6b99; }
.card.unk { background: #ddd8e8; cursor: default; }
.lexsum { font-size: 18px; } .empty { color: #777; grid-column: 1/-1; }
.help { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.help > div { background: #f3f0ff; border-radius: 16px; padding: 4px 14px 8px; }
.help h4 { margin: 10px 0 4px; font-size: 17px; } .help p { margin: 6px 0; font-size: 15px; line-height: 1.35; }
.new { background: var(--pink); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 8px; vertical-align: middle; }

/* Startbildschirm */
.modal.start { flex-direction: column; background: radial-gradient(ellipse at center, rgba(255,255,255,0) 30%, rgba(40,10,90,.45)); gap: 18px; }
.logo { text-align: center; transform: rotate(-3deg); animation: logoIn .9s cubic-bezier(.2,1.6,.5,1); }
@keyframes logoIn { from { transform: rotate(-3deg) scale(.2); opacity: 0; } }
.logo .l1, .logo .l2 { font-family: var(--title); line-height: .9; letter-spacing: 2px; }
.logo .l1 { font-size: clamp(56px, 11vw, 120px); color: #ff5d8f; text-shadow: -5px -5px 0 #fff, 5px -5px 0 #fff, -5px 5px 0 #fff, 5px 5px 0 #fff, 0 10px 0 #b51d5a, 0 14px 20px rgba(0,0,0,.35); }
.logo .l2 { font-size: clamp(50px, 10vw, 108px); color: #ffd23f; text-shadow: -5px -5px 0 #1b1b2e, 5px -5px 0 #1b1b2e, -5px 5px 0 #1b1b2e, 5px 5px 0 #1b1b2e, 0 10px 0 #1b1b2e, 0 14px 20px rgba(0,0,0,.35); animation: wob 2.4s ease-in-out infinite; }
@keyframes wob { 50% { transform: rotate(2deg) scale(1.03); } }
.logo .sub { display: inline-block; margin-top: 12px; background: #3a86ff; color: #fff; font-family: var(--title); font-size: clamp(18px, 3vw, 28px); padding: 4px 20px; border-radius: 30px; border: 4px solid #fff; box-shadow: 0 5px 0 #1d4fa8; }
.startbox { background: var(--panel); border-radius: 26px; padding: 18px 22px; width: min(480px, 100%); text-align: center; border: 4px solid #fff; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.pitch { font-size: 16px; line-height: 1.4; margin: 0 0 12px; }
.diff span { font-weight: 600; font-size: 14px; color: #555; }
.diff div { display: flex; gap: 6px; justify-content: center; margin: 6px 0 14px; flex-wrap: wrap; }
.diff button { border: 3px solid #e0d6ff; background: #fff; border-radius: 14px; padding: 7px 12px; font-size: 15px; font-weight: 600; }
.diff button.sel { border-color: var(--purple); background: #f3eaff; box-shadow: 0 3px 0 var(--purple); }
button.big { display: block; width: 100%; margin: 8px 0; font-size: 22px; padding: 12px; font-family: var(--title); letter-spacing: .5px; }
button.big small { display: block; font-family: var(--font); font-size: 13px; opacity: .9; }
button.big.alt { background: var(--pink); box-shadow: 0 4px 0 #b51d5a; }
button.link { border: none; background: none; color: var(--blue); font-weight: 600; font-size: 15px; margin-top: 4px; }

@media (max-width: 700px) {
  #money { font-size: 34px; } #income { font-size: 15px; }
  #minimap { width: 140px; height: 88px; top: 70px; }
  #topbtns button { min-width: 38px; height: 38px; font-size: 16px; margin-left: 3px; }
  #lockState { top: auto; bottom: 190px; font-size: 13px; }
  #toasts { top: 100px; width: 70vw; } .toast { font-size: 13px; }
  .lbl-cr { font-size: 11px; } .lbl-cr .nm { font-size: 12px; }
}
.card .cr.r5 { text-shadow: none; }
@media (max-height: 520px) {
  .modal.start { flex-direction: row; gap: 14px; overflow: auto; }
  .logo .l1 { font-size: 46px; } .logo .l2 { font-size: 42px; } .logo .sub { font-size: 15px; padding: 3px 12px; }
  .pitch { display: none; } .startbox { padding: 10px 14px; width: min(400px, 100%); }
  button.big { font-size: 18px; padding: 8px; margin: 5px 0; }
  #money { font-size: 30px; } #income { font-size: 13px; }
  #minimap { width: 120px; height: 75px; top: 58px; }
  #topbtns { top: 8px; } #topbtns button { min-width: 34px; height: 34px; font-size: 15px; margin-left: 3px; border-width: 2px; }
  #toasts { width: 44vw; top: 78px; } .toast { font-size: 12px; padding: 5px 10px; margin-bottom: 5px; }
  #lockState { top: 8px; bottom: auto; font-size: 12px; padding: 4px 12px; }
  #joy { width: 110px; height: 110px; left: 16px; bottom: 16px; } #joyKnob { left: 21px; top: 21px; width: 60px; height: 60px; }
  #btnAct { width: 76px; height: 76px; bottom: 18px; right: 16px; font-size: 28px; }
  #btnSlap { width: 62px; height: 62px; right: 102px; bottom: 34px; font-size: 22px; }
  body.touch #hint { bottom: 12px; font-size: 13px; }
  .lbl-pad { display: none; }
}

/* Startbildschirm: Name, Aussehen, Mitspielen */
.who label { display: block; font-weight: 600; font-size: 15px; color: #555; }
.who input, .join input { font-family: var(--title); font-size: 22px; padding: 6px 12px; border-radius: 14px; border: 3px solid #e0d6ff; width: 210px; text-align: center; color: var(--ink); margin-top: 4px; outline: none; }
.who input:focus, .join input:focus { border-color: var(--purple); }
.looks { display: grid; grid-template-columns: auto auto; gap: 6px 10px; justify-content: center; align-items: center; margin: 10px 0 4px; font-size: 13px; font-weight: 600; color: #555; }
.looks > div { display: flex; gap: 6px; }
.sw { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #ddd; padding: 0; }
.sw.sel { box-shadow: 0 0 0 3px var(--ink); transform: scale(1.1); }
.join { margin-top: 10px; padding-top: 10px; border-top: 2px dashed #e0d6ff; }
.join span { font-weight: 600; font-size: 14px; color: #555; }
.join > div:first-of-type { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.join input { width: 110px; letter-spacing: 4px; }
.join button { border: 3px solid #fff; background: var(--blue); color: #fff; font-weight: 700; font-size: 16px; border-radius: 14px; padding: 6px 14px; box-shadow: 0 4px 0 #1d4fa8; }
#joinMsg { min-height: 18px; font-size: 13px; color: #c1121f; margin-top: 4px; font-weight: 600; }
#room { position: fixed; right: 14px; top: 208px; width: 200px; background: rgba(255,255,255,.94); border-radius: 14px; padding: 7px 10px; font-size: 13px; font-weight: 600; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.2); pointer-events: none; }
#room .code { font-family: var(--title); font-size: 20px; letter-spacing: 2px; color: var(--purple); }
.floater.bark { color: #fff; font-size: 20px; }
@media (max-width: 700px) { #room { width: 140px; top: 165px; font-size: 11px; } }
@media (max-height: 520px) { #room { width: 120px; top: 140px; font-size: 10px; } .looks { margin: 4px 0; } .who input { font-size: 17px; width: 160px; } .sw { width: 24px; height: 24px; } }

/* Halloween */
.mut.kuerbis { background: linear-gradient(#ffc06b, #ff7b00); }
#candy { position: fixed; left: 16px; top: 98px; background: linear-gradient(#3c1a5b, #241036); color: #fff; border: 3px solid #ff8c1a; border-radius: 16px; padding: 4px 12px; font-size: 16px; font-weight: 700; box-shadow: 0 4px 0 #7a3d00; pointer-events: none; max-width: 340px; }
#candy small { display: block; font-weight: 500; font-size: 12px; color: #ffd6a8; }
body.playing #candy.hidden { display: none; }
#toasts { top: 160px; }
#eventBadge { display: inline-block; margin-top: 10px; background: linear-gradient(#ff9a3c, #ff6a00); color: #fff; font-family: var(--title); font-size: clamp(16px, 2.4vw, 22px); padding: 4px 16px; border-radius: 20px; border: 3px solid #3c1a5b; transform: rotate(2deg); animation: wob 2s ease-in-out infinite; }
@media (max-height: 520px) { #candy { top: 60px; font-size: 13px; max-width: 220px; } #toasts { top: 110px; } }
