/* ===== Spieloberfläche ===== */
body.play { min-height: 100vh; overflow-x: hidden; }
.conn { position: fixed; top: 0; left: 0; right: 0; z-index: 10000; background: var(--red); color: #fff; text-align: center; padding: 6px; font-weight: 600; }

.center-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 30px 16px; background: radial-gradient(ellipse at top, #1d2230, var(--bg) 70%); }
.form-card { width: min(480px, 100%); display: flex; flex-direction: column; gap: 14px; }
.form-card.wide { width: min(860px, 100%); }
.code-input { font-family: var(--mono); font-size: 1.5rem; text-align: center; letter-spacing: .15em; text-transform: uppercase; padding: .8em; }
.choose-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 10px 0; }
.choose-card { position: relative; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--bg2); }
.choose-card input { position: absolute; opacity: 0; }
.choose-card img { display: block; aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.choose-meta { padding: 8px 10px; display: flex; flex-direction: column; font-size: .9rem; }
.choose-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 163, 61, .25); }

/* Lobby */
.lobby-cover { position: fixed; inset: 0; background-size: cover; background-position: center; filter: brightness(.28) saturate(.8); z-index: -1; }
.lobby { width: min(1200px, 94vw); margin: 40px auto; display: grid; grid-template-columns: 1fr 360px; gap: 24px; }
@media (max-width: 900px) { .lobby { grid-template-columns: 1fr; } }
.lobby .card { background: rgba(23, 27, 36, .92); backdrop-filter: blur(6px); }
.lobby-side { display: flex; flex-direction: column; gap: 16px; }
.story { font-size: 1.05rem; color: #d8d3c8; }
.story p:first-child { margin-top: 0; }
.howto ul { padding-left: 0; list-style: none; }
.howto li { padding: 6px 0; color: #cfcabf; }
.copy-row { display: flex; gap: 8px; margin: 8px 0; }
.copy-row input { font-size: .85rem; }
.player-list { list-style: none; padding: 0; margin: 0; }
.player-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; opacity: .35; flex: none; }
.dot.on { opacity: 1; box-shadow: 0 0 0 3px rgba(76, 175, 122, .35); }

/* HUD */
#screen-game { height: 100vh; display: flex; flex-direction: column; background: #07080b; }
.hud { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; background: linear-gradient(180deg, #151923, #0f1218); border-bottom: 1px solid var(--line); z-index: 20; }
.hud-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hud-logo { font-size: 1.6rem; color: var(--accent); text-decoration: none !important; }
.hud-title { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.hud-level { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.hud-mid { text-align: center; }
.timer { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--accent); letter-spacing: .05em; }
.penalty { font-size: .72rem; color: var(--red); }
.hud-right { display: flex; align-items: center; gap: 4px; }
.hud-btn { position: relative; background: transparent; border: 1px solid transparent; color: var(--text); font-size: 1.2rem; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; }
.hud-btn:hover, .hud-btn.active { background: #232a38; border-color: var(--line); }
.badge { position: absolute; top: 2px; right: 2px; background: var(--accent); color: #000; font-size: .62rem; font-weight: 800; border-radius: 99px; padding: 0 4px; line-height: 1.4; }
.badge:empty { display: none; }
.avatars { display: flex; margin-right: 8px; }
.avatar { position: relative; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #fff; border: 2px solid #0f1218; margin-left: -6px; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.avatar.off { filter: grayscale(1); opacity: .45; }
.avatar-focus { position: absolute; bottom: -6px; right: -6px; font-size: .7rem; }
.hud-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; }
.hud-progress > div { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width .6s; }
@media (max-width: 860px) {
  .hud { flex-wrap: wrap; }
  .hud-mid { order: -1; width: 100%; display: flex; gap: 10px; justify-content: center; align-items: baseline; }
  .avatars { display: none; }
  .hud-btn { width: 34px; height: 34px; font-size: 1rem; }
}

/* Smartphones: im Hochformat zum Drehen auffordern, im Querformat kompakte Leisten */
.rotate-hint { display: none; }
@media (max-width: 700px) and (orientation: portrait) {
  .rotate-hint { display: flex; position: absolute; left: 10px; right: 10px; top: 10px; z-index: 8; gap: 10px; align-items: center; background: rgba(20, 24, 34, .95); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 12px; font-size: .88rem; }
  .rotate-hint.closed { display: none; }
  .rotate-hint b { font-size: 1.6rem; }
  .rotate-hint button { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 1.1rem; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .hud { flex-wrap: nowrap; padding: 3px 8px; }
  .hud-mid { order: 0; width: auto; display: block; }
  .hud-title, .avatars, .hud-logo { display: none; }
  .hud-level { font-size: .72rem; max-width: 28vw; }
  .timer { font-size: 1.05rem; }
  .penalty { font-size: .6rem; }
  .hud-btn { width: 30px; height: 30px; font-size: .9rem; }
  .taskbar { min-height: 0; padding: 3px 8px; font-size: .78rem; gap: 8px; }
  .task-label { display: none; }
  .inv-item { padding: 1px 6px; font-size: 1rem; }
  .inv-item small { display: none; }
  .scene-wrap { padding: 3px; }
  .taskbar .btn { padding: .35em .8em; font-size: .8rem; }
}

/* Szene */
.game-main { flex: 1; display: flex; min-height: 0; position: relative; }
.scene-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; position: relative; padding: 10px; container-type: size; }
.scene { position: relative; width: min(100cqw, calc(100cqh * 16 / 9)); aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .7); user-select: none; container-type: inline-size; }
.scene > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene.fade-in > img { animation: sceneIn .8s ease; }
@keyframes sceneIn { from { opacity: 0; transform: scale(1.03); filter: blur(4px); } }

.hotspot { position: absolute; background: transparent; border: 0; padding: 0; margin: 0; border-radius: 8px; cursor: zoom-in; transition: box-shadow .2s, background .2s; z-index: 2; }
.hotspot.ellipse { border-radius: 50%; }
.hotspot.cur-use { cursor: pointer; }
.hotspot.cur-look { cursor: help; }
.hotspot:hover, .hotspot:focus-visible { background: rgba(255, 220, 140, .08); box-shadow: 0 0 0 2px rgba(255, 210, 120, .55), 0 0 30px rgba(255, 200, 100, .35); outline: none; }
.hotspot:hover::after { content: attr(data-label); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); background: rgba(0, 0, 0, .8); color: #fff; padding: 3px 10px; border-radius: 6px; font-size: 13px; white-space: nowrap; pointer-events: none; }
.hotspot:hover[data-label='']::after { display: none; }
.scene.reveal .hotspot, .stage.reveal .hotspot { animation: reveal 1.6s ease; }
@keyframes reveal { 0%, 100% { box-shadow: none; } 20%, 70% { box-shadow: 0 0 0 2px var(--accent), 0 0 24px rgba(232, 163, 61, .7); background: rgba(232, 163, 61, .15); } }
.hotspot.pressed { animation: pressed .4s ease; }
@keyframes pressed { 50% { background: rgba(255, 230, 150, .35); transform: scale(.96); } }

.overlay { position: absolute; z-index: 1; pointer-events: none; line-height: 1.2; }
.ov-hand { font-family: var(--hand); color: #2b2216; }
.ov-chalk { font-family: var(--hand); color: rgba(255, 255, 255, .85); text-shadow: 0 0 2px rgba(255, 255, 255, .4); }
.ov-glow { color: #9ff; text-shadow: 0 0 6px #0ff, 0 0 14px #0ff; font-family: var(--mono); font-weight: 700; }
.ov-red { color: #ff4040; text-shadow: 0 0 6px #f00; font-family: var(--mono); font-weight: 700; }
.ov-paper { background: #f3ead6; color: #2b2216; padding: .4em .6em; box-shadow: 0 3px 8px rgba(0, 0, 0, .5); font-family: var(--hand); }
.ov-carve { color: rgba(30, 20, 10, .85); text-shadow: 1px 1px 0 rgba(255, 230, 190, .35); font-family: var(--serif); font-weight: 700; }
.ov-gold { color: #ffd76a; text-shadow: 0 0 4px rgba(0, 0, 0, .9), 0 0 10px rgba(255, 190, 60, .6); font-family: var(--serif); font-weight: 700; }
.ov-white { color: #fff; text-shadow: 0 1px 3px #000, 0 0 8px #000; font-weight: 700; }
.ov-dark { background: rgba(0, 0, 0, .75); color: #fff; padding: .3em .6em; border-radius: 4px; }
.ov-lcd { font-family: var(--mono); color: #7dff9a; background: rgba(0, 20, 0, .7); padding: .1em .4em; text-shadow: 0 0 6px #3f6; }
.ov-blood { color: #7a0d0d; font-family: var(--hand); font-weight: 700; text-shadow: 0 0 2px rgba(120, 0, 0, .7); }

.ping { position: absolute; width: 0; height: 0; z-index: 5; pointer-events: none; }
.ping::before, .ping::after { content: ''; position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--c); animation: ping 1.2s ease-out infinite; }
.ping::after { animation-delay: .4s; }
.ping span { position: absolute; left: 14px; top: -34px; background: var(--c); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
@keyframes ping { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

.press-bar { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 6; }
.press-chip { background: rgba(0, 0, 0, .8); border: 1px solid var(--accent); border-radius: 99px; padding: 4px 6px 4px 14px; font-size: .85rem; display: flex; gap: 8px; align-items: center; }
.press-chip button { background: #333; color: #fff; border: 0; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; }

/* Seitenleiste */
.side { width: 0; overflow: hidden; background: #11141b; border-left: 1px solid var(--line); transition: width .25s; display: flex; flex-direction: column; }
.side.open { width: 340px; }
.side-pane { display: none; flex-direction: column; gap: 10px; padding: 16px; height: 100%; min-height: 0; width: 340px; }
.side.tab-hints .pane-hints, .side.tab-chat .pane-chat, .side.tab-notes .pane-notes { display: flex; }
@media (max-width: 860px) { .side { position: absolute; right: 0; top: 0; bottom: 0; z-index: 30; } .side.open { width: min(340px, 92vw); } .side-pane { width: min(340px, 92vw); } }
.hint { background: #1b2130; border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: 8px; font-size: .95rem; }
.hint.solution { border-left-color: var(--red); }
.hint b { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.chat-log { flex: 1; overflow-y: auto; background: #0c0e13; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: .92rem; min-height: 120px; }
.chat-msg { margin-bottom: 6px; word-wrap: break-word; }
.chat-msg.sys { color: var(--muted); font-style: italic; font-size: .82rem; }
.chat-msg.gm { background: rgba(232, 163, 61, .12); border-radius: 6px; padding: 4px 8px; }
.chat-form { display: flex; gap: 6px; }
.chat-form .btn { padding: .5em .9em; }
#notes { flex: 1; resize: none; font-family: var(--hand); font-size: 1.05rem; background: #f5edd9; color: #2b2216; line-height: 1.6; background-image: repeating-linear-gradient(transparent, transparent 27px, #d5c9a8 28px); }

/* Aufgabenleiste */
.taskbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: #0f1218; border-top: 1px solid var(--line); min-height: 58px; }
.task { flex: 1; color: #d8d3c8; font-size: .95rem; }
.task-label { background: rgba(232, 163, 61, .14); color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; margin-right: 6px; }
.inventory { display: flex; gap: 6px; }
.inv-item { display: flex; flex-direction: column; align-items: center; background: #1b2130; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; cursor: pointer; color: var(--text); font-size: 1.3rem; }
.inv-item small { font-size: .65rem; color: var(--muted); }
.inv-item:hover { border-color: var(--accent); }

/* Modal */
#modals .modal { position: fixed; inset: 0; z-index: 100; background: rgba(4, 5, 8, .78); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-card { position: relative; background: #151922; border: 1px solid var(--line); border-radius: 16px; padding: 28px; max-width: min(720px, 96vw); max-height: 94vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .8); animation: popIn .25s ease; }
@keyframes popIn { from { transform: scale(.94); opacity: 0; } }
.modal.wide .modal-card { max-width: min(1200px, 96vw); width: 100%; }
.modal.full .modal-card { width: 96vw; height: 92vh; max-width: none; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.modal.full .modal-body { flex: 1; display: flex; min-height: 0; }
.modal.bare .modal-card { background: transparent; border: 0; box-shadow: none; padding: 0; overflow: visible; }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 5; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #222838; color: #fff; font-size: 1rem; cursor: pointer; }
.modal.full .modal-close { top: 8px; right: 8px; }
.modal.bare .modal-close { top: -8px; right: -8px; }

.intro { text-align: center; max-width: 620px; }
.intro-text { text-align: left; font-size: 1.05rem; color: #d8d3c8; margin: 14px 0 20px; }
.intro-task { background: rgba(232, 163, 61, .1); border: 1px solid rgba(232, 163, 61, .35); border-radius: 10px; padding: 12px 16px; text-align: left; margin-bottom: 20px; }
.solved { text-align: center; max-width: 600px; }
.solved-badge { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem; background: radial-gradient(circle, #64d695, #2d8a57); color: #fff; box-shadow: 0 0 40px rgba(76, 175, 122, .6); animation: badge .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes badge { from { transform: scale(0) rotate(-90deg); } }

/* ===== Schlösser ===== */
.lock { text-align: center; min-width: min(380px, 80vw); }
.lock-title { margin-bottom: 6px; }
.lock-prompt { color: var(--muted); margin-bottom: 18px; }
.lock-status { min-height: 1.5em; margin-top: 14px; font-weight: 700; }
.lock-status.ok { color: var(--green); }
.lock-status.fail { color: var(--red); }
.lock-open { font-size: 1.2rem; color: var(--green); margin: 14px 0; }
.lock-go { margin-top: 18px; }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.padlock { display: inline-flex; flex-direction: column; align-items: center; }
.padlock-shackle { width: 150px; height: 90px; border: 22px solid #b8b8b8; border-bottom: 0; border-radius: 80px 80px 0 0; background: transparent; margin-bottom: -6px; box-shadow: inset 0 4px 6px rgba(0, 0, 0, .3); border-color: #c9c9c9 #9a9a9a #9a9a9a #d8d8d8; transition: transform .5s; }
.unlocking .padlock-shackle { transform: translateY(-26px); }
.padlock-body { background: linear-gradient(145deg, #e3b65a, #a77a26 55%, #7c5512); padding: 24px 22px; border-radius: 18px; box-shadow: inset 0 2px 3px rgba(255, 255, 255, .5), inset 0 -4px 8px rgba(0, 0, 0, .35), 0 14px 30px rgba(0, 0, 0, .6); }
.wheels { display: flex; gap: 8px; }
.wheel { display: flex; flex-direction: column; align-items: center; }
.wheel-btn { background: transparent; border: 0; color: #3b2a0c; cursor: pointer; font-size: .9rem; padding: 2px 10px; }
.wheel-val { width: 50px; height: 96px; background: linear-gradient(180deg, #111 0%, #3a3a3a 25%, #5a5a5a 50%, #3a3a3a 75%, #111 100%); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #f2f2f2; font-family: var(--mono); font-weight: 700; overflow: hidden; outline: none; box-shadow: inset 0 0 8px rgba(0, 0, 0, .8); cursor: ns-resize; }
.wheel-val.focus { box-shadow: inset 0 0 8px rgba(0, 0, 0, .8), 0 0 0 3px rgba(255, 240, 200, .7); }
.wheel-cur { font-size: 1.9rem; line-height: 1.2; }
.wheel-prev, .wheel-next { font-size: .9rem; opacity: .35; line-height: 1.2; }
.lock-symbols .wheel-cur { font-size: 1.7rem; }

.keypad { display: inline-flex; flex-direction: column; gap: 14px; background: linear-gradient(160deg, #3a3f48, #1e2127); padding: 22px; border-radius: 18px; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .2), 0 14px 30px rgba(0, 0, 0, .6); }
.skin-scifi .keypad { background: linear-gradient(160deg, #0f2a33, #081419); border: 1px solid #1e6b7a; box-shadow: 0 0 30px rgba(0, 200, 255, .2); }
.keypad-display { background: #0b1a0d; color: #7dff9a; font-family: var(--mono); font-size: 1.8rem; letter-spacing: .3em; padding: 8px 16px; border-radius: 8px; text-shadow: 0 0 8px #3f6; box-shadow: inset 0 0 12px #000; min-width: 200px; }
.keypad-grid { display: grid; grid-template-columns: repeat(3, 64px); gap: 10px; }
.keypad-key { height: 56px; border-radius: 12px; border: 0; background: linear-gradient(180deg, #5d636e, #3a3f48); color: #fff; font-size: 1.35rem; font-weight: 700; cursor: pointer; box-shadow: 0 4px 0 #1a1c20; }
.keypad-key:active { transform: translateY(3px); box-shadow: 0 1px 0 #1a1c20; }
.keypad-key.ok { background: linear-gradient(180deg, #4caf7a, #2d7a50); }
.skin-scifi .keypad-key { background: linear-gradient(180deg, #14505e, #0b2c35); color: #8ef; box-shadow: 0 4px 0 #031014; }

.text-lock { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; }
.text-answer { font-size: 1.15rem; }

.color-slots { display: flex; gap: 12px; justify-content: center; margin: 10px 0; }
.color-slot { width: 64px; height: 64px; border-radius: 50%; border: 4px solid #555; cursor: pointer; box-shadow: inset 0 -6px 10px rgba(0, 0, 0, .4), 0 4px 10px rgba(0, 0, 0, .5); color: #fff; font-weight: 800; }

.arrow-seq, .order-seq, .piano-seq, .dial-seq { font-size: 1.5rem; min-height: 2em; margin: 10px 0; font-family: var(--mono); color: var(--accent); }
.order-seq { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; font-size: 1rem; }
.order-seq span { background: #232a38; padding: 4px 10px; border-radius: 6px; }
.arrow-pad { display: inline-grid; grid-template-columns: repeat(3, 64px); gap: 8px; }
.arrow-pad button { height: 64px; font-size: 1.8rem; border-radius: 12px; border: 1px solid var(--line); background: #232a38; color: #fff; cursor: pointer; }
.arrow-pad button.clr { font-size: 1.2rem; background: #2a1d1d; }
.switch-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.switch { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; color: var(--text); cursor: pointer; }
.switch-knob { width: 40px; height: 72px; border-radius: 10px; background: #1a1d24; border: 2px solid #444; position: relative; }
.switch-knob::after { content: ''; position: absolute; left: 4px; right: 4px; height: 30px; bottom: 4px; border-radius: 6px; background: linear-gradient(180deg, #aaa, #666); transition: all .2s; }
.switch.on .switch-knob::after { bottom: 34px; background: linear-gradient(180deg, #ffd56a, #c98a1a); box-shadow: 0 0 10px #fc6; }
.switch-label { font-family: var(--mono); font-size: .85rem; }
.order-items { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.order-item { min-width: 70px; padding: 12px 14px; font-size: 1.3rem; border-radius: 12px; border: 1px solid var(--line); background: #232a38; color: var(--text); cursor: pointer; }
.order-item:hover { border-color: var(--accent); }

.dial-lock { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dial-wrap { position: relative; width: 290px; height: 290px; }
.dial-marker { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border: 10px solid transparent; border-top: 16px solid var(--red); z-index: 3; }
.dial-knob { position: absolute; inset: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #6d737c, #2b2f36 60%, #15171b); box-shadow: 0 10px 30px rgba(0, 0, 0, .7), inset 0 2px 4px rgba(255, 255, 255, .25); cursor: grab; touch-action: none; }
.dial-face { position: absolute; inset: 0; transition: transform .08s; }
.dial-num { position: absolute; left: 50%; top: 50%; margin: -10px 0 0 -12px; width: 24px; text-align: center; font-family: var(--mono); font-weight: 700; color: #eee; }
.dial-tick { position: absolute; left: 50%; top: 4px; width: 2px; height: 8px; margin-left: -1px; background: #aaa; transform-origin: 1px 131px; }
.dial-tick.big { height: 14px; background: #fff; }
.dial-knob::after { content: ''; position: absolute; inset: 34%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #9aa0a8, #3b3f46); box-shadow: 0 4px 10px rgba(0, 0, 0, .6); }
.dial-read { font-family: var(--mono); font-size: 2rem; color: var(--accent); }
.dial-btns { display: flex; gap: 8px; }

.wires { position: relative; display: flex; justify-content: space-between; gap: 140px; padding: 10px; background: #1a1d24; border-radius: 12px; border: 1px solid #333; }
.wires-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wires-col { display: flex; flex-direction: column; gap: 12px; z-index: 1; }
.wire-end { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; border: 2px solid #555; background: #262a33; color: #fff; cursor: pointer; font-family: var(--mono); min-width: 80px; }
.wire-end i { width: 14px; height: 14px; border-radius: 50%; }
.wire-end.sel { box-shadow: 0 0 0 3px var(--accent); }

.piano-keys { display: flex; justify-content: center; }
.piano-key { width: 52px; height: 170px; background: linear-gradient(180deg, #fff, #e8e8e8); border: 1px solid #333; border-radius: 0 0 8px 8px; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; color: #555; font-weight: 700; box-shadow: inset 0 -6px 0 #ccc; }
.piano-key:active { background: #ddd; box-shadow: inset 0 -2px 0 #bbb; }

/* ===== Ansichten ===== */
.view { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.view-title { align-self: flex-start; }
.view-caption { color: var(--muted); font-size: .95rem; text-align: center; max-width: 720px; }
.view-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.view-html { max-width: 680px; }

.stage { position: relative; width: min(1100px, 88vw); max-height: 76vh; overflow: hidden; border-radius: 10px; container-type: inline-size; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.stage > img { position: absolute; max-width: none; user-select: none; }

.paper { position: relative; background: #f4ecd8; color: #2b2216; padding: 34px 38px; border-radius: 3px; max-width: 600px; font-family: var(--serif); font-size: 1.08rem; line-height: 1.6; box-shadow: 0 1px 1px rgba(0, 0, 0, .15), 0 10px 30px rgba(0, 0, 0, .55); background-image: radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, .5), transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(150, 110, 50, .18), transparent 60%); }
.paper-title { font-weight: 700; font-size: 1.25rem; margin-bottom: 10px; }
.paper-body p { margin: 0 0 .8em; }
.paper-hand { font-family: var(--hand); font-size: 1.15rem; }
.paper-postit { background: #fdf38a; font-family: var(--hand); font-size: 1.3rem; width: 280px; min-height: 240px; box-shadow: 0 14px 20px -8px rgba(0, 0, 0, .6); background-image: none; }
.paper-typewriter { font-family: var(--type); font-size: 1rem; background-color: #f7f3ea; }
.paper-letter { font-family: var(--hand); font-size: 1.15rem; background-color: #f6efe0; background-image: repeating-linear-gradient(transparent, transparent 31px, rgba(80, 110, 170, .25) 32px); line-height: 32px; }
.paper-newspaper { font-family: var(--serif); background: #e9e3d3; columns: 2; column-gap: 26px; max-width: 760px; text-align: justify; font-size: .98rem; }
.paper-newspaper .paper-title { column-span: all; font-size: 2rem; border-bottom: 3px double #333; text-align: center; font-family: 'Times New Roman', serif; letter-spacing: .02em; }
.paper-parchment { background: linear-gradient(135deg, #e8d3a0, #d4b77c); font-family: var(--serif); font-style: italic; border-radius: 6px; }
.paper-card { background: #fff; font-family: var(--sans); border-radius: 10px; }
.paper-dark { background: #1b1f27; color: #ddd; font-family: var(--sans); background-image: none; }
.paper-screen { background: #031014; color: #7ef3ff; font-family: var(--mono); border: 1px solid #0b6b80; border-radius: 10px; box-shadow: 0 0 30px rgba(0, 200, 255, .25), inset 0 0 40px rgba(0, 200, 255, .08); background-image: repeating-linear-gradient(0deg, rgba(0, 255, 255, .03) 0 2px, transparent 2px 4px); }
.paper-blueprint { background: #12407a; color: #e6f0ff; font-family: var(--mono); background-image: linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 20px 20px; }
.paper-photo { background: #fff; padding: 14px 14px 46px; font-family: var(--hand); text-align: center; }
.paper-ticket { background: #f1e7c9; border: 2px dashed #8a7550; font-family: var(--mono); }
.paper-file { background: #e7d6a8; border-top: 26px solid #c9b37a; font-family: var(--type); }
.paper-medical { background: #f2f2ee; font-family: var(--type); border-left: 6px solid #8a2b2b; }
.paper-papyrus { background: linear-gradient(90deg, #d9c38a, #e8d6a2, #d2ba7e); background-size: 18px 100%; font-family: var(--serif); color: #3a2a10; }
.paper table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.paper td, .paper th { border: 1px solid rgba(0, 0, 0, .25); padding: 4px 8px; }
.big-sym { font-size: 2.2rem; letter-spacing: .3em; }

.split { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.split-info { background: rgba(63, 182, 168, .12); border: 1px solid rgba(63, 182, 168, .45); padding: 10px 14px; border-radius: 10px; color: #bfeee8; max-width: 640px; text-align: center; }
.split-grid { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.split-grid .paper { max-width: 320px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; width: min(800px, 86vw); }
.gallery-item { background: #1c2230; border: 1px solid var(--line); border-radius: 12px; padding: 16px 8px; color: var(--text); cursor: pointer; }
.gallery-item:hover { border-color: var(--accent); }
.gallery-icon { font-size: 2.4rem; }
.gallery-label { font-size: .85rem; margin-top: 6px; }

.map-view { width: min(1000px, 88vw); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.map-view iframe { width: 100%; height: 62vh; border: 0; border-radius: 12px; background: #222; }
.map-consent { width: 100%; height: 62vh; border-radius: 12px; background: repeating-linear-gradient(45deg, #1a2030, #1a2030 14px, #171c28 14px, #171c28 28px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; }
.map-consent p { max-width: 460px; color: #cfd6e2; }

.audio-view { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 340px; }
.audio-text { max-width: 560px; text-align: center; color: #d8d3c8; }
.morse-lamp { width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, #553, #221); border: 4px solid #444; transition: all .05s; }
.morse-lamp.on { background: radial-gradient(circle, #fff7c2, #ffc400); box-shadow: 0 0 60px #ffc400; }
.tape { width: 240px; height: 110px; background: linear-gradient(180deg, #2b2b2b, #111); border-radius: 12px; display: flex; justify-content: space-around; align-items: center; border: 3px solid #444; }
.tape-reel { width: 60px; height: 60px; border-radius: 50%; border: 8px solid #ddd; background: repeating-conic-gradient(#555 0 30deg, #999 30deg 60deg); animation: reel 3s linear infinite; }
@keyframes reel { to { transform: rotate(360deg); } }
.transcript { max-width: 520px; color: var(--muted); font-size: .9rem; }

.uv-view { position: relative; width: min(640px, 86vw); min-height: 360px; background: #e9e1cc; color: #2b2216; padding: 34px; border-radius: 4px; font-family: var(--serif); cursor: none; overflow: hidden; --mx: -500px; --my: -500px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.uv-view::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle 90px at var(--mx) var(--my), rgba(110, 40, 255, .35), rgba(0, 0, 0, .55) 100px); }
.uv-hidden { position: absolute; inset: 0; padding: 34px; color: #b8ff4d; text-shadow: 0 0 6px #7f3, 0 0 14px #7f3; font-family: var(--hand); font-size: 1.6rem; -webkit-mask: radial-gradient(circle 90px at var(--mx) var(--my), #000 60%, transparent 100%); mask: radial-gradient(circle 90px at var(--mx) var(--my), #000 60%, transparent 100%); z-index: 2; pointer-events: none; }
.uv-hint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: .8rem; color: #fff; z-index: 3; opacity: .8; font-family: var(--sans); }

.mirror-view { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mirror-text { background: #f4ecd8; color: #2b2216; padding: 30px 40px; font-family: var(--hand); font-size: 1.5rem; transform: scaleX(-1); transition: transform .6s; border-radius: 4px; }
.mirror-text.flipped { transform: scaleX(1); }

/* Mail */
.mail-client { width: min(1000px, 88vw); height: 68vh; background: #fff; color: #222; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; font-family: var(--sans); }
.mail-top { display: flex; justify-content: space-between; padding: 10px 16px; background: #1a5fb4; color: #fff; }
.mail-top .muted { color: #d0e2ff; }
.mail-brand { padding: 14px; font-weight: 800; color: #1a5fb4; font-size: 1.3rem; text-align: center; }
.mail-main { flex: 1; display: grid; grid-template-columns: 300px 1fr; min-height: 0; }
@media (max-width: 700px) { .mail-main { grid-template-columns: 1fr; } .mail-list { max-height: 30vh; } }
.mail-list { border-right: 1px solid #ddd; overflow-y: auto; background: #f6f7f9; }
.mail-item { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #e3e3e3; background: transparent; padding: 10px 14px; cursor: pointer; font: inherit; color: #222; }
.mail-item.active { background: #dbe8fb; }
.mail-item.unread .mail-subj { font-weight: 800; }
.mail-from { font-weight: 600; font-size: .9rem; }
.mail-subj { font-size: .9rem; }
.mail-date { font-size: .75rem; color: #888; }
.mail-read { padding: 20px 26px; overflow-y: auto; }
.mail-head { border-bottom: 1px solid #ddd; padding-bottom: 10px; margin-bottom: 14px; font-size: .9rem; }
.mail-head h4 { font-size: 1.25rem; margin: 0 0 6px; font-family: var(--sans); }
.mail-body { font-size: .98rem; line-height: 1.6; }
.mail-att { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.att { border: 1px solid #ccc; background: #f3f3f3; border-radius: 8px; padding: 8px 12px; cursor: pointer; font: inherit; }
.login-screen { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px; max-width: 360px; margin: auto; text-align: center; }
.login-avatar { width: 84px; height: 84px; border-radius: 50%; background: linear-gradient(135deg, #5a7bd6, #2d3f8a); color: #fff; font-size: 2.2rem; display: grid; place-items: center; font-weight: 700; }
.login-title { font-size: 1.3rem; font-weight: 700; }
.login-user { color: #777; }
.login-hint { font-size: .85rem; color: #888; font-style: italic; }
.mail-client .text-answer, .laptop .text-answer { background: #fff; color: #222; border-color: #bbb; }

/* Smartphone */
.phone { position: relative; width: 330px; height: 660px; background: #111; border-radius: 46px; padding: 14px; box-shadow: 0 0 0 2px #333, 0 30px 70px rgba(0, 0, 0, .8), inset 0 0 0 2px #444; }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 110px; height: 26px; background: #111; border-radius: 0 0 16px 16px; z-index: 3; }
.phone-screen { width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: #f2f2f7; color: #111; display: flex; flex-direction: column; font-family: var(--sans); }
.phone-bar { display: flex; justify-content: space-between; padding: 8px 22px 4px; font-size: .78rem; font-weight: 700; }
.phone-lock, .phone-home { flex: 1; background: linear-gradient(160deg, #24344d, #0b1220); background-size: cover; background-position: center; color: #fff; display: flex; flex-direction: column; align-items: center; padding: 20px; }
.phone-time { font-size: 4rem; font-weight: 300; line-height: 1; margin-top: 30px; }
.phone-date { opacity: .8; margin-bottom: 20px; }
.phone-notice { background: rgba(255, 255, 255, .18); backdrop-filter: blur(8px); border-radius: 14px; padding: 10px 14px; font-size: .85rem; width: 100%; margin-bottom: 14px; }
.pin-msg { font-size: .9rem; margin-bottom: 10px; }
.pin-dots { display: flex; gap: 14px; margin-bottom: 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; }
.pin-dots i.f { background: #fff; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 70px); gap: 14px; }
.pin-pad button { width: 70px; height: 70px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .18); color: #fff; font-size: 1.6rem; cursor: pointer; }
.phone-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 10px; width: 100%; margin-top: 30px; }
.phone-app { background: none; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .75rem; cursor: pointer; }
.app-ico { width: 58px; height: 58px; border-radius: 14px; background: rgba(255, 255, 255, .92); display: grid; place-items: center; font-size: 1.8rem; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.phone-head { display: grid; grid-template-columns: 50px 1fr 50px; align-items: center; padding: 8px; border-bottom: 1px solid #ddd; background: #f8f8f8; text-align: center; }
.phone-back { background: none; border: 0; font-size: 1.8rem; color: #0a84ff; cursor: pointer; }
.phone-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.phone-row { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 4px; background: #fff; border: 0; border-radius: 12px; padding: 10px 12px; font: inherit; color: #111; cursor: pointer; }
.phone-row .muted { color: #888; font-size: .8rem; }
.phone-body.chat { background: #fff; }
.bubble { max-width: 78%; padding: 8px 12px; border-radius: 18px; font-size: .9rem; }
.bubble small { display: block; font-size: .65rem; opacity: .6; margin-top: 2px; }
.bubble.them { background: #e9e9eb; align-self: flex-start; }
.bubble.me { background: #0a84ff; color: #fff; align-self: flex-end; }
.phone-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.phone-photo { border: 0; padding: 0; background: #ddd; cursor: pointer; border-radius: 6px; overflow: hidden; }
.phone-photo img { display: block; aspect-ratio: 1; object-fit: cover; width: 100%; }
.phone-photo small { display: block; font-size: .7rem; padding: 3px; }
.ph-html { aspect-ratio: 1; display: grid; place-items: center; font-size: 1.1rem; padding: 6px; }
.phone-note { background: #fffbe0; border-radius: 10px; padding: 10px 12px; font-size: .9rem; }

/* Laptop */
.laptop { width: min(980px, 88vw); }
.laptop-screen { position: relative; aspect-ratio: 16/10; background: linear-gradient(135deg, #1f3c66, #0e1a2c); background-size: cover; background-position: center; border: 16px solid #1b1b1d; border-radius: 16px 16px 0 0; display: flex; flex-direction: column; overflow: hidden; color: #fff; }
.laptop-base { height: 18px; background: linear-gradient(180deg, #c8c8cc, #8a8a90); border-radius: 0 0 14px 14px; margin: 0 -3%; }
.laptop .login-screen { color: #fff; }
.laptop .login-user, .laptop .login-hint { color: #cfd8e6; }
.desk-icons { display: grid; grid-template-columns: repeat(auto-fill, 96px); gap: 12px; padding: 18px; align-content: start; flex: 1; }
.desk-icon { background: none; border: 1px solid transparent; border-radius: 8px; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; cursor: pointer; font-size: .8rem; text-shadow: 0 1px 3px #000; }
.desk-icon:hover, .desk-icon:focus { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); }
.desk-ico { font-size: 2.3rem; }
.taskbar.lt, .laptop .taskbar { display: flex; justify-content: space-between; padding: 6px 14px; background: rgba(10, 14, 22, .85); font-size: .8rem; min-height: auto; border: 0; }
.desk-hint { position: absolute; bottom: 40px; right: 16px; font-size: .75rem; opacity: .6; }

/* Terminal */
.terminal { width: min(900px, 88vw); height: 60vh; background: #020a06; border: 1px solid #1d5a33; border-radius: 10px; padding: 14px; font-family: var(--mono); color: #6dff9b; display: flex; flex-direction: column; box-shadow: 0 0 40px rgba(60, 255, 130, .15), inset 0 0 60px rgba(0, 0, 0, .8); text-shadow: 0 0 4px rgba(80, 255, 140, .6); }
.term-out { flex: 1; overflow-y: auto; font-size: .95rem; }
.term-line { white-space: pre-wrap; margin-bottom: 3px; }
.term-line.dim { opacity: .6; }
.term-line.cmd { color: #b6ffcb; }
.term-line.ok { color: #fff; background: #1c6b3a; display: inline-block; padding: 0 6px; }
.term-line.err { color: #ff6b6b; }
.term-prompt { display: flex; gap: 6px; align-items: center; }
.term-in { background: transparent; border: 0; color: #b6ffcb; font-family: var(--mono); padding: 4px 0; box-shadow: none !important; }

/* Chiffrierscheibe */
.cipherwheel { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cw-disc { position: relative; width: 310px; height: 310px; border-radius: 50%; background: radial-gradient(circle, #e9d7aa 0 46%, #c8a865 46% 100%); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.cw-ring { position: absolute; inset: 0; transition: transform .2s; }
.cw-ring span { position: absolute; left: 50%; top: 50%; width: 20px; margin: -11px 0 0 -10px; text-align: center; font-family: var(--serif); font-weight: 700; color: #3a2a10; }
.cw-ring.inner span { color: #7a1a1a; }
.cw-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 2rem; color: #7a5a20; }
.cw-label { font-family: var(--mono); }

/* Mini-Spiele */
.puzzle { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.puzzle-intro { max-width: 560px; text-align: center; color: #d8d3c8; }
.slider-grid { display: grid; gap: 3px; width: min(480px, 80vw); aspect-ratio: 16/9; background: #000; padding: 3px; border-radius: 8px; }
.puzzle-rotate .slider-grid { aspect-ratio: 1; }
.slider-tile { border: 0; background-color: #333; cursor: pointer; transition: transform .15s; font-size: 1.6rem; font-weight: 800; color: #fff; }
.slider-tile.empty { background: #0b0b0b !important; cursor: default; }
.lights-grid { display: grid; gap: 8px; }
.light { width: 64px; height: 64px; border-radius: 12px; border: 2px solid #333; background: #1a1d24; cursor: pointer; transition: all .15s; }
.light.on { background: radial-gradient(circle, #fff6b0, #f3a712); box-shadow: 0 0 20px #f3a712; }
.simon { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 260px; height: 260px; }
.simon-pad { border: 0; border-radius: 20px; opacity: .45; cursor: pointer; transition: opacity .1s; }
.simon-pad.lit { opacity: 1; box-shadow: 0 0 30px currentColor; }
.memory-grid { display: grid; grid-template-columns: repeat(4, 76px); gap: 10px; }
.mem-card { height: 92px; border-radius: 10px; border: 0; cursor: pointer; background: linear-gradient(135deg, #3b4560, #222838); font-size: 2rem; color: transparent; }
.mem-card.up { background: #f4ecd8; color: #2b2216; }
.mem-card.found { background: #d6f5e1; }
.puzzle-reward { text-align: center; }
.reward-badge { color: var(--green); font-weight: 800; font-size: 1.2rem; margin-bottom: 10px; }

/* Browser */
.browser { display: flex; flex-direction: column; width: 100%; height: 100%; background: #fff; }
.br-bar { display: flex; gap: 6px; align-items: center; padding: 8px 56px 8px 10px; background: #dfe3ea; border-bottom: 1px solid #c3c8d1; }
.br-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; font-size: 1.1rem; cursor: pointer; color: #333; }
.br-btn:hover:not(:disabled) { background: #c9ced8; }
.br-btn:disabled { opacity: .35; }
.br-addr-wrap { flex: 1; display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 99px; padding: 0 14px; border: 1px solid #c3c8d1; }
.br-addr { border: 0 !important; box-shadow: none !important; background: transparent; color: #222; padding: 7px 0; }
.br-lock { font-size: .8rem; }
.br-frame { flex: 1; border: 0; width: 100%; background: #fff; }

/* Video */
.video-win { position: fixed; right: 18px; bottom: 80px; width: 380px; height: 300px; z-index: 90; background: #000; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0, 0, 0, .7); resize: both; min-width: 240px; min-height: 160px; }
.video-win.min { height: 36px !important; resize: none; }
.video-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: #1b2130; cursor: move; font-size: .85rem; touch-action: none; }
.video-head button { background: none; border: 0; color: #fff; cursor: pointer; font-size: .95rem; padding: 2px 6px; }
.video-frame { flex: 1; }

/* Ende */
#screen-end { min-height: 100vh; padding: 40px 16px; }
.end { width: min(820px, 96vw); margin: 0 auto; background: rgba(23, 27, 36, .94); text-align: center; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.stats div { background: #0f1218; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stats b { display: block; font-family: var(--mono); font-size: 1.5rem; color: var(--accent); }
.stats span { font-size: .8rem; color: var(--muted); }
.certificate { display: none; }
@media print {
  body * { visibility: hidden; }
  .certificate, .certificate * { visibility: visible; }
  .certificate { display: block; position: fixed; inset: 0; background: #fff; color: #222; }
  .cert-inner { margin: 6% 8%; border: 10px double #b08a3a; padding: 50px; text-align: center; font-family: Georgia, serif; }
  .cert-brand { font-size: 18pt; color: #b08a3a; letter-spacing: .2em; text-transform: uppercase; }
  .cert-head { font-size: 48pt; margin: 20px 0; }
  .cert-team { font-size: 30pt; font-weight: bold; margin: 10px 0; }
  .cert-game { font-size: 22pt; font-style: italic; }
  .cert-players { color: #555; }
}
