:root {
  --cw: 80px;            /* Kartenbreite, setzt main.js passend zum Bildschirm */
  --ch: calc(var(--cw) * 1.55);
  --ink: #f6ead2; --muted: #d8c4a0; --gold: #f2c230; --red: #b51f2a;
  --wood1: #6b3f22; --wood2: #5a331b; --wood3: #7a4a29;
  --panel: rgba(38, 22, 12, 0.94);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2a1a10; color: var(--ink); }
body { user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--gold); }
[hidden] { display: none !important; }

/* Holztisch */
.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255, 210, 140, 0.18), rgba(0, 0, 0, 0.55) 85%),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.0) 0 2px, rgba(0,0,0,0.05) 2px 3px, rgba(0,0,0,0) 3px 11px),
    repeating-linear-gradient(0deg, var(--wood1) 0 calc(14vh - 2px), #3a2112 calc(14vh - 2px) 14vh),
    var(--wood2);
}
#menu, #pick { justify-content: center; overflow-y: auto; }

/* ---------- Menü ---------- */
.menubox { width: min(440px, calc(100vw - 32px)); margin: auto; padding: 22px 20px 16px; text-align: center;
  background: var(--panel); border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); border: 1px solid rgba(242, 194, 48, 0.25); }
.menubox.wide { width: min(760px, calc(100vw - 32px)); }
.menulogo { display: flex; justify-content: center; gap: 4px; height: 74px; margin-bottom: 4px; }
.menulogo .card { --cw: 46px; transform: rotate(var(--r)) translateY(var(--y)); }
h1 { margin: 6px 0 2px; font: 800 38px/1.1 Georgia, "Times New Roman", serif; color: var(--gold); letter-spacing: 1px; text-shadow: 0 2px 0 #000; }
h2 { margin: 0 0 12px; font: 700 21px/1.2 Georgia, serif; color: var(--gold); }
.tagline { margin: 0 0 8px; color: var(--muted); }
.what { margin: 0 0 14px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.btn, .btn2 { border: 0; border-radius: 12px; padding: 10px 16px; }
.btn { display: block; width: 100%; margin: 8px 0; background: linear-gradient(#e9b52a, #c98d12); color: #2a1a10; font-weight: 800; font-size: 17px; box-shadow: 0 3px 0 #7a5306; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #7a5306; }
.btn.big { font-size: 20px; padding: 13px; }
.btn2 { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); }
.btn2:hover { background: rgba(255,255,255,0.18); }
.btn2.danger { background: rgba(181, 31, 42, 0.35); }
.menurow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; }
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.seg button { border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.06); border-radius: 9px; padding: 6px 11px; font-size: 14px; }
.seg button.on { background: var(--gold); color: #2a1a10; font-weight: 700; border-color: var(--gold); }
.seg.col { flex-direction: column; align-items: stretch; }
.kofi { display: block; margin: 14px 0 8px; padding: 9px; border-radius: 12px; background: #29abe0; color: #fff; font-weight: 700; text-decoration: none; font-size: 14px; }
.promo { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; }
.promo a { text-decoration: none; }
.ver { margin-top: 10px; font-size: 11px; color: rgba(255,255,255,0.35); }
.flag-at { display: inline-block; width: 18px; height: 12px; vertical-align: -1px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
  background: linear-gradient(#c8102e 0 33.3%, #fff 33.3% 66.6%, #c8102e 66.6%); }   /* Österreich-Fahne (Emoji zeigt Windows nur als „AT“) */

/* Gegnerwahl */
.opps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.opp { text-align: left; padding: 12px; border-radius: 14px; border: 1px solid rgba(242,194,48,0.3); background: rgba(255,255,255,0.06); display: grid; grid-template-columns: 52px 1fr; gap: 4px 10px; }
.opp:hover { background: rgba(242,194,48,0.14); }
.opp .face { grid-row: span 3; font-size: 42px; line-height: 52px; text-align: center; }
.opp b { font-size: 17px; color: var(--gold); }
.opp .lvl { font-size: 12px; color: var(--muted); }
.opp .desc { grid-column: 1 / -1; font-size: 13px; line-height: 1.4; }
.opp .rec { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

/* ---------- Karten ---------- */
.card { position: relative; flex: none; width: var(--cw); height: calc(var(--cw) * 1.55); border-radius: calc(var(--cw) * 0.09);
  box-shadow: 0 2px 6px rgba(0,0,0,0.45); background: #fbf6e9; transition: transform 0.18s, filter 0.18s, margin 0.18s; }
.card svg { display: block; width: 100%; height: 100%; }
.card.back { background:
  repeating-linear-gradient(45deg, rgba(242,194,48,0.35) 0 2px, transparent 2px 9px),
  repeating-linear-gradient(-45deg, rgba(242,194,48,0.35) 0 2px, transparent 2px 9px), #7d1d24;
  border: calc(var(--cw) * 0.06) solid #fbf6e9; }
.card.back::after { content: ""; position: absolute; inset: 28% 18%; border-radius: 50%; border: 2px solid rgba(242,194,48,0.7); background: rgba(125, 29, 36, 0.9); }

/* ---------- Tisch ---------- */
#table { justify-content: space-between; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.topbar { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(0,0,0,0.35); font-size: 20px; flex: none; }
.oppinfo { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.oppinfo .face { font-size: 28px; }
.oppname { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oppstat { font-size: 12px; color: var(--muted); white-space: nowrap; }
.deckel { flex: none; width: 92px; height: 50px; border-radius: 50%; background: radial-gradient(#fffaf0 55%, #f1e3c4); border: 3px solid var(--red);
  color: #3a2a1a; display: flex; align-items: center; justify-content: space-around; font-size: 11px; line-height: 1.1; box-shadow: 0 2px 6px rgba(0,0,0,0.4); transform: rotate(-4deg); }
.deckel div { text-align: center; }
.deckel b { display: block; font: 800 18px Georgia, serif; color: var(--red); }

.bubble { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); z-index: 20; padding: 7px 14px; border-radius: 14px;
  background: #fffaf0; color: #3a2a1a; font-weight: 700; box-shadow: 0 3px 10px rgba(0,0,0,0.4); white-space: nowrap; animation: pop 0.25s; }
.bubble.me { top: auto; bottom: calc(var(--ch) + 40px); background: var(--gold); }
@keyframes pop { from { transform: translateX(-50%) scale(0.6); opacity: 0; } }

.opphand { display: flex; justify-content: center; min-height: calc(var(--ch) * 0.42); }
.opphand .card { --cw: calc(var(--cwBase) * 0.5); margin: 0 calc(var(--cw) * -0.18); transform: rotate(var(--r)); }

.mid { flex: 1; width: 100%; max-width: 900px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 8px; min-height: 0; }
.talon { position: relative; justify-self: start; width: calc(var(--cw) * 1.95); height: var(--ch); }
/* Atout liegt quer unter dem Stapel und schaut zur Hälfte heraus */
.talon .trumpcard { position: absolute; left: calc(var(--cw) * 0.62); top: 0; transform: rotate(90deg); }
.talon .stack { position: absolute; left: 0; top: 0; z-index: 1; }
.talon .stack .card { position: absolute; }
.talon .count { position: absolute; left: 0; bottom: -18px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.talon .trumpbadge { position: absolute; right: -6px; top: -12px; background: rgba(0,0,0,0.55); border-radius: 10px; padding: 2px 7px; font-size: 11px; display: flex; gap: 4px; align-items: center; }
/* Stich: eigene Kartengröße --tw (im Hochformat größer als die Hand); Bewegungen macht main.js (FLIP) */
.trick { --cw: var(--tw); position: relative; width: calc(var(--cw) * 1.9); height: calc(var(--cw) * 1.55 * 1.12); }
.trick .card { position: absolute; }
.trick .card.p1 { left: 0; top: 0; transform: rotate(-8deg); }
.trick .card.p0 { right: 0; bottom: 0; transform: rotate(7deg); }
.trick .card.peek { filter: sepia(0.5) brightness(0.8); }
.peeklabel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; background: rgba(0,0,0,0.7); padding: 4px 10px; border-radius: 10px; font-size: 13px; white-space: nowrap; }
.side { justify-self: end; text-align: right; font-size: 13px; color: var(--muted); line-height: 1.5; }
.lastbtn { margin-top: 6px; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.3); border-radius: 9px; padding: 4px 8px; font-size: 12px; color: var(--muted); }
.hint { position: absolute; left: 50%; bottom: calc(var(--ch) + 92px); transform: translateX(-50%); z-index: 30; width: min(440px, calc(100vw - 32px));
  padding: 9px 13px; border-radius: 12px; background: rgba(20, 12, 6, 0.93); border: 1px solid var(--gold); font-size: 14px; line-height: 1.4; text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5); animation: hintin 0.25s; pointer-events: none; }
@keyframes hintin { from { opacity: 0; translate: 0 10px; } }
.side b { color: var(--ink); font-size: 16px; white-space: nowrap; }
.side .pend { color: var(--gold); font-size: 12px; }

.status { min-height: 20px; font-size: 14px; color: var(--muted); text-align: center; padding: 0 8px; }
.status.turn { color: var(--gold); font-weight: 700; }
.actions { display: flex; gap: 8px; justify-content: center; min-height: 0; }
.actions button { border: 0; border-radius: 11px; padding: 7px 12px; background: rgba(0,0,0,0.5); border: 1px solid var(--gold); color: var(--gold); font-weight: 700; font-size: 14px; }
.actions button.armed { background: var(--gold); color: #2a1a10; }
.hand { display: flex; justify-content: center; align-items: flex-end; padding: 16px 0 0; min-height: calc(var(--ch) + 16px); }
.hand .card { margin: 0 calc(var(--cw) * -0.06); }
.hand.myturn .card.legal { cursor: pointer; transform: translateY(calc(var(--ch) * -0.06)); }
.hand.myturn .card.legal:hover { transform: translateY(calc(var(--ch) * -0.14)); }
.hand.myturn .card.illegal { filter: brightness(0.55) saturate(0.6); }
.hand .card.mar::after { content: attr(data-mar); position: absolute; top: -10px; right: -6px; background: var(--gold); color: #2a1a10; font-weight: 800; font-size: 12px; border-radius: 9px; padding: 1px 6px; }

/* Querformat am Handy: alles enger, Talon und Stich nebeneinander */
@media (max-height: 500px) {
  .topbar { padding: 3px 10px; }
  .iconbtn { width: 34px; height: 34px; }
  .deckel { width: 80px; height: 40px; }
  .deckel b { font-size: 15px; }
  .opphand { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); }
  .opphand .card { --cw: calc(var(--cwBase) * 0.42); }
  .mid { padding-top: calc(var(--ch) * 0.3); }
  /* Stich nebeneinander statt übereinander, sonst stößt er oben an die Gegnerkarten und unten an die Hand */
  .trick { width: calc(var(--cw) * 2.3); height: calc(var(--cw) * 1.55); }
  .trick .card.p1 { top: 2px; transform: rotate(-6deg); }
  .trick .card.p0 { bottom: auto; top: 6px; transform: rotate(6deg); }
  .hint { bottom: calc(var(--ch) + 8px); width: min(380px, 52vw); font-size: 13px; }
  .bubble { top: 46px; }
  .actions { position: absolute; right: 10px; bottom: 10px; flex-direction: column; align-items: flex-end; z-index: 5; max-width: calc(50vw - var(--cw) * 2.3); }
  .status { position: absolute; right: 10px; bottom: calc(var(--ch) + 14px); text-align: right; max-width: 30vw; font-size: 13px; }
}

/* ---------- Fenster ---------- */
.panel { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pbox { width: min(480px, 100%); max-height: 100%; overflow-y: auto; background: var(--panel); border-radius: 18px; padding: 18px; border: 1px solid rgba(242,194,48,0.3); box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.pbox.text { font-size: 14px; line-height: 1.5; }
.pbox.text p { margin: 0 0 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.ingame { display: flex; gap: 8px; justify-content: center; margin: 14px 0 4px; flex-wrap: wrap; }
.result { text-align: center; }
.result .big { font: 800 28px Georgia, serif; color: var(--gold); margin: 4px 0; }
.result .why { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.result .face { font-size: 44px; }
.result .tally { display: flex; justify-content: center; gap: 26px; margin: 10px 0 6px; }
.result .tally div { text-align: center; font-size: 13px; color: var(--muted); }
.result .tally b { display: block; font: 800 30px Georgia, serif; color: var(--ink); }
.result .cards { display: flex; justify-content: center; gap: 3px; flex-wrap: wrap; margin: 8px 0; }
.result .cards .card { --cw: 34px; }
.result .bummerl { font: 800 19px/1.3 Georgia, serif; color: var(--gold); margin: 6px 0 12px; }

/* Hochformat: Talon und Punkte oben nebeneinander, darunter der Stich groß in der Mitte */
@media (orientation: portrait) and (min-height: 501px) {
  .mid { grid-template-columns: 1fr 1fr; grid-template-areas: "talon side" "trick trick"; align-content: center; row-gap: 22px; }
  .talon { grid-area: talon; }
  .side { grid-area: side; align-self: start; }
  .trick { grid-area: trick; justify-self: center; }
}

/* Gesichter */
.face svg { display: block; width: 100%; height: 100%; }
.oppinfo .face { width: 44px; height: 44px; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4)); }
.opp .face { width: 52px; height: 52px; }
.opp.locked { opacity: 0.55; cursor: default; }
.opp.locked .face { filter: grayscale(1) brightness(0.45); }
.opp.locked:hover { background: rgba(255,255,255,0.06); }
.opp .deckerl { grid-column: 1 / -1; justify-self: start; background: radial-gradient(#fffaf0 60%, #f1e3c4); border: 2px solid var(--red); border-radius: 12px; padding: 3px 8px; line-height: 0; }
.tallynum { color: var(--red); font: 800 15px/20px Georgia, serif; }
.evening { margin: -6px 0 12px; color: var(--muted); font-style: italic; }
.result .face { width: 76px; height: 76px; margin: 0 auto 4px; font-size: 0; }
.result .unlock { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 12px; padding: 8px; border-radius: 12px; background: rgba(242,194,48,0.15); color: var(--gold); font-weight: 700; }
.result .unlock .face { width: 44px; height: 44px; margin: 0; flex: none; }
@media (max-height: 500px) { .oppinfo .face { width: 34px; height: 34px; } .result .face { width: 56px; height: 56px; } }
#resultBox { text-align: center; }

/* ---------- Schnapsschule ---------- */
.schoolbtn { background: linear-gradient(#62ad44, #3f7a22); color: #fff; box-shadow: 0 3px 0 #24501a; }
.schoolbtn:active { box-shadow: 0 1px 0 #24501a; }
.schoolhint { margin: -2px 0 8px; font-size: 12.5px; color: var(--muted); }
.schhead { display: flex; gap: 12px; align-items: center; text-align: left; margin-bottom: 10px; }
.schhead .face { width: 64px; height: 64px; flex: none; }
.schhead h2 { margin: 0 0 4px; }
.schhead .what { margin: 0; }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-bottom: 12px; }
.lessonbtn { display: flex; gap: 10px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 12px; border: 1px solid rgba(242,194,48,0.25); background: rgba(255,255,255,0.05); }
.lessonbtn:hover { background: rgba(242,194,48,0.14); }
.lessonbtn .num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #2a1a10; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.lessonbtn.done .num { background: #5aa03c; color: #fff; }
.lessonbtn .lt { display: flex; flex-direction: column; min-width: 0; }
.lessonbtn b { font-size: 15px; }
.lessonbtn small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.schall { margin: 4px 0 12px; padding: 10px; border-radius: 12px; background: rgba(90,160,60,0.18); }
.schall p { margin: 0 0 6px; }

#lesson { justify-content: flex-start; }
.lshead { width: 100%; max-width: 900px; display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.lshead b { flex: 1; font: 700 17px Georgia, serif; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsdots { display: flex; gap: 4px; flex: none; }
.lsdots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.lsdots i.past { background: #5aa03c; }
.lsdots i.now { background: var(--gold); }
.lsbody { flex: 1; width: 100%; max-width: 900px; display: flex; flex-direction: column; gap: 8px; padding: 0 10px; min-height: 0; }
.lsteach { display: flex; gap: 10px; align-items: flex-start; }
.lsteach .face { width: 54px; height: 54px; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4)); }
.lssay { flex: 1; position: relative; background: #fffaf0; color: #2e2015; border-radius: 14px; padding: 10px 13px; font-size: 15px; line-height: 1.45; box-shadow: 0 3px 10px rgba(0,0,0,0.35); }
.lssay::before { content: ""; position: absolute; left: -7px; top: 18px; border: 7px solid transparent; border-right-color: #fffaf0; border-left: 0; }
.lssay b { color: #8e1622; }
.lsstage { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.lsfoot { width: 100%; max-width: 900px; display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px max(8px, env(safe-area-inset-bottom)); }
.lsfoot .btn { width: auto; margin: 0; flex: 1; max-width: 320px; }
.lsfoot .btn:disabled { filter: grayscale(0.8) brightness(0.6); box-shadow: none; }
.lsfoot .btn2:disabled { opacity: 0.35; }
.lsrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lscard { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lscard span { font: 700 13px Georgia, serif; color: var(--gold); text-align: center; max-width: calc(var(--cw) * 1.3); }
.lsopts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.lsopts .opt { min-width: 84px; padding: 12px 18px; font-size: 18px; font-weight: 700; }
.optcard { border: 0; background: none; padding: 0; border-radius: 10px; }
.optcard:hover .card { transform: translateY(-6%); }
.lsopts .ok { box-shadow: 0 0 0 3px #5aa03c, 0 0 14px #5aa03c; }
.lsopts .opt.ok { background: #5aa03c; }
.lsopts .no { opacity: 0.35; }
.lsnote { color: var(--muted); font-size: 13px; text-align: center; max-width: 420px; margin: 0; }
.deckel.big { transform: rotate(-4deg) scale(1.5); margin: 12px; }
.lsstage .btn.big { width: auto; padding: 13px 26px; }

/* Mini-Tisch für Übungen */
.tt { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tt-opp { display: flex; justify-content: center; min-height: calc(var(--cw) * 0.7); }
.tt-opp .card { --cw: calc(var(--cwL, 60px) * 0.45); margin: 0 -3px; }
.tt-mid { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.tt-talon { position: relative; justify-self: start; width: calc(var(--cw) * 1.95); height: calc(var(--cw) * 1.55); }
.tt-talon .trumpcard { position: absolute; left: calc(var(--cw) * 0.62); top: 0; transform: rotate(90deg); }
.tt-talon .stack { position: absolute; left: 0; top: 0; z-index: 1; }
.tt-talon .stack .card { position: absolute; }
.tt-talon .count { position: absolute; left: 0; bottom: -17px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tt-talon .trumpbadge, .tt-talon.big .trumpbadge { position: absolute; right: -6px; top: -12px; z-index: 2; background: rgba(0,0,0,0.55); border-radius: 10px; padding: 2px 7px; font-size: 11px; display: flex; gap: 4px; align-items: center; }
.tt-trick { position: relative; width: calc(var(--cw) * 2.2); height: calc(var(--cw) * 1.65); }
.tt-trick .card { position: absolute; animation: pop 0.2s; }
.tt-trick .card.p1 { left: 0; top: 0; transform: rotate(-6deg); }
.tt-trick .card.p0 { right: 0; top: 6px; transform: rotate(6deg); }
.tt-pts { justify-self: end; text-align: right; font-size: 13px; color: var(--muted); line-height: 1.5; }
.tt-pts b { color: var(--ink); white-space: nowrap; }
.tt-pts .pend { color: var(--gold); font-size: 12px; }
.tt-msg { min-height: 18px; color: var(--gold); font-weight: 700; font-size: 14px; text-align: center; }
.tt-actions { display: flex; gap: 8px; justify-content: center; }
.tt-actions button { border: 1px solid var(--gold); border-radius: 11px; padding: 7px 12px; background: rgba(0,0,0,0.5); color: var(--gold); font-weight: 700; font-size: 14px; }
.tt-actions button.armed { background: var(--gold); color: #2a1a10; }
.tt-hand { display: flex; justify-content: center; padding-top: 10px; }
.tt-hand .card { margin: 0 calc(var(--cw) * -0.05); }
.tt-hand.myturn .card.legal { cursor: pointer; transform: translateY(-7%); }
.tt-hand.myturn .card.legal:hover { transform: translateY(-14%); }
.tt-hand.myturn .card.illegal { filter: brightness(0.55) saturate(0.6); }
.tt-hand .card.mar::after { content: attr(data-mar); position: absolute; top: -10px; right: -6px; background: var(--gold); color: #2a1a10; font-weight: 800; font-size: 12px; border-radius: 9px; padding: 1px 6px; }

/* Coach im Probespiel */
.coachline { max-width: min(560px, calc(100vw - 24px)); margin: 0 auto 2px; padding: 6px 11px; border-radius: 11px; background: rgba(90,160,60,0.9); color: #fff; font-size: 13.5px; line-height: 1.35; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.card.coachpick { box-shadow: 0 0 0 3px var(--gold), 0 0 18px 4px rgba(242,194,48,0.85); }
.actions button.coachpick { box-shadow: 0 0 0 3px var(--gold), 0 0 14px rgba(242,194,48,0.9); }

@media (max-height: 500px) {
  .lsbody { flex-direction: row; }
  .lsteach { width: 40%; flex-direction: column; align-items: stretch; }
  .lsteach .face { width: 42px; height: 42px; }
  .lssay { font-size: 13.5px; padding: 8px 11px; max-height: 100%; overflow-y: auto; }
  .lssay::before { display: none; }
  .lshead { padding: 3px 10px; }
  .lsfoot { padding-top: 4px; }
  .coachline { position: absolute; right: 10px; bottom: calc(var(--ch) + 34px); max-width: 36vw; font-size: 12px; z-index: 6; margin: 0; }
  .coachline:not([hidden]) ~ .status { display: none; }
  .side { align-self: start; }   /* Punkte nach oben, darunter ist Platz für Coach und Status */
}
@media (orientation: portrait) and (min-height: 501px) {
  .tt-mid { grid-template-columns: 1fr 1fr; grid-template-areas: "talon pts" "trick trick"; row-gap: 14px; }
  .tt-talon { grid-area: talon; } .tt-pts { grid-area: pts; align-self: start; } .tt-trick { grid-area: trick; justify-self: center; }
}

/* Schnapsschule: Farbzeichen von Dame/Bube einkreisen */
.pipmark { position: absolute; width: 27%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none;
  border: 3px solid #ffde3a; box-shadow: 0 0 0 2px rgba(0,0,0,0.45), 0 0 12px 3px rgba(255,222,58,0.8); animation: pipPulse 1.4s ease-in-out infinite; }
@keyframes pipPulse { 50% { scale: 1.15; } }
.lsrowcap { font: 700 14px Georgia, serif; color: var(--gold); margin-bottom: -4px; }

/* ---------- Online-Tisch ---------- */
.onlinebtn { background: linear-gradient(#3a86d0, #1f528e); color: #fff; box-shadow: 0 3px 0 #123660; }
.onlinebtn:active { box-shadow: 0 1px 0 #123660; }
#online h3 { margin: 14px 0 6px; font: 700 16px Georgia, serif; color: var(--gold); }
.onlabel { display: flex; flex-direction: column; gap: 4px; text-align: left; font-size: 13px; color: var(--muted); margin: 4px 0 6px; }
#online input { font: inherit; font-size: 17px; padding: 10px 12px; border-radius: 11px; border: 1px solid rgba(242,194,48,0.4); background: rgba(255,255,255,0.08); color: var(--ink); width: 100%; min-width: 0; }
#online input:focus { outline: 2px solid var(--gold); }
.oncheck { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
#online .oncheck input { width: auto; }
.onor { margin: 6px 0; color: var(--muted); font-size: 13px; }
.onjoin { display: flex; gap: 8px; }
#onCode { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-weight: 800; }
.onjoin .btn2 { flex: none; padding: 10px 16px; font-weight: 700; }
.onlist { display: flex; flex-direction: column; gap: 6px; }
.onroom { display: flex; align-items: center; gap: 10px; text-align: left; }
.onroom b { flex: 1; }
.onroom small { color: var(--gold); }
.oncode { font: 800 46px Georgia, serif; letter-spacing: 10px; color: var(--gold); margin: 4px 0 10px; text-shadow: 0 2px 0 #000; }
.onwait { color: var(--ink); margin: 12px 0; }
.onmsg { min-height: 18px; color: #ff9a8a; font-size: 14px; margin: 8px 0 4px; }
.onfair { font-size: 11.5px; color: rgba(255,255,255,0.45); margin: 4px 0 10px; }
