/* --- NEW BATTLE INTERFACE (Street Fighter Style) --- */

/* --- SETUP SCREEN COLOR ALIGNMENT --- */

#screen-1-setup.flow-panel {
  background: linear-gradient(160deg, rgba(36, 21, 23, 0.78), rgba(20, 12, 14, 0.74));
  border: 0.0625rem solid rgba(245, 182, 116, 0.28);
  box-shadow: 0 0.625rem 1.75rem rgba(0, 0, 0, 0.34);
}

#screen-1-setup h2 {
  color: #f6ddb1;
  text-shadow: 0 0.125rem 0.875rem rgba(255, 173, 91, 0.16);
}

#screen-1-setup label {
  color: #efd0a4;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

#screen-1-setup input {
  background: rgba(36, 38, 58, 0.64);
  border: 0.0625rem solid rgba(158, 140, 128, 0.55);
  color: #f2efe9;
  border-radius: 0.75rem;
  box-shadow: inset 0 0.0625rem 0 rgba(255, 255, 255, 0.05);
}

#screen-1-setup input:focus {
  border-color: rgba(130, 188, 255, 0.95);
  box-shadow: 0 0 0 0.125rem rgba(130, 188, 255, 0.2);
  background: rgba(36, 38, 58, 0.78);
}

#screen-1-setup #start-battle {
  background: rgba(11, 7, 8, 0.88);
  border: 0.0625rem solid rgba(210, 145, 72, 0.72);
  color: #f4dcb0;
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1.375rem rgba(0, 0, 0, 0.42);
}

#screen-1-setup #start-battle:hover {
  background: rgba(20, 12, 14, 0.92);
  border-color: rgba(231, 166, 89, 0.88);
  box-shadow: 0 0.625rem 1.5rem rgba(0, 0, 0, 0.46);
  transform: translateY(-0.0625rem);
}

/* --- QUERIES SCREEN COLOR ALIGNMENT --- */

#screen-3-queries.flow-panel {
  background: linear-gradient(160deg, rgba(34, 20, 22, 0.76), rgba(18, 10, 12, 0.72));
  border: 0.0625rem solid rgba(245, 182, 116, 0.3);
  box-shadow: 0 0.75rem 1.875rem rgba(0, 0, 0, 0.34);
  text-align: center;
}

#screen-3-queries h2 {
  color: #f4ddb0;
  font-size: clamp(2.1rem, 6vw, 3.2rem);
  margin-bottom: 1.1rem;
}

#screen-3-queries .warmup-brands {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

#screen-3-queries .warmup-brand-card {
  border: 0.0625rem solid rgba(245, 182, 116, 0.28);
  border-radius: 0.75rem;
  background: rgba(18, 10, 12, 0.52);
  padding: 0.9rem 1rem;
}

#screen-3-queries .warmup-brand-card h3 {
  color: #f2d7ab;
  margin-bottom: 0.35rem;
}

#screen-3-queries .warmup-brand-card p {
  color: #f8e7cc;
  font-weight: 700;
  font-size: clamp(1.1rem, 2.8vw, 1.45rem);
  margin: 0;
}

#screen-3-queries .warmup-meta {
  color: #efd0a4;
  font-weight: 700;
  margin: 0.35rem 0;
}

#screen-3-queries .warmup-queries-panel {
  border: 0.0625rem solid rgba(245, 182, 116, 0.28);
  border-radius: 0.75rem;
  background: rgba(18, 10, 12, 0.5);
  padding: 0.9rem 1rem;
  margin: 1rem 0 0.85rem;
}

#screen-3-queries .warmup-queries-panel h3 {
  color: #f2d7ab;
  margin: 0 0 0.55rem;
}

#screen-3-queries .warmup-queries-panel p {
  color: #efd0a4;
  margin: 0 0 0.55rem;
}

#screen-3-queries #queries-list {
  color: #f8e7cc;
  margin: 0;
  text-align: left;
  display: inline-block;
}

#screen-3-queries #queries-list li {
  margin-bottom: 0.35rem;
  font-weight: 700;
}

#screen-3-queries .queries-loading-status {
  color: #f2d7ab;
  font-style: normal;
}

#screen-3-queries #start-rounds {
  background: rgba(12, 8, 10, 0.9);
  border: 0.0625rem solid rgba(214, 151, 76, 0.75);
  color: #f4ddb0;
  border-radius: 0.625rem;
  min-width: min(92vw, 10rem);
  padding: 0.65rem 1.35rem;
}

#screen-3-queries #start-rounds:hover:not(:disabled) {
  background: rgba(22, 12, 15, 0.92);
  border-color: rgba(235, 173, 96, 0.9);
}

