/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --pink: #ff2d95;
  --cyan: #00f0ff;
  --dark: #0a0a12;
  --dark2: #12121e;
  --dark3: #1a1a2e;
  --gold: #ffd700;
  --white: #eef;
  --font: 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
}

html, body {
  width: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--dark);
  color: var(--white);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  min-height: 100dvh;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.screen.active {
  display: flex;
}

/* ===== TITLE SCREEN ===== */
.title-container {
  text-align: center;
  padding: 2rem 1.5rem;
  animation: fadeInUp 0.8s ease;
}
.brand-label {
  font-size: 0.85rem;
  color: var(--pink);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.title-main {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}
.title-sub {
  font-size: 0.6em;
  letter-spacing: 6px;
}
.title-desc {
  font-size: 1rem;
  color: #aab;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.title-desc .en {
  font-size: 0.85rem;
  color: #778;
}
.title-vs-icon {
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  margin: 1rem 0;
  animation: pulse 1.5s ease-in-out infinite;
}
.round-info {
  font-size: 0.85rem;
  color: #667;
  margin-top: 1rem;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-block;
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), #cc1177);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 25px rgba(255, 45, 149, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 35px rgba(255, 45, 149, 0.6);
}
.btn-primary:active {
  transform: scale(0.96);
}
.btn-secondary {
  display: inline-block;
  padding: 0.8rem 2.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyan);
  background: transparent;
  border: 2px solid var(--cyan);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: rgba(0, 240, 255, 0.1);
}
.btn-patreon {
  display: inline-block;
  padding: 0.8rem 2.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff424d, #f96854);
  border: none;
  border-radius: 50px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(249, 104, 84, 0.4);
}
.btn-patreon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(249, 104, 84, 0.6);
}

/* ===== BATTLE SCREEN ===== */
.battle-header {
  width: 100%;
  text-align: center;
  padding: 1rem;
  position: relative;
  z-index: 10;
}
.round-counter {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--cyan);
  position: relative;
}
.round-counter .round-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 4px;
  color: #667;
  margin-top: 0.2rem;
}

.battle-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 900px;
  padding: 0 1rem;
  flex: 1;
  position: relative;
}

.fighter {
  flex: 1;
  max-width: 400px;
  cursor: pointer;
  transition: transform 0.3s, opacity 0.5s;
  text-align: center;
}
.fighter:hover {
  transform: scale(1.03);
}
.fighter:active {
  transform: scale(0.97);
}
.fighter-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid var(--dark3);
  transition: border-color 0.3s, box-shadow 0.3s;
  aspect-ratio: 3 / 4;
}
.fighter-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fighter-glow {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.fighter-label {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #889;
}

/* Vote result states */
.fighter.winner .fighter-frame {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.3);
}
.fighter.winner .fighter-glow {
  opacity: 1;
  background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
  animation: glowPulse 0.8s ease-in-out infinite alternate;
}
.fighter.winner .fighter-label {
  color: var(--gold);
}
.fighter.loser {
  opacity: 0.35;
  transform: scale(0.95);
}
.fighter.loser .fighter-frame {
  border-color: #333;
}

/* VS Badge */
.vs-badge {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.vs-badge span {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
  animation: pulse 2s ease-in-out infinite;
}
.vs-badge.dramatic span {
  animation: vsDramatic 0.6s ease;
}

.tap-hint {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  color: #556;
  animation: fadeInUp 0.5s ease 0.3s both;
}

/* Slide transition */
.battle-arena.slide-out {
  animation: slideOut 0.4s ease forwards;
}
.battle-arena.slide-in {
  animation: slideIn 0.4s ease forwards;
}

/* ===== RESULT SCREEN ===== */
.result-container {
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 600px;
  width: 100%;
  animation: fadeInUp 0.6s ease;
}
.result-title {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}
.result-title .en {
  font-size: 0.6em;
  display: block;
}

/* Favorite section */
.favorite-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 45, 149, 0.05));
  border: 2px solid var(--gold);
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
}
.favorite-label {
  font-size: 0.9rem;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 1rem;
  font-weight: 700;
}
.favorite-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.favorite-card img {
  width: 150px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}
.favorite-name {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--gold);
}
.favorite-votes {
  font-size: 0.85rem;
  color: #aab;
}

/* Ranking */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 1rem;
  background: var(--dark2);
  border-radius: 12px;
  transition: transform 0.2s;
  animation: fadeInUp 0.4s ease both;
}
.rank-item:nth-child(1) { border-left: 3px solid var(--gold); }
.rank-item:nth-child(2) { border-left: 3px solid #c0c0c0; }
.rank-item:nth-child(3) { border-left: 3px solid #cd7f32; }
.rank-number {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--cyan);
  min-width: 2rem;
}
.rank-item:nth-child(1) .rank-number { color: var(--gold); }
.rank-item:nth-child(2) .rank-number { color: #c0c0c0; }
.rank-item:nth-child(3) .rank-number { color: #cd7f32; }
.rank-thumb {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border-radius: 8px;
}
.rank-name {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
  text-align: left;
}
.rank-votes {
  font-size: 0.8rem;
  color: var(--pink);
  font-weight: 700;
}
.rank-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.rank-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--dark3);
  border-radius: 3px;
  overflow: hidden;
}
.rank-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  transition: width 1s ease;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: center;
}
.btn-share {
  font-size: 1rem;
  padding: 0.8rem 2.5rem;
}

/* ===== PATREON BANNER ===== */
.patreon-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.7rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff424d, #f96854);
  text-decoration: none;
  z-index: 100;
  box-shadow: 0 -2px 15px rgba(249, 104, 84, 0.4);
  transition: transform 0.3s;
}
.patreon-banner:hover {
  transform: translateY(-2px);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
@keyframes glowPulse {
  from { opacity: 0.5; }
  to { opacity: 1; }
}
@keyframes vsDramatic {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.5); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-60px); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes rankSlideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .battle-arena {
    flex-direction: row;
    gap: 0.3rem;
    padding: 0 0.5rem;
  }
  .fighter-frame {
    border-radius: 12px;
    border-width: 2px;
  }
  .vs-badge {
    width: 40px;
    height: 40px;
  }
  .vs-badge span {
    font-size: 1.3rem;
  }
  .btn-primary {
    padding: 0.85rem 2rem;
    font-size: 1.05rem;
  }
  .favorite-card img {
    width: 120px;
    height: 160px;
  }
}

/* Bottom padding for Patreon banner */
body {
  padding-bottom: 50px;
}
