/* ITSK Forum – Forenspiele & Lernkarten */
kbd { background: #0b0d12; border: 1px solid var(--border, #262b36); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 0.8em; font-family: ui-monospace, Consolas, monospace; }
.wallet { color: #ffd43b; font-size: 0.95rem; white-space: nowrap; }

/* ---------- Übersicht ---------- */
.arcade-sign {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 24px 0 16px; padding: 22px 26px; border-radius: 14px;
  background: radial-gradient(ellipse at 20% 0%, rgba(218,119,242,0.18), transparent 60%), linear-gradient(135deg, #140f24, #0b0d12);
  border: 1px solid rgba(218,119,242,0.35);
}
.arcade-sign small { display: block; color: var(--muted, #8e95a3); font-size: 0.88rem; margin-top: 4px; }
.arcade-neon { font-family: ui-monospace, Consolas, monospace; font-size: 1.7rem; font-weight: 700; color: #f783ac; letter-spacing: 0.08em; text-shadow: 0 0 8px rgba(247,131,172,0.7), 0 0 20px rgba(218,119,242,0.4); }
.deck-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.deck-card.owned { border-color: rgba(105,219,124,0.45); }
.deck-icon { font-size: 2.2rem; }
.deck-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.deck-text span { color: var(--muted, #8e95a3); font-size: 0.88rem; }
.deck-ok { color: #69db7c; font-weight: 600; }
.arcade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 16px; }
.arcade-card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text, #f0eee9);
  background: var(--card, #181c25); border: 1px solid var(--border, #262b36); border-radius: 14px; padding: 18px;
  transition: transform .12s, border-color .12s;
}
.arcade-card:hover { transform: translateY(-2px); border-color: #da77f2; }
.arcade-icon { font-size: 2.4rem; }
.arcade-name { font-weight: 600; font-size: 1.1rem; }
.arcade-desc { color: var(--muted, #8e95a3); font-size: 0.88rem; flex: 1; }
.arcade-meta { display: flex; flex-direction: column; gap: 2px; font-size: 0.8rem; color: var(--muted, #8e95a3); margin-top: 6px; }
.arcade-play { margin-top: 8px; align-self: flex-start; padding: 6px 14px; border-radius: 8px; background: rgba(218,119,242,0.15); color: #e599f7; font-weight: 600; font-size: 0.88rem; }

/* ---------- Spielseite ---------- */
.spiel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spiel-head h1 { margin-bottom: 8px; }
.spiel-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.arcade-frame { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid rgba(77,159,255,0.35); background: #05070c; box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
.arcade-frame canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; touch-action: none; }
.arcade-hud { position: absolute; top: 8px; left: 12px; right: 12px; display: flex; gap: 14px; font-size: 0.85rem; color: #e9ecef; pointer-events: none; text-shadow: 0 1px 3px #000; font-family: ui-monospace, Consolas, monospace; }
#hud-power { margin-left: auto; color: #ffd43b; font-weight: 700; }
.arcade-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5,7,12,0.78); padding: 16px; }
.arcade-overlay[hidden] { display: none; }
.overlay-box { text-align: center; max-width: 420px; }
.overlay-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 10px; }
.overlay-text { color: var(--muted, #8e95a3); font-size: 0.92rem; line-height: 1.6; margin-bottom: 16px; }
.overlay-text strong { color: #ffd43b; font-size: 1.2rem; }
#overlay-btn { padding: 10px 24px; font-weight: 600; }
.hack-panel {
  position: absolute; inset: 10px; display: flex; flex-direction: column; gap: 8px;
  background: rgba(8,12,20,0.97); border: 1px solid #69db7c; border-radius: 10px; padding: 12px;
  box-shadow: 0 0 30px rgba(105,219,124,0.2);
}
.hack-panel[hidden] { display: none; }
.hack-kopf { display: flex; justify-content: space-between; color: #69db7c; font-family: ui-monospace, Consolas, monospace; }
.hack-zeit { font-weight: 700; color: #ffd43b; }
.hack-hint { color: var(--muted, #8e95a3); font-size: 0.85rem; }
.hack-panel textarea {
  flex: 1; min-height: 140px; resize: none; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.95rem; line-height: 1.5;
  background: #05070c; color: #b2f2bb; border: 1px solid rgba(105,219,124,0.35); border-radius: 8px; padding: 10px;
}
.hack-aktionen { display: flex; gap: 8px; }
.dpad { display: none; margin-top: 12px; text-align: center; user-select: none; }
.dpad button { width: 64px; height: 52px; font-size: 1.3rem; margin: 3px; }
.dpad-hacks button { width: auto; height: 44px; font-size: 0.95rem; padding: 0 16px; }
.dash-row.ich { background: rgba(105,219,124,0.06); }

/* ---------- Seiten-Doktor ---------- */
.doktor-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--muted, #8e95a3); margin-bottom: 10px; }
.d-zeit { font-family: ui-monospace, Consolas, monospace; font-size: 1.4rem; font-weight: 700; color: var(--text, #f0eee9); }
.d-zeit.knapp { color: #ff6b6b; }
.doktor-aufgabe { background: rgba(255,107,107,0.08); border: 1px solid rgba(255,107,107,0.35); color: #ffc9c9; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.doktor-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; }
.doktor-grid textarea {
  min-height: 190px; resize: vertical; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.95rem; line-height: 1.5;
  background: #05070c; color: #d6e2ff; border: 1px solid var(--border, #262b36); border-radius: 8px; padding: 10px;
}
.doktor-grid iframe { width: 100%; min-height: 190px; border: 1px solid var(--border, #262b36); border-radius: 8px; background: #fff; }
.doktor-aktionen { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.d-ok { color: #69db7c; font-weight: 600; } .d-falsch { color: #ff8787; }
.coins-gewinn { color: #ffd43b; font-size: 1.2rem; font-weight: 700; }

/* ---------- Lernkarten ---------- */
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 16px 0; }
.deck-tile {
  display: flex; flex-direction: column; gap: 6px; background: var(--card, #181c25); border: 1px solid var(--border, #262b36);
  border-radius: 14px; padding: 16px; color: var(--text, #f0eee9); text-decoration: none;
  box-shadow: 4px 4px 0 -1px #11141b, 4px 4px 0 0 var(--border, #262b36);
}
.deck-tile-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.deck-tile-icon { font-size: 2rem; }
.deck-tile-name { font-weight: 600; }
.deck-tile-meta { color: var(--muted, #8e95a3); font-size: 0.8rem; }
.deck-faellig { margin-top: 6px; align-self: flex-start; padding: 5px 12px; border-radius: 8px; background: rgba(77,159,255,0.15); color: #74c0fc; text-decoration: none; font-weight: 600; font-size: 0.85rem; }
.deck-fertig { margin-top: 6px; color: #69db7c; font-size: 0.82rem; }
.deck-neu { border-style: dashed; }
.deck-neu input, .deck-neu select { margin: 0; }
.deck-shop { border-color: rgba(255,212,59,0.35); }
.karte-neu .karte-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.karte-neu label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted, #8e95a3); }
.karten-liste { display: grid; gap: 6px; }
.karte-row { display: flex; align-items: flex-start; gap: 12px; background: var(--card, #181c25); border: 1px solid var(--border, #262b36); border-radius: 10px; padding: 10px 14px; }
.karte-box { font-size: 0.72rem; color: var(--muted, #8e95a3); background: rgba(255,255,255,0.04); border-radius: 6px; padding: 2px 6px; white-space: nowrap; margin-top: 2px; }
.karte-text { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.karte-text span { color: var(--muted, #8e95a3); font-size: 0.88rem; white-space: pre-line; }
.lernen-wrap { max-width: 640px; margin: 10px auto; }
.lernen-kopf { display: flex; justify-content: space-between; color: var(--muted, #8e95a3); margin-bottom: 6px; }
.flip { perspective: 1200px; margin: 18px 0; cursor: pointer; outline: none; }
.flip[hidden] { display: none; }
.flip-inner { position: relative; min-height: 260px; transition: transform .45s; transform-style: preserve-3d; }
.flip.gedreht .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  padding: 28px; border-radius: 16px; font-size: 1.25rem; line-height: 1.5; white-space: pre-line;
  background: linear-gradient(160deg, #1b2130, #141821); border: 1px solid var(--border, #262b36); box-shadow: 0 14px 34px rgba(0,0,0,0.4);
}
.flip-back { transform: rotateY(180deg); border-color: rgba(105,219,124,0.4); }
.flip-front small, .flip-back small { position: absolute; top: 14px; left: 18px; font-size: 0.75rem; color: var(--muted, #8e95a3); text-transform: uppercase; letter-spacing: 0.08em; }
.flip-front em { position: absolute; bottom: 14px; font-size: 0.75rem; color: var(--muted, #8e95a3); font-style: normal; }
.lk-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lk-buttons[hidden] { display: none; }
.lk-buttons button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px; font-weight: 600; }
.lk-buttons small { font-weight: 400; font-size: 0.72rem; opacity: 0.75; }
.lk-nochmal { background: rgba(255,107,107,0.12) !important; border-color: rgba(255,107,107,0.4) !important; }
.lk-gut { background: rgba(105,219,124,0.12) !important; border-color: rgba(105,219,124,0.4) !important; }
.lk-leicht { background: rgba(77,159,255,0.12) !important; border-color: rgba(77,159,255,0.4) !important; }

@media (max-width: 900px) {
  .spiel-layout { grid-template-columns: 1fr; }
  .dpad { display: block; }
  .doktor-grid, .karte-neu .karte-felder { grid-template-columns: 1fr; }
}

/* ---------- Code-Farm ---------- */
.farm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.farm-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.taler { color: #ffd43b; font-size: 1rem; }
.chip-f { background: rgba(255,255,255,0.05); border: 1px solid var(--border, #262b36); border-radius: 999px; padding: 3px 10px; font-size: 0.82rem; }
.farm-msg { margin: 10px 0; padding: 9px 12px; border-radius: 8px; font-size: 0.9rem; }
.farm-msg.ok { background: rgba(105,219,124,0.12); color: #b2f2bb; }
.farm-msg.fehler { background: rgba(255,107,107,0.12); color: #ffc9c9; }
.farm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.gewaechshaus { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 14px; }
.gh-teil { display: flex; gap: 10px; align-items: flex-start; background: var(--card, #181c25); border: 1px solid var(--border, #262b36); border-radius: 12px; padding: 12px; }
.gh-teil.aus { opacity: 0.6; }
.gh-teil.bereit { border-color: rgba(255,212,59,0.5); }
.gh-teil.an { border-color: rgba(105,219,124,0.55); background: linear-gradient(160deg, rgba(105,219,124,0.08), var(--card, #181c25)); }
.gh-icon { font-size: 1.8rem; }
.gh-teil.aus .gh-icon { filter: grayscale(1); }
.gh-text { display: flex; flex-direction: column; gap: 5px; font-size: 0.88rem; }
.gh-text small { color: var(--muted, #8e95a3); font-size: 0.76rem; }
.gh-text button { align-self: flex-start; padding: 5px 10px; font-size: 0.82rem; }
.gh-ok { color: #69db7c; font-weight: 600; font-size: 0.82rem; }
.farm-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.farm-lager { color: var(--muted, #8e95a3); font-size: 0.85rem; flex: 1; }
.felder { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.feld {
  position: relative; min-height: 150px; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  background: repeating-linear-gradient(0deg, #3b2a1d 0 10px, #33241a 10px 20px); border: 1px solid #5c4330; box-shadow: inset 0 0 18px rgba(0,0,0,0.45);
}
.feld.gesperrt { background: repeating-linear-gradient(45deg, #161a22 0 10px, #12151c 10px 20px); border-color: var(--border, #262b36); color: var(--muted, #8e95a3); }
.feld.gesperrt button { background: rgba(255,255,255,0.05); line-height: 1.3; }
.feld.leer > button { background: rgba(0,0,0,0.35); border: 1px dashed rgba(255,255,255,0.3); color: #f0eee9; }
.feld.reif { border-color: #69db7c; cursor: pointer; box-shadow: 0 0 0 2px rgba(105,219,124,0.25), inset 0 0 18px rgba(0,0,0,0.45); }
.pflanze { font-size: 2.6rem; line-height: 1; animation: wippen 1.6s ease-in-out infinite; }
.pflanze.klein { font-size: 2rem; animation: none; }
@keyframes wippen { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.feld-text { font-size: 0.78rem; color: #f1e3d3; }
.feld-zeit { font-size: 0.72rem; color: #d8c3a5; }
.feld .xpbar { width: 80%; }
.feld select { width: 100%; font-size: 0.72rem; padding: 2px; margin-top: 2px; background: rgba(0,0,0,0.35); color: #f0eee9; border-color: rgba(255,255,255,0.15); }
.feld.reif button { padding: 4px 12px; font-size: 0.82rem; }
.farm-auto { margin-top: 12px; color: #b2f2bb; font-size: 0.88rem; }
.shop-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.shop-row:last-child { border-bottom: 0; }
.shop-row > div { flex: 1; display: flex; flex-direction: column; font-size: 0.88rem; }
.shop-row small { color: var(--muted, #8e95a3); font-size: 0.74rem; }
.shop-ic { font-size: 1.4rem; }
.shop-row button { padding: 4px 10px; font-size: 0.82rem; white-space: nowrap; }
.shop-row button::after { content: ' T'; opacity: 0.7; }
.shop-row.hat { opacity: 0.75; }
.saat-pop { position: absolute; z-index: 60; width: 260px; background: var(--card, #181c25); border: 1px solid var(--border, #262b36); border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,0.5); padding: 6px; }
.saat-pop[hidden] { display: none; }
.saat-titel { font-size: 0.75rem; color: var(--muted, #8e95a3); text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 8px; }
.saat-pop button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 7px 8px; border-radius: 8px; color: var(--text, #f0eee9); cursor: pointer; }
.saat-pop button:hover:not(:disabled) { background: rgba(105,219,124,0.1); }
.saat-pop button > span:first-child { font-size: 1.4rem; }
.saat-pop button > span:last-child { display: flex; flex-direction: column; font-size: 0.9rem; }
.saat-pop small { color: var(--muted, #8e95a3); font-size: 0.74rem; }
.modal-bg { position: fixed; inset: 0; z-index: 950; background: rgba(5,7,12,0.75); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-bg[hidden] { display: none; }
.modal-box { width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card, #181c25); border: 1px solid #69db7c; border-radius: 14px; padding: 18px; box-shadow: 0 0 40px rgba(105,219,124,0.15); }
.modal-kopf { display: flex; justify-content: space-between; align-items: center; font-size: 1.1rem; }
.modal-box textarea { width: 100%; min-height: 200px; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.92rem; line-height: 1.5; background: #05070c; color: #b2f2bb; border: 1px solid rgba(105,219,124,0.35); border-radius: 8px; padding: 10px; margin-top: 8px; }
.m-aktionen { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.m-teile { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; }
.m-teile label { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; }
.m-teile-titel { width: 100%; font-weight: 600; font-size: 0.88rem; margin-top: 4px; }

/* ---------- Markt ---------- */
.markt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.markt-stand { background: linear-gradient(180deg, #2a1f17 0 14px, var(--card, #181c25) 14px); border: 1px solid #5c4330; border-radius: 12px; padding: 22px 14px 14px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.markt-stand.leer { opacity: 0.6; }
.markt-icon { font-size: 2.2rem; }
.markt-name { font-weight: 600; }
.markt-preis { font-size: 0.85rem; color: #ffd43b; }
.markt-preis .hoch { color: #69db7c; } .markt-preis .tief { color: #ff8787; }
.markt-lager { font-size: 0.82rem; color: var(--muted, #8e95a3); }
.markt-stand button { width: 100%; margin-top: 6px; font-size: 0.85rem; }
.tausch-form { display: flex; align-items: center; gap: 8px; }
.tausch-form input { width: 100px !important; }

@media (max-width: 900px) {
  .farm-layout { grid-template-columns: 1fr; }
  .gewaechshaus { grid-template-columns: 1fr; }
  .felder { grid-template-columns: repeat(2, 1fr); }
}
