/* ===========================
   MultiScreenSync — style.css
   =========================== */

:root {
  --bg-base: #080c12;
  --bg-card: #0e1420;
  --bg-card2: #121926;
  --bg-surface: #1a2334;
  --border: rgba(255,255,255,0.07);
  --border-active: rgba(99,210,255,0.35);

  --accent: #63d2ff;
  --accent-dim: rgba(99,210,255,0.15);
  --accent-glow: rgba(99,210,255,0.08);
  --accent2: #a78bfa;
  --accent2-dim: rgba(167,139,250,0.15);

  --text-primary: #eef2f8;
  --text-secondary: #8899b0;
  --text-muted: #4a5a70;

  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);

  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== HEADER ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  background: rgba(8,12,18,0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  font-size: 1.3rem;
  color: var(--accent);
}

.logo-text em {
  font-style: normal;
  color: var(--accent);
}

.header-nav {
  display: flex;
  gap: 2rem;
}

.header-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
}

.header-nav a:hover { color: var(--text-primary); }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  padding: 100px 6vw 60px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.hero-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.glow-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,210,255,0.3) 0%, transparent 70%);
  top: -100px; left: -100px;
  animation: orbFloat 12s ease-in-out infinite;
}

.glow-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(167,139,250,0.25) 0%, transparent 70%);
  bottom: 0; right: -50px;
  animation: orbFloat 15s ease-in-out infinite reverse;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0,0); }
  33% { transform: translate(30px, -20px); }
  66% { transform: translate(-20px, 30px); }
}

.hero-content {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 560px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--accent-dim);
  border: 1px solid var(--border-active);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.6s ease forwards;
}

.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.6s 0.1s ease both;
}

.hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  animation: fadeUp 0.6s 0.2s ease both;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--accent);
  color: #080c12;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  animation: fadeUp 0.6s 0.3s ease both;
}

.hero-cta:hover {
  background: #8ee5ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99,210,255,0.35);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* hero visual */
.hero-visual {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  animation: fadeUp 0.8s 0.4s ease both;
}

.phone-mockup-group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.phone-mock {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.pm-1 { width: 80px; height: 160px; transform: rotate(-5deg) translateY(10px); }
.pm-2 { width: 80px; height: 170px; z-index: 2; }
.pm-3 { width: 80px; height: 155px; transform: rotate(5deg) translateY(15px); }

.pm-screen {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a2334 0%, #0e1420 100%);
}

.s1 { background: linear-gradient(135deg, rgba(99,210,255,0.3) 0%, rgba(99,210,255,0.05) 100%); }
.s2 { background: linear-gradient(135deg, rgba(167,139,250,0.3) 0%, rgba(167,139,250,0.05) 100%); }
.s3 { background: linear-gradient(135deg, rgba(52,211,153,0.3) 0%, rgba(52,211,153,0.05) 100%); }

/* ===== SIMULATOR SECTION ===== */
.simulator-section {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== STEP CARDS ===== */
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  transition: border-color var(--transition), opacity var(--transition);
}

.step-card.step-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.step-card.step-active {
  border-color: var(--border-active);
  box-shadow: 0 0 0 1px rgba(99,210,255,0.1), var(--shadow-md);
}

.step-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-muted);
  line-height: 1;
  flex-shrink: 0;
  min-width: 56px;
  transition: color var(--transition);
}

.step-card.step-active .step-number {
  color: var(--accent);
}

.step-body {
  flex: 1;
}

.step-body h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.step-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  background: rgba(255,255,255,0.01);
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-icon {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.upload-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.upload-btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent-dim);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 1rem;
}

.upload-btn:hover {
  background: rgba(99,210,255,0.25);
}

.upload-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ===== FILE LIST ===== */
.file-list {
  margin-top: 1.5rem;
}

.file-list h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.file-list h4 span {
  color: var(--accent);
  font-weight: 600;
}

