/* --- COLOR VARIABLES & CORE CONFIG --- */
:root {
  --bg-page: #07070c;
  --bg-darker: #040407;
  --bg-panel: rgba(22, 22, 38, 0.7);
  --border-soft: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(230, 57, 70, 0.25);
  
  /* Text */
  --text-main: #f1faee;
  --text-muted: #94a3b8;
  --text-highlight: #38bdf8;
  
  /* Accents */
  --accent: #e63946;
  --accent-glow: #ff007f;
  --accent-blue: #0ea5e9;
  --accent-def: #00f2fe;
  
  /* Rarities */
  --gold: #ffd700;
  --rare: #4a90d9;
  --epic: #a855f7;
  --legendary: #f39c12;
  
  /* Card Dims */
  --card-width: 320px;
  --card-height: 480px;
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-neon: 0 0 15px rgba(230, 57, 70, 0.3);
}

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

body {
  font-family: "Rajdhani", "Oswald", sans-serif;
  background: radial-gradient(circle at top, #151528 0%, var(--bg-page) 60%, var(--bg-darker) 100%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(230, 57, 70, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(230, 57, 70, 0.6);
}

/* Utility Containers */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Glassmorphism */
.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* Buttons System */
button {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #991b1b);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 57, 70, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(135deg, #4a90d9, #2c5f8a);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(74, 144, 217, 0.3);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 217, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
}
.btn-secondary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #991b1b);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-retire {
  background: linear-gradient(135deg, #ffd700, #f39c12);
  color: #000;
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
  font-weight: bold;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}
.btn-retire:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
}
.btn-retire:disabled {
  background: rgba(100, 100, 100, 0.3);
  color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: none;
  cursor: not-allowed;
}

/* UEC Tabs */
.uec-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-panel);
  border-radius: 12px;
  padding: 4px;
  border: 1px solid var(--border-soft);
}
.uec-tab {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.uec-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(230, 57, 70, 0.3);
}
.uec-tab:hover:not(.active) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.uec-tab-content {
  display: none;
}
.uec-tab-content.active {
  display: block;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.72rem;
  border-radius: 4px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Hide helper */
.hidden {
  display: none !important;
}

.hidden-auth {
  display: none !important;
}

.auth-active .hidden-auth:not(.admin-only) {
  display: flex !important;
}
.auth-active button.hidden-auth:not(.admin-only) {
  display: inline-flex !important;
}
.auth-active div.hidden-auth:not(.admin-only) {
  display: block !important;
}

.admin-only {
  display: none !important;
}
.is-admin .admin-only {
  display: flex !important;
}

/* --- NAVBAR STYLING --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  padding: 10px 0;
  margin-bottom: 25px;
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}
.nav-brand {
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.brand-uec {
  font-family: "Oswald", sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  line-height: 1;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.05em;
}
.brand-sub {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.25em;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  gap: 8px;
}
.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-item:hover, .nav-item.active {
  color: #fff;
  background: rgba(230, 57, 70, 0.15);
  box-shadow: inset 0 0 5px rgba(230, 57, 70, 0.2);
}

.nav-wallet {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wallet-details {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.8rem;
}
.wallet-balances {
  display: flex;
  gap: 8px;
  margin-bottom: 2px;
}
.balance-item {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-family: "Oswald", sans-serif;
  font-size: 0.75rem;
}
.uec-token {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
}
.sol-token {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(14, 165, 233, 0.3);
}
.wallet-address {
  font-family: monospace;
  color: var(--text-muted);
}

/* --- VIEW MANAGER --- */
.view-section {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}
.view-section.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- HERO & LANDING --- */
.hero-section {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
  text-align: center;
  padding: 40px 0 80px;
}
@media (max-width: 768px) {
  .hero-section { padding-bottom: 40px; }
}
.hero-title {
  font-family: "Oswald", sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff, #ff80ab, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-tagline {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin: 0 auto 30px auto;
  max-width: 600px;
  line-height: 1.6;
}
.hero-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.floating-card-wrapper {
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50% { transform: translateY(-15px) rotate(-2deg); }
}

/* Showcase Card Mock */
.showcase-card {
  width: var(--card-width);
  background: linear-gradient(145deg, #221a35, #0f0b1a);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 3px solid var(--epic);
  box-shadow: 0 10px 40px rgba(168, 85, 247, 0.3);
  position: relative;
  font-family: "Rajdhani", sans-serif;
}
.epic-glow {
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.4), inset 0 0 15px rgba(168, 85, 247, 0.2);
}
.showcase-card-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.showcase-card-header {
  display: flex;
  justify-content: space-between;
  font-family: "Oswald", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
}
.showcase-card-title {
  font-family: "Oswald", sans-serif;
  font-size: 1.4rem;
  text-align: center;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
}
.showcase-card-moves {
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.showcase-card-moves div {
  display: flex;
  justify-content: space-between;
}
.showcase-card-footer {
  display: flex;
  justify-content: space-between;
  font-family: "Oswald", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 60px;
}
.feature-card {
  padding: 30px;
  text-align: center;
}
.feature-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(230, 57, 70, 0.3);
}
.feature-card h3 {
  font-family: "Oswald", sans-serif;
  font-size: 1.3rem;
  margin-bottom: 10px;
}
.feature-card p {
  color: var(--text-muted);
}

/* CGU & Rules */
.cgu-section {
  padding: 40px;
  margin-bottom: 60px;
}
.cgu-section h2 {
  font-family: "Oswald", sans-serif;
  font-size: 2rem;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px;
}
.cgu-content h3 {
  font-family: "Oswald", sans-serif;
  font-size: 1.1rem;
  margin: 20px 0 10px;
  color: #fff;
}
.cgu-content p, .cgu-content ul {
  color: var(--text-muted);
  margin-bottom: 15px;
  padding-left: 10px;
}
.cgu-content li {
  margin-bottom: 8px;
}

/* --- DASHBOARD VIEW --- */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 25px;
}
@media (max-width: 992px) {
  .dashboard-layout { grid-template-columns: 1fr; }
}

