/* ===================================================================
   StelLive Bounce Battle Simulator - Main Styling (hanakonana.cloud)
   =================================================================== */

:root {
  --bg-dark: #0b0c16;
  --bg-card: rgba(21, 23, 38, 0.85);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-input: #121422;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  /* StelLive Palette */
  --nana-purple: #c084fc;
  --nana-glow: #a855f7;
  --accent-pink: #f43f5e;
  --accent-cyan: #06b6d4;
  --accent-gold: #fbbf24;
  --accent-green: #22c55e;
  
  --primary: #9333ea;
  --primary-hover: #a855f7;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --font-main: 'Noto Sans KR', sans-serif;
  --font-display: 'Black Han Sans', sans-serif;
  --font-hud: 'Outfit', sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(147, 51, 234, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(244, 63, 94, 0.08) 0%, transparent 60%);
  background-attachment: fixed;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1720px;
  margin: 0 auto;
  padding: 12px 20px;
}

/* Header */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  margin-bottom: 12px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-tag {
  background: linear-gradient(135deg, var(--nana-purple), #7e22ce);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.logo-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.5px;
  color: #fff;
}

.logo-title .highlight {
  background: linear-gradient(135deg, #e879f9, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub-domain {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-controls {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* Layout */
.main-layout {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 14px;
  flex: 1;
  min-height: 0; /* Important for flex child scroll */
}

/* Sidebars */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header h3 i, .panel-header h4 i {
  width: 18px;
  height: 18px;
  color: var(--nana-purple);
}

.fighter-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--nana-purple);
  background: rgba(168, 85, 247, 0.15);
  padding: 2px 8px;
  border-radius: 12px;
}

.live-pulse {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Tabs */
.roster-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.4);
}

/* Roster Grid */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding: 2px;
  margin-bottom: 12px;
}

