:root{ --ta-primary:#1e6aa9; --ta-primary-2:#0b5b96; --ta-bg:#eef4fb; }
.tabaction-app.ipad { max-width: 980px; margin: 0 auto; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color: #0b2447; }
.tabaction-brand { display:flex; justify-content:center; margin: 8px 0 0; }
.tabaction-logo { height:56px; width:auto; background:transparent; filter:none; }
.tabaction-card { background: #fff; border-radius: 18px; box-shadow: 0 12px 28px rgba(11,91,150,.15); padding: 22px; margin: 18px 10px; position:relative; z-index:1; }
.tabaction-hero { height: 320px; border-radius: 14px; background-size: cover; background-position: center; margin: -8px -8px 16px -8px; }
.title-xl { font-size: 34px; margin: 6px 0; }
.subtitle { font-size: 18px; color:#4b637c; margin: 0 0 10px; }
.tabaction-btn { background: var(--ta-primary); color:#fff; border:0; border-radius: 14px; padding: 14px 18px; font-weight:700; cursor:pointer; }
.tabaction-btn:hover { background: var(--ta-primary-2); }
.tabaction-btn.ghost { background: #eaf1ff; color:var(--ta-primary); }

/* Timer display in topbar */
.tabaction-topbar{display:flex;gap:12px;align-items:center;justify-content:space-between;}
.tabaction-timer{font-weight:600;}


/* === Enhanced UI: centered question images & framed topbar counters === */
.tabaction-app .tabaction-qmedia{
  display:flex;
  justify-content:center;
  align-items:center;
  margin: 8px 0 16px 0;
  width:100%;
  text-align:center;
}
.tabaction-app .tabaction-qmedia img#tabaction-qimg{
  max-width: 96%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  object-fit: contain;
}

/* Topbar layout & framed badges */
.tabaction-app .tabaction-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between; /* keep L/C/R layout */
  gap:16px;
  margin: 4px 0 10px 0;
}

.tabaction-app .tabaction-topbar > div{
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-align:center;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  min-width: 120px;
}

/* Make the middle counter auto-grow nicely on narrow screens */
@media (max-width: 520px){
  .tabaction-app .tabaction-topbar{ gap:10px; }
  .tabaction-app .tabaction-topbar > div{ font-size: 16px; padding: 8px 12px; min-width: 96px; }
}

/* Slightly accent the timer */
.tabaction-app .tabaction-timer{
  border-color: rgba(0,0,0,0.12);
}


/* Urgent timer state: red blink below 5s */
@keyframes taBlinkRed {
  0%, 100% { background: rgba(255,0,0,0.00); transform: none; box-shadow: 0 0 0 rgba(220,53,69,0.0); }
  50%      { background: rgba(255,0,0,0.08); transform: scale(1.03); box-shadow: 0 0 12px rgba(220,53,69,0.25); }
}
.tabaction-app .tabaction-timer.ta-urgent{
  color: #b00020;
  border-color: rgba(220,53,69,0.6);
  animation: taBlinkRed 1s infinite;
}


/* Progress ring around timer box using CSS variable --p (0..1) */
.tabaction-app .tabaction-timer{
  position: relative;
  --p: 1; /* progress from 0..1 */
  --ring-color: #2d5ca3; /* can be customized */
  --ring-thickness: 4px;
}
.tabaction-app .tabaction-timer::after{
  content: "";
  position: absolute;
  inset: calc(-1 * var(--ring-thickness));
  border-radius: 16px;
  background:
    conic-gradient(var(--ring-color) calc(var(--p)*1turn), rgba(0,0,0,0.08) 0);
  -webkit-mask:
    radial-gradient(farthest-side, transparent calc(100% - var(--ring-thickness)), #000 0) 0 0/100% 100% no-repeat;
  mask:
    radial-gradient(farthest-side, transparent calc(100% - var(--ring-thickness)), #000 0) 0 0/100% 100% no-repeat;
  pointer-events:none;
}

/* Correct answer badge */
.ta-correct-badge{
  margin-top: 12px;
  padding: 14px 18px;
  font-size: 20px;
  font-weight: 800;
  color: #155724;
  background: #eaf7ef;
  border: 2px solid #28a745;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(40,167,69,.12);
}
@media (max-width: 520px){
  .ta-correct-badge{ font-size: 18px; padding: 12px 14px; }
}


/* Team name validation UI */
.ta-input-error{
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #b00020;
}
.ta-invalid{
  border-color: #b00020 !important;
  outline-color: #b00020 !important;
  box-shadow: 0 0 0 2px rgba(176,0,32,.15);
}


/* === Centered success layout & big green badge === */
#tabaction-qinput.ta-correct-state{
  text-align: center;
  padding-top: 8px;
}
.ta-correct-badge{
  display: inline-block;
  margin: 14px auto 12px;
  padding: 18px 26px;
  font-size: 26px;
  font-weight: 800;
  color: #155724;
  background: #e8f7ee;
  border: 3px solid #28a745;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(40,167,69,.18);
}
@media (min-width: 768px){
  .ta-correct-badge{ font-size: 28px; padding: 20px 30px; }
}
/* Center action buttons in success state */
#tabaction-qinput.ta-correct-state #tabaction-next,
#tabaction-qinput.ta-correct-state #tabaction-skip,
#tabaction-qinput.ta-correct-state #tabaction-submit{
  display: inline-block;
  margin: 8px 10px 0;
}


/* === Correct center layout & big framed badge with pop === */
#tabaction-qinput.ta-correct-state{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 8px;
}
.ta-correct-wrap{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 12px 0 14px;
}
.ta-correct-badge{
  display: inline-block;
  padding: 22px 32px;
  font-size: 36px;
  font-weight: 900;
  color: #155724;
  background: #e8f7ee;
  border: 4px solid #28a745;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(40,167,69,.18);
  animation: taPop .28s ease-out;
}
@keyframes taPop{
  0% { transform: scale(.88); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
/* Center action buttons in success state */
#tabaction-qinput.ta-correct-state #tabaction-next,
#tabaction-qinput.ta-correct-state #tabaction-skip,
#tabaction-qinput.ta-correct-state #tabaction-submit{
  display: inline-block;
  margin: 10px 10px 0;
}
@media (max-width: 520px){
  .ta-correct-badge{ font-size: 28px; padding: 16px 22px; border-width: 3px; }
}


/* === Center question under image === */
.tabaction-app .tabaction-question #tabaction-qtext{
  text-align: center;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 800;
  margin: 14px auto 10px;
  padding: 0 8px;
}
@media (max-width: 520px){
  .tabaction-app .tabaction-question #tabaction-qtext{ font-size: 22px; }
}


/* === Center MC answers vertically (left-aligned) === */
.tabaction-app #tabaction-qinput .mc{
  width: min(680px, 96%);
  margin: 8px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.tabaction-app #tabaction-qinput .mc label{
  display: block;
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  background: #f7f9fc;
  cursor: pointer;
  transition: transform .04s ease, box-shadow .12s ease, background .12s ease;
}
.tabaction-app #tabaction-qinput .mc label:hover{
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  transform: translateY(-1px);
}
.tabaction-app #tabaction-qinput .mc input[type="radio"]{
  margin-right: 8px;
}
@media (max-width: 520px){
  .tabaction-app #tabaction-qinput .mc{ width: 96%; gap: 8px; }
  .tabaction-app #tabaction-qinput .mc label{ padding: 11px 12px; }
}