.panel {
  padding: 24px;
  margin-bottom: 25px;
  position: relative;
  overflow: hidden;
}
.panel h2 {
  font-family: "Oswald", sans-serif;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Active Fighter Panel */
.active-fighter-wrapper {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}
.matchmaking-panel {
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border-soft);
  margin-top: 15px;
}
.matchmaking-panel h3 {
  font-family: "Oswald", sans-serif;
  font-size: 1.05rem;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.matchmaking-banner {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.matchmaking-banner i {
  color: #ffc107;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.matchmaking-banner strong {
  color: #ffc107;
}
.matchmaking-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.matchmaking-buttons button {
  height: 60px;
  flex-direction: column;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.2;
}
.matchmaking-buttons button small {
  font-weight: 400;
  opacity: 0.7;
}

.matchmaking-status {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid var(--accent);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-top: 15px;
}
.mini-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.search-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
}

/* Data Tables */
.table-container {
  overflow-x: auto;
  width: 100%;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.data-table th {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.match-row {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.match-row:active {
  background: rgba(230, 57, 70, 0.1) !important;
}
.no-data {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
}

/* Empty Gym CTA */
.empty-gym-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
.empty-gym-cta i {
  font-size: 56px;
  color: var(--accent-warning);
  opacity: 0.6;
}
.empty-gym-cta h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin: 0;
}
.empty-gym-cta p {
  color: var(--text-muted);
  margin: 0;
  max-width: 400px;
}
.empty-gym-cta .btn-primary {
  margin-top: 8px;
  padding: 12px 24px;
  font-size: 1rem;
}
.active-fighter-container.empty-gym {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Notifications sidebar */
.notifications-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notif-item {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent);
  padding: 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
}
.notif-item.unread {
  background: rgba(230, 57, 70, 0.08);
  border-left-color: var(--accent-glow);
}
.notif-title {
  font-weight: 700;
  font-family: "Oswald", sans-serif;
  color: #fff;
  margin-bottom: 2px;
}
.notif-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

/* Online players list */
.online-users-list {
  list-style: none;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.online-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  margin-right: 6px;
}

/* Private chat logs */
.private-chat-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.chat-conversations {
  max-height: 120px;
  overflow-y: auto;
}
.convo-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.convo-item:hover, .convo-item.active {
  background: rgba(230, 57, 70, 0.15);
}
.chat-box {
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  height: 280px;
}
.chat-header {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg-bubble {
  max-width: 80%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.msg-bubble.sent {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
}
.msg-bubble.received {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}
.msg-sender {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}
.msg-bubble.sent .msg-sender {
  display: none;
}
.chat-input-row {
  display: flex;
  padding: 6px;
  gap: 6px;
  border-top: 1px solid var(--border-soft);
}
.chat-input-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 6px;
  color: #fff;
  font-family: "Rajdhani", sans-serif;
}

/* --- GYMNASE VIEW --- */
.gym-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
}
.gym-capacity-box {
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.gym-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 25px;
}
@media (max-width: 768px) {
  .gym-layout { grid-template-columns: 1fr; }
}

.gym-fighters-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 70vh;
  overflow-y: auto;
}
.gym-fighter-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: all 0.2s;
}
.gym-fighter-item:hover, .gym-fighter-item.active {
  background: rgba(230, 57, 70, 0.08);
  border-color: var(--accent);
}
.gym-fighter-item.active {
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.2);
}

