/* Caesar: Scheibe und Handy-Ansicht, Beamer-Raster, Steuerung. Farben aus dem Rahmen (style.css). */

:root {
  --c-inner: #f4efe9;
  --c-mark: #ffd27a;
  --c-pick: #dcfce7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --c-inner: #24201b; --c-mark: #6b4a12; --c-pick: #12301d; }
}
:root[data-theme="dark"] { --c-inner: #24201b; --c-mark: #6b4a12; --c-pick: #12301d; }

/* ------------------------------------------------------- Scheibe */

.wheel-card { padding: 10px 12px 12px; }
.wheel-wrap { width: 100%; max-width: 400px; margin: 0 auto; }
.cwheel { display: block; width: 100%; height: auto; aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.cwheel:active { cursor: grabbing; }
.cwheel text { font-family: var(--mono); dominant-baseline: central; text-anchor: middle; }
.cwheel .ring { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.cwheel .disk { fill: var(--c-inner); stroke: var(--line); stroke-width: 2; }
.cwheel .hub { fill: var(--bg); stroke: var(--line); stroke-width: 2; }
.cwheel .lo { font-size: 20px; font-weight: 700; fill: var(--text); }
.cwheel .no { font-size: 9px; fill: var(--muted); font-family: var(--sans); }
.cwheel .li { font-size: 18px; font-weight: 700; fill: var(--accent); }
.cwheel .mark { fill: var(--c-mark); stroke: var(--accent); stroke-width: 2; }
.cwheel .pick { fill: var(--c-pick); stroke: var(--ok); stroke-width: 2; }
.cwheel .hub-n { font-size: 30px; font-weight: 800; fill: var(--accent); }
.cwheel .pointer { fill: var(--accent); }

.wheel-ctl { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 6px; }
.wheel-ctl .step {
  width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--surface-2); font-size: 28px; font-weight: 700; cursor: pointer; touch-action: manipulation; line-height: 1;
}
.wheel-ctl .step:active { transform: scale(.95); }
.wheel-ctl .readout { min-width: 90px; text-align: center; line-height: 1.1; }
.wheel-ctl .readout span { display: block; font-size: 13px; color: var(--muted); }
.wheel-ctl .readout b { font-family: var(--mono); font-size: 30px; color: var(--accent); }
.wheel-legend { text-align: center; font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.wheel-legend .k1 { color: var(--text); font-weight: 700; }
.wheel-legend .k2 { color: var(--accent); font-weight: 700; }

/* ------------------------------------------------- Handy: ein Buchstabe */

body.caesar .card h1 { font-size: 19px; }
body.caesar .card .sub:empty { display: none; }
.job { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 6px; }
.job-l span { display: block; font-size: 15px; font-weight: 600; }
.job-l small { display: block; color: var(--muted); font-size: 14px; }
.job-c {
  font-family: var(--mono); font-weight: 900; font-size: 64px; line-height: 1;
  width: 92px; height: 92px; display: flex; align-items: center; justify-content: center;
  color: var(--accent); background: var(--c-mark); border: 3px solid var(--accent); border-radius: 18px;
}
.job-c.fresh { animation: pop .35s ease-out; }
@keyframes pop { 0% { transform: scale(.6); opacity: .2; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.job-how { margin: 6px 0 4px; font-size: 15px; line-height: 1.4; }
.job-how .c { color: var(--accent); font-family: var(--mono); }
.job-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.job-foot .linkbtn { padding: 4px 0; font-size: 14px; white-space: nowrap; }
.plainline { font-family: var(--mono); font-weight: 800; color: var(--ok); font-size: 17px; letter-spacing: .06em; margin: 10px 0 0; overflow-wrap: anywhere; }

/* feste Leiste unten: Klartext und Senden */
body.has-dock .phone { padding-bottom: 104px; }
body.has-dock .foot { display: none; }
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 18px rgba(0, 0, 0, .08);
}
.dock-in { max-width: 528px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.dock-l { font-size: 13px; color: var(--muted); writing-mode: horizontal-tb; width: 3.6em; line-height: 1.2; }
.dock .answer {
  width: 64px; height: 64px; flex: none;
  font-family: var(--mono); font-size: 40px; font-weight: 900; text-align: center; text-transform: uppercase;
  border-radius: 14px; border: 3px solid var(--ok); background: var(--c-pick); color: var(--text); padding: 0;
}
.dock .answer::placeholder { color: var(--muted); opacity: .5; }
.dock .answer:focus { outline: none; box-shadow: 0 0 0 3px var(--ok-soft); }
.dock .send { flex: 1; min-height: 64px; font-size: 20px; }
.sent-flash {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 40;
  background: var(--ok); color: var(--bg); font-weight: 800; font-family: var(--mono); font-size: 20px;
  padding: 8px 18px; border-radius: 999px; animation: flash 1.2s ease-out forwards; pointer-events: none;
}
@keyframes flash { 0% { opacity: 0; transform: translate(-50%, 8px); } 15% { opacity: 1; transform: translate(-50%, 0); } 75% { opacity: 1; } 100% { opacity: 0; } }

/* Wort als antippbare Buchstaben (privat, Schlüsselsuche) */
.strip { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 8px 0 12px; }
.strip button {
  font-family: var(--mono); font-weight: 800; font-size: clamp(24px, 8vw, 44px); line-height: 1;
  min-width: 1.3em; height: 1.5em; border-radius: 10px; border: 2px solid var(--line);
  background: var(--surface-2); color: var(--accent); cursor: pointer; touch-action: manipulation; padding: 0 4px;
}
.strip button.on { background: var(--c-mark); border-color: var(--accent); }
.plainword {
  font-family: var(--mono); font-size: clamp(28px, 9vw, 44px); font-weight: 800; letter-spacing: .14em;
  text-align: center; color: var(--ok); margin: 0 0 8px;
}
.keyline {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px;
}
.keyline b { font-size: 22px; font-family: var(--mono); }
.keyline .btn { background: var(--surface); min-height: 42px; font-size: 15px; padding: 0 14px; border: 1px solid var(--line); }
.wordin {
  width: 100%;
  font-family: var(--mono); font-size: 30px; font-weight: 800; letter-spacing: .18em; text-align: center;
  text-transform: uppercase; border-radius: 12px; border: 2px solid var(--line);
  background: var(--surface); color: var(--text); padding: 10px; margin: 6px 0 12px;
}
.wordin:focus { outline: none; border-color: var(--accent); }

/* ----------------------------------------------------------- Beamer */

/* Wörter und Stellen */
.words {
  --w: 70px;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center;
  column-gap: calc(var(--w) * .55);
  row-gap: calc(var(--w) * .3);
  height: 100%;
}
.word { display: flex; gap: calc(var(--w) * .08); }
.cell { width: var(--w); display: flex; flex-direction: column; align-items: center; }
.rain {
  position: relative;
  width: 100%;
  height: calc(var(--w) * 1.45);
  overflow: hidden;
}
.alts {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column-reverse; align-items: center;
  gap: calc(var(--w) * .02);
}
.alt {
  font-family: var(--mono); font-weight: 700; line-height: 1;
  color: var(--muted);
  transition: font-size .4s ease, opacity .4s ease;
}
.drop {
  position: absolute; top: 0;
  font-family: var(--mono); font-weight: 800; font-size: calc(var(--w) * .42); line-height: 1;
  color: var(--accent);
  animation: fall 1.1s cubic-bezier(.45, 0, .8, .6) forwards;
  pointer-events: none;
}
@keyframes fall {
  0% { transform: translateY(calc(var(--w) * -.5)); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(var(--fall, 80px)); opacity: 0; }
}
.base {
  width: 100%;
  height: calc(var(--w) * 1.08);
  display: flex; align-items: flex-end; justify-content: center;
  border-bottom: max(3px, calc(var(--w) * .05)) solid #3a4150;
  position: relative;
}
.maj {
  font-family: var(--mono); font-weight: 900; line-height: .95;
  font-size: calc(var(--w) * 1);
  color: var(--text);
  transition: opacity .5s ease, color .5s ease;
}
.maj.empty { color: #2d3340; font-weight: 400; }
.cell.firm .base { border-bottom-color: var(--ok); }
.cell.ok .maj { color: var(--ok); }
.cell.ok .base { border-bottom-color: var(--ok); }
.cell.bad .maj { color: var(--accent); }
.cell.bad .base { border-bottom-color: var(--bad); }
.ciph {
  font-family: var(--mono); font-weight: 700;
  font-size: calc(var(--w) * .36);
  color: var(--accent);
  opacity: .8;
  margin-top: calc(var(--w) * .08);
  line-height: 1.1;
}
.conf { width: 84%; margin-top: calc(var(--w) * .07); display: flex; flex-direction: column; align-items: center; gap: calc(var(--w) * .03); }
.bar { width: 100%; height: max(4px, calc(var(--w) * .07)); background: #232835; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--muted); border-radius: 99px; transition: width .5s ease, background .5s ease; }
.conf .cn { white-space: nowrap; font-size: calc(var(--w) * .2); color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1; }

/* Histogramm */
.hist { height: 100%; display: flex; flex-direction: column; background: var(--surface); border-radius: 1.4vh; padding: 1.4vh 1.4vw 1vh; }
.hist-title { font-size: 2vh; color: var(--muted); margin-bottom: .8vh; display: flex; justify-content: space-between; }
.hist-title b { color: var(--text); }
.hist-bars { flex: 1; display: grid; grid-template-columns: repeat(26, 1fr); gap: .45vw; align-items: end; min-height: 0; }
.hb { display: flex; flex-direction: column; align-items: center; height: 100%; min-height: 0; }
.hb .v { font-size: 1.6vh; color: var(--muted); font-variant-numeric: tabular-nums; height: 2.2vh; line-height: 2.2vh; }
.hb .track { flex: 1; width: 100%; position: relative; min-height: 0; }
.hb .b { position: absolute; left: 0; right: 0; bottom: 0; background: #3a4150; border-radius: .5vh .5vh 0 0; min-height: 2px; transition: height .4s ease; }
.hb .l { font-family: var(--mono); font-size: 2.1vh; font-weight: 700; margin-top: .4vh; color: var(--muted); }
.hb.hmax .b { background: var(--accent); }
.hb.hmax .l, .hb.hmax .v { color: var(--accent); }

/* Privat */
.priv { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh; text-align: center; }
.priv .round { font-size: 2.6vh; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.priv .cw { font-family: var(--mono); font-weight: 900; font-size: 20vh; line-height: 1; letter-spacing: .12em; color: var(--accent); }
.priv .pw { font-family: var(--mono); font-weight: 900; font-size: 13vh; line-height: 1; letter-spacing: .12em; color: var(--ok); }
.priv .note { font-size: 2.6vh; color: var(--muted); max-width: 60vw; }
.priv .hist-line { font-family: var(--mono); font-size: 5vh; font-weight: 800; letter-spacing: .1em; color: var(--ok); }
.priv .hist-line .pending { color: #3a4150; }
.counter { font-size: 3vh; color: var(--muted); }
.counter b { font-size: 8vh; color: var(--text); display: block; line-height: 1; font-variant-numeric: tabular-nums; }

/* Schlüsselsuche */
.keys-head { text-align: center; margin-bottom: 1.6vh; }
.keys-head .cw { font-family: var(--mono); font-weight: 900; font-size: 7vh; letter-spacing: .14em; color: var(--accent); line-height: 1; }
.keys-head .note { color: var(--muted); font-size: 2vh; margin-top: .6vh; }
.keygrid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(13, 1fr); gap: .5vh 2vw; flex: 1; min-height: 0; }
.keys { display: flex; flex-direction: column; height: 100%; }
.krow { display: grid; grid-template-columns: 3.4vw 1fr 8.5vw; align-items: center; gap: 1vw; background: var(--surface); border-radius: .9vh; padding: 0 1vw; min-height: 0; transition: background .5s ease, box-shadow .5s ease; }
.krow .k { font-family: var(--mono); font-size: 2.4vh; color: var(--muted); white-space: nowrap; text-align: right; }
.krow .w { font-family: var(--mono); font-size: 3.1vh; font-weight: 800; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.krow .w.empty { color: #3a4150; }
.krow .n { font-size: 1.8vh; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.krow.lit { background: #183626; box-shadow: inset 0 0 0 2px var(--ok); }
.krow.lit .w { color: var(--ok); }
.krow.answer { background: #183626; box-shadow: inset 0 0 0 3px var(--ok); }


/* wer gerade an einer Stelle arbeitet: ein Punkt je Handy */
.dots {
  height: calc(var(--w) * .28); margin-top: calc(var(--w) * .06);
  display: flex; align-items: center; justify-content: center; gap: calc(var(--w) * .04);
}
.dots i {
  width: calc(var(--w) * .16); height: calc(var(--w) * .16); border-radius: 50%;
  background: var(--accent); animation: breathe 1.6s ease-in-out infinite;
}
.dots b { font-size: calc(var(--w) * .22); color: var(--accent); font-weight: 800; line-height: 1; }
@keyframes breathe { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.05); } }
.cell.punct .base { border-bottom-color: transparent; }

/* ------------------------------------------------------- Steuerung */

.mini { display: flex; flex-wrap: wrap; gap: 4px; font-family: var(--mono); }
.mini .m { width: 42px; text-align: center; border-radius: 6px; background: var(--surface-2); padding: 3px 0; line-height: 1.15; }
.mini .m b { display: block; font-size: 17px; }
.mini .m small { display: block; font-size: 10px; color: var(--muted); }
.mini .gap { width: 12px; }