.roster-grid::-webkit-scrollbar {
  width: 4px;
}
.roster-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.fighter-card {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.fighter-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.fighter-card.active {
  background: rgba(168, 85, 247, 0.12);
  border-color: var(--nana-purple);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

.fighter-card .avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 2px solid var(--char-color, #a855f7);
  box-shadow: 0 0 8px var(--char-color, #a855f7);
  flex-shrink: 0;
  overflow: hidden;
}

.fighter-card .avatar-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fighter-card .char-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fighter-card .char-name {
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fighter-card .char-role {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.fighter-card .status-check {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.65rem;
  color: var(--accent-green);
  opacity: 0;
  transition: opacity 0.2s;
}

.fighter-card.active .status-check {
  opacity: 1;
}

.roster-actions {
  display: flex;
  gap: 6px;
}

/* Custom Card */
.custom-card .card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

/* Center: Arena Section */
.arena-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.canvas-wrapper {
  position: relative;
  flex: 1;
  background: radial-gradient(circle at center, #17192b 0%, #0c0d18 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas#battleCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Dynamic Ultimate Cut-In */
.ult-cutin {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: ultFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ult-cutin.hidden {
  display: none;
}

.cutin-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.85) 20%, rgba(0, 0, 0, 0.85) 80%, transparent 100%);
  border-top: 3px solid var(--ult-color, #a855f7);
  border-bottom: 3px solid var(--ult-color, #a855f7);
  box-shadow: 0 0 30px var(--ult-color, #a855f7);
  height: 160px;
  transform: skewY(-4deg);
}

.cutin-character {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 2;
  transform: skewY(-4deg);
  animation: cutinSlide 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.cutin-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--ult-color, #a855f7);
  box-shadow: 0 0 25px var(--ult-color, #a855f7);
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  overflow: hidden;
}

.cutin-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cutin-info {
  display: flex;
  flex-direction: column;
}

.cutin-sub {
  font-family: var(--font-hud);
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 3px;
  color: var(--ult-color, #a855f7);
  text-shadow: 0 0 10px var(--ult-color, #a855f7);
}

.cutin-name {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.cutin-skill {
  font-family: var(--font-main);
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
}

@keyframes ultFadeIn {
  0% { opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes cutinSlide {
  0% { transform: skewY(-4deg) translateX(-150px) scale(0.9); }
  25% { transform: skewY(-4deg) translateX(0) scale(1.05); }
  100% { transform: skewY(-4deg) translateX(20px) scale(1); }
}

/* Winner Overlay */
.winner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  animation: fadeIn 0.4s ease-out;
}

.winner-overlay.hidden {
  display: none;
}

.winner-modal {
  background: linear-gradient(145deg, #1b1e33, #0f111e);
  border: 2px solid var(--accent-gold);
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 420px;
  width: 90%;
  animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.crown-icon {
  font-size: 3rem;
  margin-bottom: -10px;
  animation: bounceCrown 1s infinite alternate ease-in-out;
}

@keyframes bounceCrown {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.winner-tag {
  font-family: var(--font-hud);
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--accent-gold);
  font-size: 0.9rem;
  margin-top: 4px;
}

.winner-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: #fff;
  margin: 6px 0 16px;
}

.winner-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid var(--accent-gold);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
  font-size: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: #151728;
}

.winner-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  margin-bottom: 24px;
}

.winner-stats .stat-box {
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.winner-stats .label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.winner-stats .value {
  font-family: var(--font-hud);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

/* HUD & Kill Feed */
.hud-killfeed {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  z-index: 10;
}

.killfeed-item {
  background: rgba(15, 17, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(6px);
  animation: slideInRight 0.3s ease-out;
}

.killfeed-item .killer {
  color: var(--killer-color, #a855f7);
}

.killfeed-item .icon {
  color: var(--accent-pink);
  font-size: 0.85rem;
}

.killfeed-item .victim {
  color: #94a3b8;
}

.storm-warning {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  font-weight: 900;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  letter-spacing: 1px;
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.6);
  animation: pulse 1s infinite;
  pointer-events: none;
  z-index: 15;
}

.storm-warning.hidden {
  display: none;
}

/* Control Panel */
.control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  gap: 12px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speed-group .control-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-group {
  display: flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.speed-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-hud);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.speed-btn.active {
  background: var(--primary);
  color: #fff;
}

.speed-btn.turbo {
  color: var(--accent-gold);
}

.speed-btn.turbo.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.select-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  gap: 6px;
}

.select-wrapper i {
  width: 16px;
  height: 16px;
  color: var(--nana-purple);
}

.select-wrapper select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 4px;
  outline: none;
  cursor: pointer;
}

.select-wrapper select option {
  background: #161828;
  color: #fff;
}

/* Leaderboard */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
}

.leaderboard-list::-webkit-scrollbar {
  width: 4px;
}
.leaderboard-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.leader-item {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  gap: 8px;
  font-size: 0.8rem;
  border-left: 3px solid var(--char-color, #a855f7);
  transition: transform 0.2s;
}

.leader-item.dead {
  opacity: 0.4;
  filter: grayscale(0.8);
}

.leader-rank {
  font-family: var(--font-hud);
  font-weight: 900;
  width: 18px;
  color: var(--text-muted);
}

.leader-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.leader-name {
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-hp-bar {
  width: 45px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.leader-hp-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: 3px;
  transition: width 0.2s;
}

.leader-kills {
  font-family: var(--font-hud);
  font-weight: 800;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Settings Sliders & Toggles */
.setting-row {
  margin-bottom: 12px;
}

.setting-row label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.setting-row input[type="range"] {
  width: 100%;
  accent-color: var(--nana-purple);
  background: var(--bg-input);
  height: 6px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.setting-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-main);
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-toggle-row:last-child {
  border-bottom: none;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-input);
  transition: .3s;
  border-radius: 20px;
  border: 1px solid var(--bg-card-border);
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: #94a3b8;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(18px);
  background-color: #fff;
}

/* Domain Footer */
.domain-card {
  text-align: center;
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.12), rgba(15, 17, 26, 0.8));
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-hud);
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 4px;
}

.domain-badge i {
  color: var(--nana-purple);
}

.domain-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.domain-links {
  display: flex;
  gap: 6px;
}

.link-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.2s;
}

.link-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.link-btn i {
  width: 14px;
  height: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--nana-purple), #7e22ce);
  color: #fff;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #d8b4fe, #9333ea);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.btn-accent {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.btn-sm {
  font-size: 0.75rem;
  padding: 6px 10px;
}

.btn-lg {
  font-size: 1rem;
  padding: 12px 24px;
}

.btn-block {
  width: 100%;
}

.btn i {
  width: 16px;
  height: 16px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-dialog {
  background: #161828;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  animation: scaleUp 0.2s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input[type="text"], .form-group select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.85rem;
  padding: 8px 12px;
  outline: none;
}

.color-picker-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-picker-group input[type="color"] {
  border: none;
  width: 40px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

.color-hex {
  font-family: var(--font-hud);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 280px 1fr 280px;
  }
}

@media (max-width: 992px) {
  .app-container {
    height: auto;
  }
  .main-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .canvas-wrapper {
    height: 520px;
  }
}