/* === MC list: extra bottom spacing === */
.tabaction-app #tabaction-qinput .mc{ margin-bottom: 60px; }

/* === Actions row aligned with answers (same width & centered block) === */
.tabaction-app .tabaction-card.game .tabaction-actions,
.tabaction-app .tabaction-card.result .tabaction-actions{
  width: min(680px, 96%);
  margin: 0 auto 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Push "Weiter" to the far right when visible */
.tabaction-app .tabaction-card.game .tabaction-actions #tabaction-next{ margin-left: auto; }
/* Optional: in Start card, push Rangliste to right as well */
.tabaction-app .tabaction-card.start .tabaction-actions{
  width: min(680px, 96%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tabaction-app .tabaction-card.start #tabaction-show-leaderboard{ margin-left: auto; }


/* === Start card: left-align actions + extra bottom spacing === */
.tabaction-app .tabaction-card.start .tabaction-actions{
  justify-content: flex-start;
  margin: 0 auto 10px;
}
.tabaction-app .tabaction-card.start #tabaction-show-leaderboard{
  margin-left: 0;
}


/* === Start card actions: flush left & 30px bottom === */
.tabaction-app .tabaction-card.start .tabaction-actions{
  width: auto !important;
  max-width: none !important;
  margin: 0 0 30px 0 !important;
  padding-left: 0 !important;
  justify-content: flex-start !important;
  align-self: flex-start !important;
}
.tabaction-app .tabaction-card.start #tabaction-start,
.tabaction-app .tabaction-card.start #tabaction-show-leaderboard{
  margin-left: 0 !important;
}


/* === Start card: force full left alignment & 30px bottom spacing === */
.tabaction-app .tabaction-card.start .tabaction-actions{
  width: auto !important;
  max-width: none !important;
  margin: 0 0 30px 0 !important; /* 30px bottom */
  justify-content: flex-start !important;
  align-self: stretch;
}
.tabaction-app .tabaction-card.start #tabaction-show-leaderboard{
  margin-left: 0 !important;
}