.f-item-pic {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}
.lb-fighter-pic {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: 50% 15%;
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.f-item-details {
  flex: 1;
  min-width: 0;
}
.f-item-name {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f-item-rarity {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 800;
}
.f-item-wins {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Gym Editor Panel */
.gym-editor {
  padding: 24px;
}
.editor-no-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: var(--text-muted);
  gap: 15px;
}
.editor-no-selection i {
  font-size: 4rem;
  opacity: 0.3;
}

.editor-split {
  display: grid;
  grid-template-columns: var(--card-width) 1fr;
  gap: 30px;
}
@media (max-width: 992px) {
  .editor-split { grid-template-columns: 1fr; }
}

.editor-visual-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}
.card-canvas-wrapper {
  perspective: 1000px;
}

.card-buttons-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.card-buttons-row button {
  flex: 1;
}

/* Editor control column styling */
.editor-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 15px;
  border: 1px solid var(--border-soft);
  margin-bottom: 15px;
}
.section-title-editor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.section-title-editor h3 {
  font-family: "Oswald", sans-serif;
  font-size: 1.15rem;
}
.badge-points {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: "Oswald", sans-serif;
}
.section-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Deck builder */
.deck-builder-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 15px;
  max-height: 400px;
  overflow-y: auto;
}
.deck-card-row {
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.deck-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.deck-card-name {
  font-size: 0.85rem;
  font-weight: 700;
}
.deck-card-stats {
  font-size: 0.7rem;
  color: #999;
}
.deck-card-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.deck-card-controls button {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.deck-card-controls button:hover {
  background: var(--accent);
}
.deck-card-qty {
  font-weight: 800;
  font-size: 1rem;
  color: var(--gold);
  min-width: 20px;
  text-align: center;
}

/* Points allocation grid (legacy, gardé pour compat) */
.points-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
}
.point-control-card {
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.p-card-label {
  font-size: 0.8rem;
  font-weight: 700;
}
.p-control-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.p-control-btn-group button {
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
}
.p-control-btn-group button:hover {
  background: var(--accent);
  color: #fff;
}
.val-points {
  font-weight: 800;
  font-size: 1rem;
  color: var(--gold);
  width: 15px;
  text-align: center;
}
.editor-actions {
  display: flex;
  gap: 10px;
}
.editor-actions button {
  flex: 1;
}

.rarity-upgrades-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.rarity-upgrade-btn {
  flex-direction: column;
  height: 52px;
  padding: 6px;
  font-size: 0.8rem;
}
.rarity-upgrade-btn small {
  font-weight: 400;
  opacity: 0.8;
}
.rare-btn {
  border: 1px solid var(--rare);
  background: rgba(74, 144, 217, 0.1);
  color: var(--rare);
}
.rare-btn:hover {
  background: var(--rare);
  color: #fff;
}
.epic-btn {
  border: 1px solid var(--epic);
  background: rgba(168, 85, 247, 0.1);
  color: var(--epic);
}
.epic-btn:hover {
  background: var(--epic);
  color: #fff;
}
.legendary-btn {
  border: 1px solid var(--legendary);
  background: rgba(243, 156, 18, 0.1);
  color: var(--legendary);
}
.legendary-btn:hover {
  background: var(--legendary);
  color: #fff;
}

.input-with-btn {
  display: flex;
  gap: 8px;
}
.input-with-btn input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: #fff;
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  outline: none;
}
.input-with-btn input:focus {
  border-color: var(--accent);
}

/* --- THE GAME FIGHT CARD CANVAS (PRECISE REPLICATION) --- */
.card-canvas {
  position: relative;
  width: var(--card-width);
  height: var(--card-height);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  background: radial-gradient(circle at top, #2b2d42 0, #131324 45%, #05050a 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  isolation: isolate;
  user-select: none;
}
.card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.25;
  z-index: -2;
  transition: all 0.3s;
}
.card-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(230, 57, 70, 0.08) 0, transparent 40%),
              linear-gradient(to bottom, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.35));
  z-index: -1;
}
.card-filter {
  position: absolute;
  inset: 0;
  z-index: 10; /* Place on top of card inner content to act as an overlay frame */
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  border-radius: 12px;
  overflow: hidden; /* Ensure pseudo-elements stay inside */
}

/* --- RARE (Icy Blue, Silver flare) --- */
.card-filter.rare-filter {
  box-shadow: inset 0 0 40px rgba(74, 144, 217, 0.4), inset 0 0 0 3px rgba(74, 144, 217, 0.8), inset 0 0 0 4px rgba(255, 255, 255, 0.3);
}
.card-filter.rare-filter::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -100%;
  width: 60%;
  background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.7) 50%, transparent 100%);
  transform: skewX(-30deg);
  animation: rareShine 3.5s infinite linear;
  mix-blend-mode: overlay;
}
@keyframes rareShine {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* --- EPIC (Deep Magenta, Pulsing energy) --- */
.card-filter.epic-filter {
  box-shadow: inset 0 0 50px rgba(168, 85, 247, 0.5), inset 0 0 0 3px #a855f7, inset 0 0 0 4px rgba(255, 150, 255, 0.4);
  animation: epicPulse 2.5s ease-in-out infinite alternate;
}
.card-filter.epic-filter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(168, 85, 247, 0.5) 0%, transparent 40%),
              radial-gradient(circle at 0% 100%, rgba(168, 85, 247, 0.5) 0%, transparent 40%);
  mix-blend-mode: color-dodge;
  border-radius: inherit;
  animation: epicEnergy 4s ease-in-out infinite alternate;
}
@keyframes epicPulse {
  0% { box-shadow: inset 0 0 50px rgba(168, 85, 247, 0.5), inset 0 0 0 3px #a855f7; }
  100% { box-shadow: inset 0 0 90px rgba(168, 85, 247, 0.8), inset 0 0 0 3px #c084fc; }
}
@keyframes epicEnergy {
  0% { opacity: 0.5; filter: hue-rotate(0deg); }
  100% { opacity: 1; filter: hue-rotate(30deg); }
}

/* --- LEGENDARY (Gold, Holographic Foil, Sunburst) --- */
.card-filter.legendary-filter {
  box-shadow: inset 0 -40px 100px rgba(243, 156, 18, 0.5), inset 0 0 0 4px #f39c12, inset 0 0 0 6px rgba(255, 235, 100, 0.5);
}
.card-filter.legendary-filter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, 
    rgba(255, 215, 0, 0.2) 0%, 
    rgba(255, 100, 100, 0.2) 25%, 
    rgba(100, 255, 100, 0.2) 50%, 
    rgba(100, 100, 255, 0.2) 75%, 
    rgba(255, 215, 0, 0.2) 100%);
  background-size: 400% 400%;
  animation: foilShimmer 8s ease-in-out infinite alternate;
  mix-blend-mode: color-dodge;
  border-radius: inherit;
  z-index: 2;
}
@keyframes foilShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.card-filter.active {
  opacity: 1;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  color: #fff;
  z-index: 2;
}