@media (min-width: 56.25rem) {
  #screen-3-queries .warmup-brands {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- ROUND SCREEN ALIGNMENT --- */

#screen-4-round.flow-panel {
  background: linear-gradient(160deg, rgba(34, 20, 22, 0.76), rgba(18, 10, 12, 0.72));
  border: 0.0625rem solid rgba(245, 182, 116, 0.3);
  box-shadow: 0 0.75rem 1.875rem rgba(0, 0, 0, 0.34);
  text-align: center;
}

#screen-4-round #round-title {
  color: #f4ddb0;
  font-size: clamp(2.1rem, 6vw, 3.2rem);
  margin: 0.35rem 0 0.75rem;
}

#screen-4-round .round-query-wrap {
  display: flex;
  justify-content: flex-end;
  margin: 0.35rem 0 0.75rem;
}

#screen-4-round .round-query-box {
  width: min(100%, 18rem);
  border: 0.0625rem solid rgba(214, 151, 76, 0.65);
  border-radius: 0.75rem;
  background: rgba(18, 10, 12, 0.6);
  padding: 0.75rem 0.85rem;
  text-align: left;
}

#screen-4-round .round-query-box h3 {
  margin: 0 0 0.25rem;
  color: #f2d7ab;
  font-size: 1.05rem;
}

#screen-4-round #current_query {
  margin: 0;
  color: #f8e7cc;
  font-weight: 700;
  line-height: 1.35;
}

#screen-4-round .round-answer-panel {
  width: min(100%, 44rem);
  margin-left: 0;
  margin-right: auto;
  text-align: left;
}

#screen-4-round .round-answer-panel h3 {
  margin: 0 0 0.45rem;
  color: #f2d7ab;
}

#screen-4-round #llm_answer_raw {
  margin: 0 0 0.55rem;
  color: #f8e7cc;
  line-height: 1.45;
}

#round-score-table {
  width: 100%;
  border-collapse: collapse;
}

#round-score-table th,
#round-score-table td {
  border: 0.0625rem solid rgba(214, 151, 76, 0.38);
  padding: 0.5rem 0.6rem;
  color: #f8e7cc;
}

#round-score-table thead th {
  background: rgba(214, 151, 76, 0.2);
  color: #f4ddb0;
  text-align: center;
}

#round-score-table tbody th {
  width: 40%;
  text-align: left;
  color: #efd0a4;
  background: rgba(20, 12, 14, 0.44);
}

#round-score-table tbody td {
  text-align: center;
  font-weight: 700;
}

#screen-4-round .round-first-mentioned {
  margin: 0.55rem 0 0;
  color: #efd0a4;
  font-weight: 700;
}

.battle-header-new {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 1000px;
  max-width: 100%;
  margin: 20px auto 40px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  border: 3px solid rgba(255, 200, 0, 0.8);
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(255, 200, 0, 0.3);
  position: relative;
}

.fighter-stats {
  flex: 1;
  text-align: center;
}