/* === Start card: drop actions 20px down === */
.tabaction-app .tabaction-card.start .tabaction-actions{
  margin-top: 20px !important;
}


/* === Start card: reduce bottom spacing under buttons to 10px === */
.tabaction-app .tabaction-card.start .tabaction-actions{
  margin-bottom: 10px !important;
}


/* === Game actions: keep all buttons flush-left like "Antwort prüfen" === */
.tabaction-app .tabaction-card.game .tabaction-actions{
  justify-content: flex-start !important;
}
.tabaction-app .tabaction-card.game .tabaction-actions #tabaction-next{
  margin-left: 0 !important; /* remove "push to right" */
}


/* === Feedback aligned flush-left with buttons === */
#tabaction-qinput.ta-correct-state{
  display: block !important;
  text-align: left !important;
}
/* Shared wrapper width same as answers & actions */
.ta-feedback-wrap, .ta-correct-wrap{
  width: min(680px, 96%);
  margin: 0 auto 8px; /* aligns flush-left inside centered column */
}
/* Ensure badge sits left inside wrapper */
.ta-correct-badge{ display: block; margin: 0; }


/* v2.10.14 HOTFIX: ensure Start/Rangliste clickable on start screen */
.ta-start [class*="overlay"],
.ta-start [class*="cover"],
.ta-start .ta-hero,
.ta-start .ta-hero::before,
.ta-start .ta-hero::after {
  pointer-events: none !important;
}
.ta-start .ta-actions,
.ta-start .ta-start-actions,
.ta-start .ta-buttonbar,
.ta-start a.ta-btn,
.ta-start button,
.ta-start .button,
.ta-start .wp-block-button__link {
  position: relative;
  z-index: 1001 !important;
  pointer-events: auto !important;
}
/* Avoid a parent stacking context from swallowing clicks */
.ta-start .ta-actions,
.ta-start .ta-start-actions { isolation: isolate; }
/* Pre-start splash should not swallow clicks when inactive */
.ta-start .ta-start-splash { pointer-events: none !important; }
.ta-start .ta-start-splash.is-active { pointer-events: auto !important; }


/* v2.10.15: Feedback bündig zu Antworten & Buttons */
.tabaction-app #tabaction-qinput .ta-feedback-wrap,
.tabaction-app #tabaction-qinput .ta-correct-wrap{
  width: min(680px, 96%) !important;
  margin: 8px auto 10px !important;
  padding: 0 !important;
  text-align: left !important;
  display: block !important;
}
/* Inhalt der Feedbackbox nicht zentrieren */
.tabaction-app #tabaction-qinput .ta-feedback-wrap *,
.tabaction-app #tabaction-qinput .ta-correct-wrap *{
  text-align: left !important;
  margin-left: 0 !important;
}
/* Gleiche Innenkanten wie Antworten & Action-Row */
.tabaction-app #tabaction-qinput .mc,
.tabaction-app .tabaction-card.game .tabaction-actions,
.tabaction-app #tabaction-qinput .ta-feedback-wrap,
.tabaction-app #tabaction-qinput .ta-correct-wrap{
  width: min(680px, 96%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
/* Entfernt eventuelle Offsets von Elterncontainern */
.tabaction-app #tabaction-qinput{ padding-left: 0 !important; padding-right: 0 !important; }


/* v2.10.16: Einheitliche Zentrierung für alle Feedbacks */
.tabaction-app #tabaction-qinput .ta-feedback-wrap,
.tabaction-app #tabaction-qinput .ta-correct-wrap{
  text-align: center !important;
  margin: 12px auto 12px !important;
}
.tabaction-app #tabaction-qinput .ta-feedback-wrap > *,
.tabaction-app #tabaction-qinput .ta-correct-wrap > *{
  margin-left: auto !important;
  margin-right: auto !important;
}
.ta-correct-badge{ display: inline-block !important; }