.card-stats-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 0.65rem;
  border: 1px solid rgba(255,255,255,0.25);
}
.stat-hp {
  background: linear-gradient(135deg, rgba(220, 20, 60, 0.8), rgba(130, 5, 20, 0.9));
  box-shadow: 0 0 8px rgba(220, 20, 60, 0.3);
}
.stat-end {
  background: linear-gradient(135deg, rgba(255, 180, 0, 0.85), rgba(180, 100, 0, 0.95));
  color: #000;
}
.stat-value {
  font-size: 0.78rem;
  font-weight: 800;
}

.card-frame {
  position: relative;
  flex: 1;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 3px;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.03) 0, rgba(0, 0, 0, 0.30) 60%);
  backdrop-filter: blur(1.5px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.card-fighter-name {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  font-family: "Oswald", sans-serif;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.8), 0 0 15px var(--border-glow);
  margin-bottom: 2px;
}

.card-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.card-image-container {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1 / 1.1; /* slightly taller than square to match typical portraits */
  margin: auto 0; /* center vertically in the remaining card space */
  display: flex;
  flex-direction: column;
}
.card-image-wrapper {
  flex: 1;
  min-height: 0;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.05) 0, rgba(0, 0, 0, 0.30) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%; /* Usually faces are near the top, this helps frame them well */
  display: block;
}
.card-image-placeholder {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  opacity: 0.6;
}

.card-moves-box {
  flex: 0 0 35%;
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  margin-bottom: 2px;
}
.move-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  line-height: 1.3;
}
.move-line:last-child {
  border-bottom: none;
}
.move-label {
  color: var(--accent);
  font-weight: 700;
  font-family: "Oswald", sans-serif;
  font-size: 0.68rem;
  min-width: 24px;
}
.move-name {
  color: #fff;
  font-weight: 700;
  flex: 1;
  padding-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.68rem;
}
.move-damage {
  color: #ff6b6b;
  font-weight: 700;
  font-family: "Oswald", sans-serif;
  padding-right: 6px;
  font-size: 0.68rem;
}
.move-cost {
  color: var(--gold);
  font-weight: 700;
  font-family: "Oswald", sans-serif;
  font-size: 0.68rem;
}
.move-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  margin: 1px 0;
}

.card-stats-box {
  flex: 0 0 auto;
  background: rgba(0, 0, 0, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 6px;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
  margin-bottom: 2px;
}
.stats-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stats-left {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 2px;
}
.stat-num {
  color: var(--gold);
  font-family: "Oswald", sans-serif;
  font-weight: 800;
}
.weight-class {
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--gold);
  font-family: "Oswald", sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  text-align: center;
  margin: 0 auto;
}