.fighter-name {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.fighter-score {
  font-size: 48px;
  font-weight: 700;
  color: #ffc800;
  text-shadow: 0 0 20px rgba(255, 200, 0, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-family: 'Impact', 'Arial Black', sans-serif;
  animation: scoreGlow 0.3s ease;
}

@keyframes scoreGlow {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.fighter-indicator {
  height: 8px;
  margin: 10px auto 0;
  width: 80%;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.brand-a-color {
  background: linear-gradient(90deg, #cb2052, #ff4d78);
}

.brand-b-color {
  background: linear-gradient(90deg, #6b155c, #ab56a7);
}

.battle-progress {
  flex: 0 0 auto;
  text-align: center;
  padding: 0 30px;
}

.vs-badge {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 200, 0, 0.8), 3px 3px 6px rgba(0, 0, 0, 0.9);
  margin-bottom: 8px;
  font-family: 'Impact', 'Arial Black', sans-serif;
}

.question-progress {
  font-size: 20px;
  font-weight: 600;
  color: #ffc800;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* --- WINNER STAMP --- */

.winner-stamp {
 position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0) rotate(-15deg);
  z-index: 1000;
  text-align: center;
  pointer-events: none;
}

.winner-stamp.show {
  animation: stampIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes stampIn {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-15deg);
    opacity: 0;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.2) rotate(-8deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(-12deg);
    opacity: 1;
  }
}

.stamp-text {
  font-size: 72px;
  font-weight: 900;
  color: #ff0000;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
  -webkit-text-stroke: 3px #fff;
  font-family: 'Impact', 'Arial Black', sans-serif;
  letter-spacing: 4px;
}

.stamp-brand {
  font-size: 56px;
  font-weight: 900;
  color: #ffc800;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
  -webkit-text-stroke: 2px #fff;
  font-family: 'Impact', 'Arial Black', sans-serif;
  margin-top: 10px;
}

/* --- VICTORY BANNER (Street Fighter End Screen Style) --- */

.victory-banner {
  width: 1000px;
  max-width: 100%;
  margin: 0 auto 30px;
  padding: 20px 30px;
  background: rgba(0, 0, 0, 0.7);
  border: 3px solid rgba(255, 200, 0, 0.9);
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(255, 200, 0, 0.4), inset 0 0 20px rgba(255, 200, 0, 0.1);
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.5s ease;
}

.victory-banner:not(.hidden) {
  transform: translateY(0);
  opacity: 1;
}

.victory-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.victory-text {
  flex: 0 0 auto;
}

.victory-title {
  font-size: 36px;
  font-weight: 900;
  color: #ffc800;
  text-shadow: 0 0 20px rgba(255, 200, 0, 0.8), 3px 3px 6px rgba(0, 0, 0, 0.9);
  font-family: 'Impact', 'Arial Black', sans-serif;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.victory-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 200, 0, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.victory-cta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cta-message {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  line-height: 1.4;
}

.victory-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cta-btn, .share-btn, .new-battle-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.cta-btn {
  background: linear-gradient(135deg, #ffc800 0%, #ff9500 100%);
  color: #000;
  border: 2px solid #ffc800;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 200, 0, 0.5);
}

.share-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffc800;
  border: 2px solid rgba(255, 200, 0, 0.5);
}

.share-btn:hover {
  background: rgba(255, 200, 0, 0.2);
  border-color: #ffc800;
}

.new-battle-btn {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.new-battle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

/* --- QA TIMELINE --- */

.qa-timeline {
  width: 1000px;
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 0;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.qa-item {
  margin-bottom: 20px;
  opacity: 0;
  transform: translateX(100px);
  animation: slideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: transform 0.4s ease, margin 0.4s ease;
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.qa-item.collapsed .qa-answer {
  max-height: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.qa-item:not(.collapsed) .qa-answer {
  max-height: 1000px;
  opacity: 1;
  transition: all 0.5s ease;
}

.qa-question {
  background: rgba(26, 28, 37, 0.6);
  backdrop-filter: blur(16px);
  padding: 16px 20px;
  border-radius: 12px;
  border: 2px solid rgba(255, 200, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 12px;
}

.qa-question:hover {
  border-color: rgba(255, 200, 0, 0.6);
  box-shadow: 0 0 20px rgba(255, 200, 0, 0.2);
}

.qa-question-number {
  font-size: 14px;
  color: #ffc800;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.qa-question-text {
  font-size: 18px;
  color: #fff;
  margin: 0;
  line-height: 1.4;
}

.qa-answer {
  background: rgba(18, 20, 27, 0.8);
  backdrop-filter: blur(12px);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 12px;
}

.qa-answer-text {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.4);
  margin: 0 0 16px;
  min-height: 50px;
}

.qa-answer-text span {
  transition: color 0.05s ease;
}

.qa-answer-text .reading {
  color: rgba(255, 255, 255, 0.95);
}

.qa-answer-text .brand-a-mention {
  color: #ff4d78;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 77, 120, 0.6);
  animation: brandPulse 0.3s ease;
}

.qa-answer-text .brand-b-mention {
  color: #ab56a7;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(171, 86, 167, 0.6);
  animation: brandPulse 0.3s ease;
}

@keyframes brandPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.qa-score-summary {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.qa-brand-score {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.qa-brand-score.brand-a {
  background: rgba(203, 32, 82, 0.1);
  border: 1px solid rgba(203, 32, 82, 0.3);
}

.qa-brand-score.brand-b {
  background: rgba(171, 86, 167, 0.1);
  border: 1px solid rgba(171, 86, 167, 0.3);
}

.qa-brand-score.winner {
  box-shadow: 0 0 20px rgba(255, 200, 0, 0.4);
  border-color: rgba(255, 200, 0, 0.6);
}

.qa-brand-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.qa-brand-score.brand-a .qa-brand-name {
  color: #ff4d78;
}

.qa-brand-score.brand-b .qa-brand-name {
  color: #ab56a7;
}

.qa-brand-points {
  font-size: 24px;
  font-weight: 700;
  color: #ffc800;
  margin-bottom: 4px;
}

.qa-brand-mentions {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* --- SCREEN SHAKE --- */

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  10%, 30%, 50%, 70%, 90% { transform: translate(-10px, 0); }
  20%, 40%, 60%, 80% { transform: translate(10px, 0); }
}

.shake {
  animation: screenShake 0.5s ease;
}