/* v2.10.17: Feedback bündig (links) an Antworten/Buttons — hohe Spezifität */
.tabaction-app .tabaction-card.game #tabaction-qinput .ta-feedback-wrap,
.tabaction-app .tabaction-card.game #tabaction-qinput .ta-correct-wrap{
  width: min(680px, 96%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 10px !important;
  margin-bottom: 8px !important;
  text-align: left !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  display: block !important;
}
/* Badge/Text selbst links halten */
.tabaction-app .tabaction-card.game #tabaction-qinput .ta-feedback-wrap > *,
.tabaction-app .tabaction-card.game #tabaction-qinput .ta-correct-wrap > *{
  text-align: left !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  display: block !important;
}
/* Kante angleichen: gleiche Maxbreite wie .mc & .tabaction-actions */
.tabaction-app #tabaction-qinput .mc,
.tabaction-app .tabaction-card.game .tabaction-actions,
.tabaction-app .tabaction-card.game #tabaction-qinput .ta-feedback-wrap,
.tabaction-app .tabaction-card.game #tabaction-qinput .ta-correct-wrap{
  width: min(680px, 96%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
/* Badge */
.ta-correct-badge{ display:block !important; margin: 0 !important; }
/* Safety: Korrigiert evtl. zentrierende Eltern */
.tabaction-app .tabaction-card.game #tabaction-qinput{ text-align: left !important; }


/* v2.10.18: Feedback-Area positioniert direkt über den Buttons */
.tabaction-app .tabaction-card.game .ta-feedback-area{
  width: min(680px, 96%) !important;
  margin: 8px auto 10px !important;
  text-align: left !important;
  display: block !important;
}
.tabaction-app .tabaction-card.game .ta-feedback-area > *{
  display: block !important;
  margin: 0 !important;
  text-align: left !important;
}
/* Badge konsistent im Flow */
.tabaction-app .tabaction-card.game .ta-feedback-area .ta-correct-badge{
  display: inline-block !important;
  padding: 14px 18px;
  font-size: 20px;
  font-weight: 800;
  color: #155724;
  background: #eaf7ef;
  border: 2px solid #b0e0c3;
  border-radius: 8px;
}


/* === Victory Popup === */
.ta-victory-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);display:none;align-items:center;justify-content:center;z-index:9999;}
.ta-victory{background:#fff;border-radius:18px;box-shadow:0 12px 40px rgba(0,0,0,.25);width:min(520px,90vw);padding:24px 22px 26px;text-align:center;position:relative;overflow:hidden;}
.ta-victory .ta-emoji{font-size:56px;line-height:1;margin-bottom:6px;display:block;}
.ta-victory h3{font-size:26px;margin:8px 0 6px 0;}
.ta-victory p{margin:6px 0 0 0;font-size:16px;opacity:.9}
.ta-victory .ta-rank-badge{display:inline-flex;align-items:center;gap:8px;background:var(--ta-bg,#eef4fb);border:1px solid rgba(0,0,0,.06);padding:8px 14px;border-radius:999px;margin-top:10px;font-weight:600;}
.ta-victory .ta-close{position:absolute;top:10px;right:12px;background:#f3f5f7;border:none;border-radius:10px;padding:6px 10px;cursor:pointer;font-weight:600}
.ta-victory canvas.ta-confetti{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;}
@media (prefers-reduced-motion:no-preference){
  .ta-victory{animation:taPop .18s ease-out both}
  @keyframes taPop{from{transform:scale(.96);opacity:0}to{transform:scale(1);opacity:1}}
}

.ta-repeat-note{background:#fff3cd;border:1px solid #ffeeba;color:#856404;border-radius:12px;padding:10px 12px;margin:0 0 10px 0;font-weight:600;text-align:center}

/* === Center start content under hero === */
.tabaction-app .tabaction-card.start{ text-align:center; }
.tabaction-app .tabaction-card.start .title-xl,
.tabaction-app .tabaction-card.start .subtitle,
.tabaction-app .tabaction-card.start .tabaction-desc{ margin-left:auto; margin-right:auto; max-width: 720px; }
.tabaction-app .tabaction-card.start .tabaction-team{ display:flex; flex-direction:column; align-items:center; }
.tabaction-app .tabaction-card.start #tabaction-team{ display:block; width:min(520px,96%); margin:6px auto 0; text-align:center; }
.tabaction-app .tabaction-card.start .tabaction-actions{
  width:auto !important;
  max-width:none !important;
  margin: 12px auto 0 !important;
  justify-content: center !important;
  gap: 10px;
}
.tabaction-app .tabaction-card.start #tabaction-show-leaderboard{ margin-left: 0 !important; }


/* === Enhanced feedback highlights === */
.ta-feedback-wrap{ margin-top:10px; }
.ta-correct-badge{ display:inline-block; background:#eaf7ef; border:2px solid #28a745; color:#155724; border-radius:12px; padding:10px 14px; font-weight:800; }
.ta-wrong-badge{ display:inline-block; background:#fdecea; border:2px solid #e53935; color:#8b1c1c; border-radius:12px; padding:10px 14px; font-weight:800; }
.ta-right-answer{ margin-top:8px; font-weight:600; }
.tabaction-card.game .mc label{ border-radius:10px; }
.tabaction-card.game .mc label.ta-correct{ background:#eaf7ef; border:2px solid #28a745; }
.tabaction-card.game .mc label.ta-wrong{ background:#fdecea; border:2px solid #e53935; }