/* Badges valeur et amÃ©liorations sur les cartes */
.card-value-badge {
  font-size: 0.52rem;
  color: var(--gold);
  text-align: center;
  padding: 1px 0;
  font-family: "Oswald", sans-serif;
  opacity: 0.9;
}
.card-fighter-balance {
  font-size: 0.52rem;
  color: #ffd700;
  text-align: center;
  padding: 1px 0;
  font-family: "Oswald", sans-serif;
  opacity: 0.95;
  font-weight: 600;
}
.card-upgrades-badges {
  display: flex;
  justify-content: center;
  gap: 3px;
  padding: 1px 0;
}
.upgrade-badge-sm {
  font-size: 0.42rem;
  font-weight: 800;
  font-family: "Oswald", sans-serif;
  padding: 0 3px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.upgrade-badge-sm.rare { background: rgba(74, 144, 217, 0.3); color: #4a90d9; border: 1px solid rgba(74, 144, 217, 0.5); }
.upgrade-badge-sm.epic { background: rgba(168, 85, 247, 0.3); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.5); }
.upgrade-badge-sm.legendary { background: rgba(243, 156, 18, 0.3); color: #f39c12; border: 1px solid rgba(243, 156, 18, 0.5); }

/* Badge "Sur le marché" dans le gymnase visite */
.market-badge-visit {
  display: inline-block;
  background: rgba(14, 165, 233, 0.2);
  color: var(--accent-blue);
  border: 1px solid rgba(14, 165, 233, 0.4);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.55rem;
  font-weight: 700;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-left: 4px;
  vertical-align: middle;
}

/* --- MARCHÉ VIEW --- */
.market-filters {
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}
@media (max-width: 768px) {
  .market-filters { flex-direction: column; align-items: stretch; }
}

.search-bar {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-bar input {
  background: transparent;
  border: none;
  color: #fff;
  outline: none;
  font-family: "Rajdhani", sans-serif;
  width: 100%;
}
.filter-options {
  display: flex;
  gap: 10px;
}
.filter-options select {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: #fff;
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  outline: none;
}

.market-listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 25px;
}
.market-card {
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.market-price-tag {
  font-family: "Oswald", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 4px 12px;
  border-radius: 4px;
  width: 100%;
  text-align: center;
}
.market-card button {
  width: 100%;
}

/* --- ARENA DE COMBAT EN TEMPS RÉEL --- */

/* Background effects layer */
#view-combat {
  position: relative;
  overflow: hidden;
}
.arena-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.arena-spotlight {
  position: absolute;
  top: -100px;
  width: 400px;
  height: 600px;
  border-radius: 50%;
  opacity: 0.07;
  filter: blur(80px);
  animation: spotlightPulse 4s ease-in-out infinite alternate;
}
.arena-spotlight.left {
  left: -80px;
  background: radial-gradient(circle, #e63946, transparent);
}
.arena-spotlight.right {
  right: -80px;
  background: radial-gradient(circle, #38bdf8, transparent);
  animation-delay: 2s;
}
@keyframes spotlightPulse {
  from { opacity: 0.05; transform: scale(1); }
  to   { opacity: 0.12; transform: scale(1.15); }
}
.arena-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Flash d'impact */
.arena-impact-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.05s;
  background: rgba(230, 57, 70, 0.22);
  border-radius: 0;
}
.arena-impact-flash.active {
  opacity: 1;
}

/* Header */
.combat-arena-header {
  position: relative;
  z-index: 2;
  padding: 14px 24px;
  margin-bottom: 16px;
  background: rgba(10, 10, 20, 0.85);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
}
.combat-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.arena-badge {
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: 4px;
  text-transform: uppercase;
}
.round-title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.round-counter {
  font-family: "Oswald", sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 0 20px rgba(255,255,255,0.3);
}
.round-dots {
  display: flex;
  gap: 5px;
}
.rdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  transition: background 0.3s, box-shadow 0.3s;
}
.rdot.done {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* Timer circulaire */
.timer-block {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timer-ring {
  position: absolute;
  inset: 0;
  width: 52px;
  height: 52px;
  transform: rotate(-90deg);
}
.timer-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 3;
}
.timer-ring-progress {
  fill: none;
  stroke: #f39c12;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 113.1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
  filter: drop-shadow(0 0 4px rgba(243,156,18,0.7));
}
.timer-ring-progress.urgent {
  stroke: var(--accent);
  filter: drop-shadow(0 0 6px rgba(230,57,70,0.9));
}
.timer-badge {
  font-family: "Oswald", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  position: relative;
  z-index: 1;
}

/* Layout arène */
.arena-layout {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%;
}
#oppFighterStation { order: 1; width: 100%; max-width: 1000px; }
#arenaController { order: 2; width: 100%; max-width: 1000px; }
#myFighterStation { order: 3; width: 100%; max-width: 1000px; }

@media (min-width: 992px) {
  .arena-layout {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 30px;
    max-width: 1800px;
    margin: 0 auto;
  }
  #myFighterStation {
    order: 1;
    width: 260px;
    max-width: none;
    position: sticky;
    top: 20px;
  }
  #arenaController {
    order: 2;
    flex: 1;
    max-width: 1200px;
  }
  #oppFighterStation {
    order: 3;
    width: 260px;
    max-width: none;
    position: sticky;
    top: 20px;
  }
}

/* Stations combattants */
.fighter-station {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(10, 10, 22, 0.75);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  transition: box-shadow 0.4s;
}

.fighter-core-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 15px;
}
.my-station {
  border-color: rgba(230,57,70,0.2);
  box-shadow: 0 0 30px rgba(230,57,70,0.05) inset;
}
.opponent-station {
  border-color: rgba(56,189,248,0.2);
  box-shadow: 0 0 30px rgba(56,189,248,0.05) inset;
}
.my-station.hit {
  animation: stationShakeRed 0.35s ease;
}
.opponent-station.hit {
  animation: stationShakeBlue 0.35s ease;
}
@keyframes stationShakeRed {
  0%,100% { transform: translateX(0); box-shadow: 0 0 0 rgba(230,57,70,0); }
  20% { transform: translateX(-6px); box-shadow: 0 0 40px rgba(230,57,70,0.5) inset; }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes stationShakeBlue {
  0%,100% { transform: translateX(0); box-shadow: 0 0 0 rgba(56,189,248,0); }
  20% { transform: translateX(6px); box-shadow: 0 0 40px rgba(56,189,248,0.5) inset; }
  40% { transform: translateX(-6px); }
  60% { transform: translateX(4px); }
  80% { transform: translateX(-4px); }
}

.station-label {
  font-family: "Oswald", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.my-label {
  color: #ff6b6b;
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.25);
}
.opp-label {
  color: #60d0ff;
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.25);
}

