/* kein blaues Aufblitzen beim Antippen (Android-Chrome markiert sonst die ganze Spielfläche) */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d1712; color: #f3ece4;
  font: 15px/1.3 system-ui, "Segoe UI", sans-serif; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
#cv { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; cursor: pointer; touch-action: none; }

/* Leiste oben, schwebt über dem 3D-Bild */
#bar { position: fixed; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: calc(8px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) 8px calc(10px + env(safe-area-inset-left));
  background: linear-gradient(#120d09cc, #120d0900); pointer-events: none; }
#bar > * { pointer-events: auto; }
.grow { flex: 1; }
.pill { display: flex; gap: 10px; align-items: baseline; padding: 7px 14px; border-radius: 999px;
  background: #2a2019d9; border: 1px solid #ffffff1f; box-shadow: 0 4px 14px #0006; backdrop-filter: blur(6px); }
.pill b { font-size: 16px; color: #ffd27a; }
.pill span { color: #d8cbbd; font-size: 13px; }
button { font: inherit; color: #f3ece4; background: linear-gradient(#4a3a2e, #34281f); border: 1px solid #ffffff26;
  border-radius: 999px; padding: 7px 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 3px 10px #0006, inset 0 1px 0 #ffffff22; transition: transform .08s, filter .15s; }
button:hover { filter: brightness(1.15); }
button:active { transform: translateY(1px) scale(.97); }
button:disabled { opacity: .4; cursor: default; filter: none; }
button i { font-style: normal; }
#b-hint { background: linear-gradient(#3f8a52, #2c6a3b); }
#b-new { background: linear-gradient(#c98a2e, #a0681c); }

#msg { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9); background: #2a2019ee;
  border: 1px solid #ffffff2a; border-radius: 16px; padding: 12px 20px; font-weight: 600; pointer-events: none; opacity: 0;
  transition: opacity .25s, transform .25s; text-align: center; max-width: 90vw; box-shadow: 0 10px 40px #000a; }
#msg.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#msg.bad { top: auto; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 0); background: #6a2f26ee; }
#msg.win { pointer-events: auto; font-size: 22px; padding: 20px 30px; background: linear-gradient(#3a2b20f2, #241a13f2);
  border-color: #ffd27a66; }
#msg .stars { font-size: 44px; color: #ffd27a; letter-spacing: 6px; text-shadow: 0 2px 10px #ffb30088; }
#msg .stars span { color: #5a4a3c; text-shadow: none; }
#msg small { display: block; font-size: 14px; font-weight: 400; color: #d8cbbd; margin: 4px 0 14px; }
#msg button { font-size: 17px; padding: 10px 22px; background: linear-gradient(#c98a2e, #a0681c); }

#settings { position: fixed; right: 10px; top: 60px; width: min(360px, calc(100vw - 20px)); background: #2a2019f4;
  border: 1px solid #ffffff26; border-radius: 14px; padding: 12px 16px; box-shadow: 0 10px 40px #000a; z-index: 5; }
#settings h3 { margin: 0 0 8px; color: #ffd27a; }
#settings label { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
#settings input[type=range] { flex: 1; accent-color: #ffb347; }
#settings label b { min-width: 1.5em; text-align: right; }
#settings .chk { align-items: flex-start; }
.small { font-size: 12px; color: #bfae9c; }
#moves.warn { color: #ff9b7a; font-weight: 700; }
#tw { letter-spacing: 2px; }
#msg .row, .card .row { display: flex; gap: 10px; justify-content: center; margin-top: 4px; }
#loading { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #2a2019ee; border: 1px solid #ffffff26; border-radius: 999px; padding: 8px 16px; z-index: 6; }

/* Menü, Erklärkarte, freies Spiel */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 4;
  background: radial-gradient(#1d1712aa, #0d0907ee); padding: 16px; overflow: auto; }
.overlay[hidden], [hidden] { display: none !important; }
.card { width: min(520px, 100%); background: linear-gradient(#3a2b20f4, #241a13f4); border: 1px solid #ffd27a44;
  border-radius: 18px; padding: 18px 18px 14px; box-shadow: 0 16px 50px #000c; margin: auto; }
.small-card { width: min(400px, 100%); text-align: center; }
.card h1 { margin: 0; font-size: 26px; color: #ffd27a; text-align: center; }
.card h2 { margin: 4px 0 8px; color: #ffd27a; }
.card .sub { text-align: center; color: #d8cbbd; margin: 6px 0 14px; }
.card label { display: flex; align-items: center; gap: 8px; margin: 10px 0; text-align: left; }
.card input[type=range] { flex: 1; accent-color: #ffb347; }
.card label b { min-width: 1.5em; text-align: right; }
.big-ic { font-size: 54px; line-height: 1.2; }
#modes { display: flex; flex-direction: column; gap: 8px; }
.mode { width: 100%; border-radius: 14px; padding: 10px 14px; justify-content: flex-start; gap: 12px; text-align: left; }
.mode .ic { font-size: 28px; }
.mode .tx { flex: 1; display: flex; flex-direction: column; }
.mode .tx b { font-size: 18px; }
.mode small { color: #d8cbbd; font-size: 13px; font-weight: 400; }
.mode .pr { display: flex; flex-direction: column; align-items: flex-end; color: #ffd27a; font-weight: 700; }
.mode.last { border-color: #ffd27a; box-shadow: 0 0 0 2px #ffd27a55, 0 3px 10px #0006; }
.mode.free { background: linear-gradient(#3a3f46, #2a2e33); }
.foot { display: flex; justify-content: center; margin-top: 12px; }
button.go { background: linear-gradient(#c98a2e, #a0681c); font-weight: 700; }
.promo { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 12px; font-size: 13px; }
.promo a { color: #d8cbbd; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.promo a:hover { color: #ffd27a; text-decoration: underline; }
.flag-at { display: inline-block; width: 18px; height: 12px; border-radius: 2px;
  background: linear-gradient(#ed2939 33.3%, #fff 33.3% 66.6%, #ed2939 66.6%); box-shadow: 0 0 0 1px #0004; }

/* schmale Handys hochkant: nur Symbole auf den Knöpfen */
@media (max-width: 520px) {
  #bar button span { display: none; }
  #bar button { padding: 8px 12px; font-size: 17px; }
  .pill { gap: 8px; padding: 6px 12px; }
}

/* leichte Randabdunkelung über dem 3D-Bild */
#vignette { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 48%, transparent 58%, rgba(12, 7, 3, 0.42) 100%); }
