* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@keyframes deal {
  from { opacity: 0; transform: translateY(40px) scale(0.85); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes play {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateY(-60px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-80px) scale(0.8); }
}

body {
  background: #0f172a;
  color: #f1f5f9;
  font-family: system-ui, sans-serif;
  min-height: 100vh;
}

/* Auth page */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.auth-box {
  width: 100%;
  max-width: 360px;
}

.auth-title {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-title h1 {
  font-size: 2rem;
  color: #22d3ee;
}

.auth-title p {
  color: #94a3b8;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.auth-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1rem;
  padding: 1.5rem;
}

.tab-row {
  display: flex;
  background: #0f172a;
  border-radius: 0.5rem;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}

.tab-row button {
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: none;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-row button.active {
  background: #06b6d4;
  color: #fff;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.field input {
  width: 100%;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: #f1f5f9;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus {
  border-color: #06b6d4;
}

.btn-primary {
  width: 100%;
  background: #06b6d4;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 0.5rem;
}

.btn-primary:hover {
  background: #22d3ee;
}

.msg {
  font-size: 0.8rem;
  margin-top: 0.75rem;
  min-height: 1.2em;
}

.msg.error { color: #f87171; }
.msg.success { color: #4ade80; }

/* Game page */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #1e293b;
}

.game-header h1 {
  color: #22d3ee;
  font-size: 1.25rem;
}

.game-header .user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.game-header .user-info button {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.8rem;
  transition: color 0.15s;
}

.game-header .user-info button:hover {
  color: #f1f5f9;
}

.game-area {
  max-width: 520px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Combatants */
.combatant {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
}

.combatant-name {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.hp-row {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
}

.reel-chance-label {
  color: #06b6d4;
  font-weight: 600;
}

.hp-bar-track {
  background: #0f172a;
  border-radius: 9999px;
  height: 6px;
  overflow: hidden;
}

.hp-bar {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s;
}

.player-bar { background: #22d3ee; width: 100%; }
.enemy-bar  { background: #f87171; width: 100%; }

/* Reel status */
.reel-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.reel-label {
  font-size: 0.78rem;
  color: #64748b;
}

.reel-dots {
  display: flex;
  gap: 0.4rem;
}

.reel-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #334155;
  border: 2px solid #475569;
  transition: background 0.2s;
}

.reel-dot.used {
  background: #ef4444;
  border-color: #ef4444;
}

/* Battle log */
.battle-log {
  min-height: 80px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
}

.log-player { color: #67e8f9; }
.log-enemy  { color: #fca5a5; }

/* Hand */
.hand-area {
  margin-top: 0.5rem;
}

.hand-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 0.6rem;
}

.hand {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.card-slot {
  width: 90px;
  height: 90px;
  border-radius: 0.6rem;
  background: rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: url('../images/fpo_card.png') center / contain no-repeat;
  width: 90px;
  height: 90px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  image-rendering: pixelated;
  transition: transform 0.1s;
  flex-shrink: 0;
}

.card:hover:not(.disabled) {
  transform: translateY(-6px);
}

.card.disabled {
  opacity: 0.4;
  cursor: default;
}

.card-img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  object-fit: contain;
}

.card-name { font-size: 0.65rem; font-weight: 600; color: #94a3b8; }

.card-deal {
  animation: deal 0.25s ease both;
}

.card-playing {
  animation: play 0.3s ease forwards;
  pointer-events: none;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.overlay-box p {
  font-size: 1.75rem;
  font-weight: 700;
}

.overlay-box .btn-primary {
  margin-top: 0;
  width: auto;
  padding: 0.6rem 2rem;
}