.file-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.file-item-idx {
  width: 22px; height: 22px;
  background: var(--accent-dim);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.file-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.file-item-size {
  color: var(--text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.file-item-aspect {
  color: var(--accent);
  font-size: 0.7rem;
  background: var(--accent-dim);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #080c12;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary:hover {
  background: #8ee5ff;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ===== ERROR ===== */
.error-msg {
  margin-top: 1rem;
  padding: 10px 14px;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 0.85rem;
}

/* ===== LAYOUT GRID ===== */
.layout-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1rem;
}

.layout-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  min-width: 120px;
}

.layout-option:hover {
  border-color: rgba(99,210,255,0.4);
  background: var(--accent-glow);
}

.layout-option.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent);
}

.layout-icon {
  display: grid;
  gap: 2px;
  width: 48px;
  height: 48px;
}

.layout-icon div {
  background: var(--bg-card);
  border-radius: 2px;
  border: 1px solid currentColor;
  transition: background var(--transition);
}

.layout-option.selected .layout-icon div {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.layout-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.layout-option.selected .layout-label {
  color: var(--accent);
}

/* Layout icon patterns */
/* 2 vertical */
.layout-icon.v2 { grid-template-columns: 1fr 1fr; }
.layout-icon.v2 div { }

/* 2 horizontal */
.layout-icon.h2 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }

/* 3 vertical */
.layout-icon.v3 { grid-template-columns: 1fr 1fr 1fr; }

/* 3 horizontal */
.layout-icon.h3 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr 1fr; }

/* 4 vertical */
.layout-icon.v4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* 4 horizontal */
.layout-icon.h4 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr 1fr 1fr; }

/* 4 grid */
.layout-icon.g4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

/* aspect info */
.aspect-info {
  margin-top: 0.75rem;
}

.aspect-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 100px;
  color: var(--accent2);
  font-size: 0.78rem;
}

/* ===== PREVIEW CONTROLS ===== */
.preview-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.control-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.toggle-group {
  display: flex;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 5px;
  transition: all var(--transition);
}

.toggle-btn.active {
  background: var(--accent);
  color: #080c12;
}

.toggle-btn:not(.active):hover {
  background: var(--border);
  color: var(--text-primary);
}

/* ===== SIMULATOR STAGE ===== */
.simulator-stage {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  position: relative;
}

.simulator-viewport {
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

/* Split layouts */
.sim-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

.sim-layout.vertical { flex-direction: row; }
.sim-layout.horizontal { flex-direction: column; }
.sim-layout.grid4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.sim-slot {
  position: relative;
  overflow: hidden;
  flex: 1;
  background: #111;
  min-height: 100px;
}

.sim-slot + .sim-slot {
  border-left: 2px solid rgba(255,255,255,0.1);
}

.sim-layout.horizontal .sim-slot + .sim-slot {
  border-left: none;
  border-top: 2px solid rgba(255,255,255,0.1);
}

.sim-layout.grid4 .sim-slot + .sim-slot {
  border-left: none;
  border: none;
}

.sim-layout.grid4 .sim-slot {
  border: 1px solid rgba(255,255,255,0.08);
}

.sim-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sim-slot-label {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(0,0,0,0.6);
  color: rgba(255,255,255,0.7);
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 100px;
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 2;
}

/* ===== PLAYBACK CONTROLS ===== */
.playback-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.ctrl-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.ctrl-play {
  width: 44px; height: 44px;
  background: var(--accent);
  border-color: var(--accent);
  color: #080c12;
  border-radius: var(--radius-sm);
}

.ctrl-play:hover {
  background: #8ee5ff;
  border-color: #8ee5ff;
  color: #080c12;
}

.progress-area {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.time-current, .time-total {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 30px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-base);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  transition: height var(--transition);
}

.progress-bar:hover {
  height: 6px;
}

.progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  pointer-events: none;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transition: transform var(--transition);
}

.progress-bar:hover .progress-thumb {
  transform: translate(-50%, -50%) scale(1);
}