/* Barres de stats */
.fighter-stats-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.stat-icon.hp-icon {
  background: rgba(230,57,70,0.15);
  color: #ff6b6b;
}
.stat-icon.end-icon {
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
}
.stat-info {
  flex: 1;
}
.stat-label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}
.stat-lbl {
  font-family: "Oswald", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.bar-outer {
  height: 10px;
  background: rgba(0,0,0,0.6);
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}
.bar-inner {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-bar {
  background: linear-gradient(90deg, #b91c1c, #ef4444, #ff6b6b);
  box-shadow: 0 0 8px rgba(239,68,68,0.5);
}
.end-bar {
  background: linear-gradient(90deg, #d97706, #fbbf24, #fde68a);
  box-shadow: 0 0 6px rgba(251,191,36,0.4);
}
.bar-val {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Carte du combattant */
.fighter-card-frame-arena {
  width: 120px;
  height: 180px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255,255,255,0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.fighter-card-frame-arena .card-canvas {
  transform: scale(0.375);
  transform-origin: center center;
}
.arena-fighter-title {
  font-family: "Oswald", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.arena-fighter-weight {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.72rem;
  color: var(--gold);
  border: 1px solid rgba(255,215,0,0.25);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Dernier coup joué */
.last-move-display {
  width: 100%;
  text-align: center;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
}
.lm-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 2px;
}
.lm-value {
  font-family: "Oswald", sans-serif;
  font-size: 0.85rem;
  color: #fff;
  font-weight: 600;
}

/* ====== CONTRÔLEUR CENTRAL ====== */
.arena-controller {
  background: rgba(10, 10, 22, 0.82);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 520px;
  position: relative;
  overflow: hidden;
}
.arena-controller::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(230,57,70,0.4), rgba(56,189,248,0.4), transparent);
}

/* VS divider */
.vs-divider {
  text-align: center;
  margin: -4px 0 4px;
}
.vs-divider span {
  font-family: "Oswald", sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, #e63946, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  opacity: 0.6;
}

/* ---- PHASE 1 : SPÉCIALISATION ---- */
.arena-phase {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: phaseIn 0.35s ease;
}
@keyframes phaseIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.phase-spec-header {
  text-align: center;
  padding: 10px 0 4px;
}
.phase-icon {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--gold), #f39c12);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  margin-bottom: 8px;
}
.phase-spec-header h3 {
  font-family: "Oswald", sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.phase-spec-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.spec-selection-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-spec {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.2s, box-shadow 0.25s;
  text-align: left;
}
.btn-spec:hover {
  background: rgba(230,57,70,0.1);
  border-color: rgba(230,57,70,0.4);
  transform: translateX(4px);
  box-shadow: -4px 0 0 var(--accent);
}
.btn-spec.active {
  background: rgba(230,57,70,0.15);
  border-color: var(--accent);
  box-shadow: -4px 0 0 var(--accent), 0 0 20px rgba(230,57,70,0.2);
}
.spec-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(230,57,70,0.12);
  border: 1px solid rgba(230,57,70,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
  transition: background 0.2s;
}
.btn-spec.active .spec-icon,
.btn-spec:hover .spec-icon {
  background: rgba(230,57,70,0.25);
}
.spec-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.spec-text strong {
  font-family: "Oswald", sans-serif;
  font-size: 0.92rem;
  color: #fff;
  font-weight: 700;
}
.spec-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.spec-text b {
  color: #fbbf24;
}

.waiting-specs {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ---- PHASE 2 : ROUND DE COMBAT ---- */

/* Feed de combat (événements) */
.combat-feed {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  height: 130px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  scroll-behavior: smooth;
}
.combat-feed::-webkit-scrollbar { width: 4px; }
.combat-feed::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.log-entry {
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 3px;
  animation: logSlideIn 0.25s ease;
  line-height: 1.4;
}
@keyframes logSlideIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.log-entry.system {
  color: #38bdf8;
  font-weight: 600;
}
.log-entry.round {
  color: var(--gold);
  font-weight: 700;
  border-top: 1px solid rgba(255,215,0,0.15);
  padding-top: 6px;
  margin-top: 4px;
}
.log-entry.p1 { color: #ff8a80; }
.log-entry.p2 { color: #82c5ff; }
.log-entry.draw { color: #c084fc; }
.log-entry.hit-big { color: #ffb700; font-weight: 700; }

.action-step {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-lg);
  padding: 15px;
  margin-top: 20px;
}
/* Header action step */
.action-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Oswald", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 15px;
}
.attack-header {
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.2);
  color: #ff8a80;
}
.defense-header {
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.2);
  color: #82c5ff;
}

/* Cartes de moves */
.move-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.btn-move-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.03);
  border: 2px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  gap: 6px;
  height: 140px;
  width: 110px;
  min-width: 60px;
  flex-shrink: 1;
  position: relative;
  overflow: hidden;
}
.btn-move-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 0 0 8px 8px;
  transition: opacity 0.2s;
  opacity: 0;
}
.btn-att-card::before  { background: var(--accent); }
.btn-def-card::before  { background: #38bdf8; }

.btn-move-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
}
.btn-move-card:hover::before { opacity: 1; }
.btn-att-card:hover {
  border-color: rgba(230,57,70,0.5);
  box-shadow: 0 8px 24px rgba(230,57,70,0.15);
}
.btn-def-card:hover {
  border-color: rgba(56,189,248,0.5);
  box-shadow: 0 8px 24px rgba(56,189,248,0.15);
}

.btn-att-card.active {
  border-color: rgba(230,57,70,0.8);
  box-shadow: 0 0 15px rgba(230,57,70,0.4);
  background: rgba(230,57,70,0.1);
}
.btn-def-card.active {
  border-color: rgba(56,189,248,0.8);
  box-shadow: 0 0 15px rgba(56,189,248,0.4);
  background: rgba(56,189,248,0.1);
}

.btn-move-card.has-visual {
  width: 110px;
  height: 140px;
  flex-shrink: 1;
  padding: 0;
  background: transparent;
  border-radius: 8px;
  overflow: visible;
}
.btn-move-card.has-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.btn-move-card.has-visual::before {
  display: none;
}
.btn-move-card.has-visual.active {
  box-shadow: 0 0 0 4px var(--accent);
  transform: scale(1.05);
}
.btn-move-card.btn-def-card.has-visual.active {
  box-shadow: 0 0 0 4px #38bdf8;
}
.btn-att-card.active {
  background: rgba(230,57,70,0.12);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(230,57,70,0.25);
}
.btn-att-card.active::before { opacity: 1; }
.btn-def-card.active {
  background: rgba(56,189,248,0.12);
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56,189,248,0.25);
}
.btn-def-card.active::before { opacity: 1; }

.move-card-rank {
  font-family: "Oswald", sans-serif;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.move-card-name {
  font-family: "Oswald", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.move-card-type {
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}
.type-haut { color: #60a5fa; background: rgba(96,165,250,0.12); border: 1px solid rgba(96,165,250,0.2); }
.type-bas  { color: #fbbf24; background: rgba(251,191,36,0.12); border: 1px solid rgba(251,191,36,0.2); }
.move-card-stats {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}
.mc-dmg {
  font-size: 0.68rem;
  font-weight: 700;
  color: #ff8a80;
  background: rgba(230,57,70,0.1);
  padding: 1px 5px;
  border-radius: 3px;
}
.mc-blk {
  font-size: 0.68rem;
  font-weight: 700;
  color: #82c5ff;
  background: rgba(56,189,248,0.1);
  padding: 1px 5px;
  border-radius: 3px;
}
.mc-end {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251,191,36,0.1);
  padding: 1px 5px;
  border-radius: 3px;
}
.mc-end-drain {
  font-size: 0.65rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(52,211,153,0.15);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Bouton de confirmation d'action */
.btn-confirm-action {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 8px;
  font-family: "Oswald", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.btn-confirm-attack {
  background: linear-gradient(135deg, #b91c1c, #e63946);
  color: #fff;
  box-shadow: 0 4px 16px rgba(230,57,70,0.3);
}
.btn-confirm-attack:hover:not(:disabled) {
  background: linear-gradient(135deg, #e63946, #ff4757);
  box-shadow: 0 6px 24px rgba(230,57,70,0.5);
  transform: translateY(-2px);
}
.btn-confirm-defense {
  background: linear-gradient(135deg, #0369a1, #38bdf8);
  color: #fff;
  box-shadow: 0 4px 16px rgba(56,189,248,0.3);
}
.btn-confirm-defense:hover:not(:disabled) {
  background: linear-gradient(135deg, #38bdf8, #7dd3fc);
  box-shadow: 0 6px 24px rgba(56,189,248,0.5);
  transform: translateY(-2px);
}
.btn-confirm-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}
.btn-pass-turn {
  background: linear-gradient(135deg, #4a5568, #2d3748);
  color: #a0aec0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.btn-pass-turn:hover {
  background: linear-gradient(135deg, #5a6578, #3d4758);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

/* Attente adversaire */
.waiting-anim {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 20px 0 10px;
}
.waiting-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  animation: waitPulse 1.2s ease-in-out infinite;
}
.waiting-pulse.delay1 { animation-delay: 0.2s; }
.waiting-pulse.delay2 { animation-delay: 0.4s; }
@keyframes waitPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
.waiting-turn-status {
  text-align: center;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 8px 16px;
}

/* ---- PHASE 3 : RÉSULTATS ---- */
#phase-results {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.results-content {
  text-align: center;
  padding: 30px 10px;
  animation: resultsIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes resultsIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}
.results-crown {
  font-size: 3.5rem;
  margin-bottom: 10px;
  animation: crownFloat 2s ease-in-out infinite;
}
.results-crown.victory i { color: var(--gold); filter: drop-shadow(0 0 20px rgba(255,215,0,0.6)); }
.results-crown.defeat  i { color: var(--accent); filter: drop-shadow(0 0 14px rgba(230,57,70,0.5)); }
.results-crown.draw    i { color: #94a3b8; }
@keyframes crownFloat {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  50%     { transform: translateY(-8px) rotate(5deg); }
}
#combatResultsTitle {
  font-family: "Oswald", sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
#combatResultsReason {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.results-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.btn-return-dashboard {
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-family: "Oswald", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 12px 28px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-return-dashboard:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* --- RATINGS STARS --- */
.rating-stars-input {
  display: flex;
  gap: 8px;
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  justify-content: center;
  margin: 15px 0;
}
.rating-stars-input i:hover, .rating-stars-input i.active {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}
.rating-feedback-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- MODAL SYSTEM --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-backdrop.active {
  display: flex;
}
.modal-content {
  width: 100%;
  max-width: 500px;
  padding: 25px;
  position: relative;
  animation: modalSlide 0.3s ease forwards;
}
@keyframes modalSlide {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 10px;
}
.modal-header h2 {
  font-family: "Oswald", sans-serif;
  font-size: 1.25rem;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-close {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}
.btn-close:hover {
  color: #fff;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.45;
}

.btn-phantom-connect {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wallet-option-btn {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 700;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
}
.wallet-option-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-blue);
}
.wallet-logo {
  width: 25px;
  height: 25px;
}
.badge-wallet {
  margin-left: auto;
  font-size: 0.65rem;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
  padding: 1px 6px;
  border-radius: 3px;
}

.wallet-separator {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 15px 0;
  position: relative;
}
.wallet-separator::before, .wallet-separator::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 25%;
  height: 1px;
  background: var(--border-soft);
}
.wallet-separator::before { left: 0; }
.wallet-separator::after { right: 0; }

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.field-label {
  font-family: "Oswald", sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* --- ADMIN VIEW --- */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
@media (max-width: 992px) {
  .admin-grid { grid-template-columns: 1fr; }
}

.admin-grid select, .admin-grid textarea {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: #fff;
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  outline: none;
}
.admin-grid textarea {
  min-height: 100px;
  resize: vertical;
}
.admin-grid select:focus, .admin-grid textarea:focus {
  border-color: var(--accent);
}

/* --- EXPORT PNG OVERLAY --- */
.export-loading {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 15px;
  z-index: 1000;
}
.export-loading.active {
  display: flex;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.export-text {
  font-family: "Rajdhani", sans-serif;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

/* --- TOAST SYSTEM --- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}
.toast {
  background: rgba(22, 22, 38, 0.9);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--accent-blue);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  min-width: 250px;
  animation: toastSlide 0.3s ease forwards;
}
@keyframes toastSlide {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast.success { border-left-color: #22c55e; }
.toast.error { border-left-color: #ef4444; }

/* Auth buttons */
.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.auth-buttons .btn-primary,
.auth-buttons .btn-ghost {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  justify-content: center;
}

/* Shop */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.shop-card {
  padding: 28px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.shop-uec-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-primary);
  font-family: 'Rajdhani', sans-serif;
}
.shop-sol-price {
  font-size: 1.1rem;
  color: var(--text-muted);
}
.btn-buy-uec {
  width: 100%;
  padding: 10px;
  font-size: 0.95rem;
}
.toast.warning { border-left-color: #eab308; }

/* Admin players table */
.admin-players-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-players-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.9rem;
}
.admin-players-table tr:hover td {
  background: rgba(255,255,255,0.03);
}

/* Home Market Carousel */
.home-carousel-container {
  width: 100vw;
  max-width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.home-market-track {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
}

.carousel-card-wrapper {
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.carousel-card-wrapper:hover {
  transform: scale(0.95);
  z-index: 10;
}

.carousel-price-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1rem;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.rules-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 30px;
}
.rules-box h3 {
  margin-top: 0;
  color: var(--accent);
}
.rules-box p:last-child {
  margin-bottom: 0;
}

@keyframes cardExit {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.8) translateY(20px); opacity: 0; }
}
@keyframes cardEnter {
  0% { transform: scale(0.8) translateY(-20px); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.card-anim-exit {
  animation: cardExit 0.3s forwards ease-in;
  pointer-events: none;
}
.card-anim-enter {
  animation: cardEnter 0.3s forwards ease-out;
}

/* --- CARTE MAT (Tapis de jeu) --- */
.card-mat {
  background: rgba(15, 20, 35, 0.85);
  border: 1px solid rgba(0, 255, 200, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: 0 0 30px rgba(0, 255, 200, 0.05) inset;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}
.card-mat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    linear-gradient(90deg, rgba(0, 255, 200, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(0, 255, 200, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 0;
}
.mat-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}
.mat-slot {
  width: 70px;
  height: 105px;
  border: 2px dashed rgba(0, 255, 200, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}
.mat-slot.mat-slot-single {
  width: 90px;
  height: 130px;
}
.mat-slot.has-card {
  border: none;
  background: transparent;
}
.mat-slot .move-card {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  margin: 0;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  transform: scale(0.9);
}
.slot-placeholder {
  font-family: 'Oswald', sans-serif;
  color: rgba(0, 255, 200, 0.4);
  font-size: 0.9rem;
  letter-spacing: 1px;
  user-select: none;
  text-align: center;
  word-wrap: break-word;
  width: 100%;
}
.mat-phase-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  color: rgba(0, 255, 200, 0.6);
  letter-spacing: 3px;
  margin: 0 10px;
  white-space: nowrap;
}
.mat-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 10px;
  position: relative;
  z-index: 1;
}
.mat-glowing-line {
  width: 80%;
  height: 2px;
  background: rgba(0, 255, 200, 0.5);
  box-shadow: 0 0 10px rgba(0, 255, 200, 0.8), 0 0 20px rgba(0, 255, 200, 0.4);
}

@media (min-width: 992px) {
  .card-mat {
    flex-direction: row-reverse;
    justify-content: center;
    align-items: center;
    gap: 30px;
  }
  .mat-row {
    flex-direction: column;
  }
  .mat-divider {
    width: 10px;
    height: 80%;
    min-height: 200px;
  }
  .mat-glowing-line {
    width: 2px;
    height: 100%;
  }
}

/* --- FLOATING TEXT ANIMATION --- */
.floating-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Oswald', sans-serif;
  font-weight: bold;
  font-size: 2.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8), 0 0 5px currentColor;
  pointer-events: none;
  z-index: 9999;
  animation: floatUp 3.5s ease-out forwards;
}
.floating-text.dmg-hp { color: #ff4757; }
.floating-text.dmg-end { color: #feca57; }
.floating-text.dmg-parade { color: #e056a0; font-weight: bold; }
.floating-text.heal-hp { color: #2ed573; }
.floating-text.heal-end { color: #1e90ff; }
.floating-text.dmg-self-dmg { color: #c23616; font-size: 1.2rem; }

@keyframes floatUp {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  20% { transform: translate(-50%, -80%) scale(1.2); opacity: 1; }
  80% { transform: translate(-50%, -120%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -150%) scale(1); opacity: 0; }
}

/* --- FOOTER --- */
.site-footer {
  margin-top: 60px;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-text {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-family: "Oswald", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #5865F2, #4752C4);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-discord:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-discord:active {
  transform: translateY(0);
}

.btn-discord .fa-discord {
  font-size: 1.2rem;
}

@media (max-width: 600px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}
