: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; }


/* --- Congrats overlay --- */
.ta-congrats-overlay{position:fixed;inset:0;background:rgba(15,23,42,.6);display:flex;align-items:center;justify-content:center;z-index:2147483000;padding:16px;}
.ta-congrats-modal{background:#fff;border-radius:18px;box-shadow:0 20px 50px rgba(0,0,0,.25);width:min(520px,92vw);padding:28px 24px;text-align:center;}
.ta-congrats-icon{margin-bottom:12px}
.ta-congrats-title{font-size:1.6rem;line-height:1.2;margin:.25rem 0 .5rem}
.ta-congrats-text{font-size:1rem;color:#334155;margin:0 auto 1rem;max-width:36ch}
.ta-congrats-actions{gap:10px;display:flex;justify-content:center}
@media (prefers-color-scheme: dark){
  .ta-congrats-modal{background:#0b1220;color:#e5e7eb}
  .ta-congrats-text{color:#cbd5e1}
}


/* --- Congrats overlay tweaks (rank + taller) --- */
.ta-congrats-modal{padding:40px 28px 34px;max-height:88vh;overflow:visible}
.ta-congrats-icon svg{display:block;margin:0 auto}


/* --- Start screen: center text + buttons --- */
.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{
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  max-width: 760px;
}
.tabaction-app .tabaction-card.start .tabaction-team{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.tabaction-app .tabaction-card.start .tabaction-team input{
  display: block;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.tabaction-app .tabaction-card.start .tabaction-actions{
  width: min(680px, 96%);
  margin: 40px auto 0; /* 40px Abstand zum Text */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}


/* --- Congrats modal: show full trophy + gold title --- */
.ta-congrats-modal{
  padding-top: 64px !important; /* more top space so trophy isn't clipped */
  overflow: visible !important;
}
.ta-congrats-icon svg{
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto 8px;
}
.ta-congrats-title{
  color: #FFC107 !important; /* gold like the trophy */
  font-weight: 700;
}
@media (prefers-color-scheme: dark){
  .ta-congrats-title{ color:#FFC107 !important; }
}


/* --- Trophy absolute positioning to avoid clipping --- */
.ta-congrats-modal{
  position: relative;
  padding-top: 96px !important; /* plenty of room above the title */
  overflow: visible !important;
}
.ta-congrats-icon{
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}
.ta-congrats-icon svg{
  width: 80px;
  height: 80px;
}


/* --- Feedback badge aligned with actions --- */
.ta-feedback-badge{
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1.125rem; /* ~18px */
  line-height: 1.1;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.ta-feedback-badge.ok{
  background: #E8F7EE;
  color: #166534;
  border-color: rgba(22,101,52,.2);
}
.ta-feedback-badge.bad{
  background: #FDECEC;
  color: #991B1B;
  border-color: rgba(153,27,27,.2);
}
@media (prefers-color-scheme: dark){
  .ta-feedback-badge{ border-color: rgba(255,255,255,.08); box-shadow: none; }
  .ta-feedback-badge.ok{ background: rgba(22,101,52,.2); color: #86efac; }
  .ta-feedback-badge.bad{ background: rgba(153,27,27,.2); color: #fecaca; }
}

/* align badge at left, keep "Weiter" on the right */
.tabaction-app .tabaction-card.game .tabaction-actions{
  display: flex;
  align-items: center;
  gap: 12px;
}
.tabaction-app .tabaction-card.game .tabaction-actions #tabaction-next{
  margin-left: auto;
}