/* sync status */
.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sync-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

/* ===== SIZE VARIANTS ===== */
.simulator-stage.size-sm { height: 240px; }
.simulator-stage.size-md { height: 360px; }
.simulator-stage.size-lg { height: 500px; }

/* Portrait devices — taller */
.simulator-stage.orientation-portrait .sim-layout.vertical {
  /* Each slot proportionally taller */
}

/* ===== LEGAL SECTION ===== */
.legal-section {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 5rem 2rem;
}

.legal-inner {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.legal-block h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.legal-content {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.legal-content p {
  margin-bottom: 0.75rem;
}

.legal-content h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.25rem 0 0.4rem;
}

.legal-content ul {
  list-style: none;
  padding: 0;
}

.legal-content ul li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.4rem;
}

.legal-content ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ===== FOOTER ===== */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
}

.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.footer-logo .logo-icon {
  color: var(--accent);
}

.footer-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    padding: 90px 1.5rem 3rem;
    min-height: auto;
    gap: 2.5rem;
  }

  .hero-visual { display: none; }

  .step-card {
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
  }

  .step-number {
    font-size: 2rem;
  }

  .legal-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .playback-controls {
    gap: 6px;
    padding: 10px 12px;
  }

  .preview-controls {
    gap: 1rem;
  }

  .simulator-section {
    padding: 2rem 1rem 4rem;
  }
}

@media (max-width: 480px) {
  .layout-grid {
    gap: 8px;
  }

  .layout-option {
    min-width: 90px;
    padding: 10px 12px;
  }

  .progress-area {
    gap: 6px;
  }

  .ctrl-btn {
    width: 32px; height: 32px;
  }

  .ctrl-play {
    width: 38px; height: 38px;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-surface); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== FULLSCREEN ===== */
.simulator-stage:-webkit-full-screen { border-radius: 0; }
.simulator-stage:fullscreen { border-radius: 0; }

.simulator-stage:fullscreen .sim-layout {
  width: 100vw;
  height: 100vh;
}

/* ===== LOADING SPINNER ===== */
.slot-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  z-index: 3;
}

.spinner {
  width: 28px; height: 28px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== ASPECT MISMATCH WARNING ===== */
.aspect-warn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: var(--radius-sm);
  color: var(--yellow);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-top: 0.75rem;
}

/* ===== ORDER PANEL ===== */
.order-panel {
  margin-bottom: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  flex-wrap: wrap;
}

.order-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.order-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.order-list {
  display: flex;
  flex-direction: column;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: grab;
  user-select: none;
}

.order-item:last-child {
  border-bottom: none;
}

.order-item:hover {
  background: rgba(255,255,255,0.03);
}

.order-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.order-item.drag-over-item {
  background: var(--accent-dim);
  border-color: var(--border-active);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.order-handle {
  color: var(--text-muted);
  flex-shrink: 0;
  cursor: grab;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 3px;
  transition: color var(--transition);
}

.order-item:hover .order-handle {
  color: var(--text-secondary);
}

.order-pos {
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: #080c12;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

.order-screen {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 44px;
}

.order-name {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-aspect {
  font-size: 0.68rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  min-width: 32px;
  text-align: center;
}

.order-arrows {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.order-arrow {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.order-arrow:hover:not(:disabled) {
  background: var(--accent-dim);
  border-color: var(--border-active);
  color: var(--accent);
}

.order-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .order-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .order-item {
    gap: 7px;
    padding: 8px 10px;
  }
  .order-screen { display: none; }
}

/* ===== FILE ITEM — 削除ボタン & 追加ボタン ===== */
.file-item {
  position: relative;
}

.file-item-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  transition: all var(--transition);
}

.file-item-remove:hover {
  background: rgba(248,113,113,0.12);
  border-color: rgba(248,113,113,0.35);
  color: var(--red);
}

.file-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
}

.file-add-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.file-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
