/* ================= RESET ================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}




/* Стартовая страница */
.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* Герой секция */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin: 2rem 0 4rem;
  padding: 2rem 0;
}

@media (max-width: 968px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-title .highlight {
  color: #3b82f6;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.hero-description {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-color);
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* Статистика героя */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.stat-icon {
  font-size: 2rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 12px;
  color: var(--primary-color);
}

.stat-content h3 {
  font-size: 1rem;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

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

/* Визуальная часть героя */
.hero-visual {
  display: flex;
  justify-content: center;
}

.visual-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.visual-screen {
  background: #0a0f1a;
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid #334155;
}

.screen-content {
  text-align: center;
}

.screen-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.screen-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #475569;
}

.screen-dot.active {
  background: #3b82f6;
}

.screen-text {
  font-family: 'SF Mono', monospace;
  color: #94a3b8;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.screen-loading {
  height: 4px;
  background: #1e293b;
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 60%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  border-radius: 2px;
  animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

/* Секция инструментов */
.tools-section {
  margin: 4rem 0;
  padding: 2rem 0;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.tool-card {
  background: var(--surface-color);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.tool-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
}

.tool-card.coming-soon {
  opacity: 0.7;
  cursor: not-allowed;
}

.tool-card.coming-soon:hover {
  transform: none;
  border-color: var(--border-color);
  box-shadow: none;
}

.tool-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.tool-card h3 {
  font-size: 1.3rem;
  color: var(--text-color);
  margin-bottom: 0.75rem;
}

.tool-card p {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.tool-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Секция преимуществ */
.features-section {
  margin: 4rem 0;
  padding: 3rem 0;
  background: var(--surface-color);
  border-radius: 20px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature {
  text-align: center;
  padding: 1.5rem;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature h3 {
  font-size: 1.3rem;
  color: var(--text-color);
  margin-bottom: 0.75rem;
}

.feature p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* CTA секция */
.cta-section {
  margin: 4rem 0;
}

.cta-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.cta-card h2 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 1rem;
}

.cta-card p {
  color: #94a3b8;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.cta-btn.primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
}

.cta-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.cta-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Футер */
.footer-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.footer-logo img {
  height: 32px;
  width: 32px;
}

.footer-text {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.footer-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

/* Адаптивность */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .cta-card {
    padding: 2rem 1rem;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .cta-btn {
    width: 100%;
    max-width: 300px;
  }
}

/* ================= VARIABLES ================= */
:root{
  --bg:#0f172a;
  --panel:#111827;
  --card:#1e293b;
  --border:#334155;
  --accent:#3b82f6;
  --accent-soft:#60a5fa;
  --text:#f1f5f9;
  --muted:#94a3b8;
  --radius:14px;
  --radius-sm:8px;
  --transition:0.2s ease;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ================= BODY ================= */
body{
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ================= HEADER ================= */
.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0.75rem 1rem;
  background: var(--panel);
  border-bottom:1px solid var(--border);
}

.brand{
  display:flex;
  align-items:center;
  gap:.6rem;
  font-weight:600;
  white-space:nowrap;
}

.brand img{
  width:32px;
  height:32px;
  max-width:32px;
  max-height:32px;
  display:block;
}

/* ================= NAV ================= */
nav{
  display:flex;
  gap:.4rem;
}

nav a{
  padding:.4rem .8rem;
  border-radius:8px;
  text-decoration:none;
  color:var(--text);
  font-size:.9rem;
}

nav a.active{
  background:var(--accent);
}



/* ================= MAIN ================= */
main{
  max-width:1200px;
  margin:0 auto;
  padding:1rem;
}

/* ================= CARD ================= */
.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:1rem;
  margin-bottom:1rem;
}

/* ================= BUTTONS ================= */
button, select{
  background:#020617;
  color:var(--text);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:.45em .8em;
  cursor:pointer;
  transition:var(--transition);
}

button:hover{
  border-color:var(--accent);
}

button:active{
  transform:scale(.97);
}

/* ================= PROGRESS ================= */
.progress{
  height:12px;
  background:#020617;
  border-radius:999px;
  overflow:hidden;
  margin:.4rem 0;
}

.progress span{
  display:block;
  height:100%;
  width:0%;
  background:linear-gradient(90deg,var(--accent),var(--accent-soft));
}

/* ================= KEYBOARD ================= */
.kb{
  display:grid;
  grid-template-columns:repeat(15, 1fr);
  gap:6px;
}

.key{
  padding:.55em;
  font-size:.75rem;
  text-align:center;
  background:#020617;
  border:1px solid var(--border);
  border-radius:6px;
}

.key.wide{grid-column:span 2;}
.key.xwide{grid-column:span 3;}

.key.active{
  background:var(--accent);
}

/* ================= GAMEPAD ================= */
.gamepad-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px,1fr));
  gap:1rem;
}

.stick{
  width:180px;
  height:180px;
  border-radius:50%;
  background:#020617;
  border:1px solid var(--border);
  position:relative;
  margin:auto;
}

.stick-dot{
  width:14px;
  height:14px;
  background:var(--accent);
  border-radius:50%;
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
}

.gamepad-buttons{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:6px;
}

.gp-btn{
  padding:.4em;
  text-align:center;
  border:1px solid var(--border);
  border-radius:6px;
  background:#020617;
}

.gp-btn.active{
  background:var(--accent);
}

/* ================= MOUSE ================= */
.mouse-buttons{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:6px;
  margin-bottom:.5rem;
}

.mouse-btn{
  padding:.4em;
  text-align:center;
  background:#020617;
  border:1px solid var(--border);
  border-radius:6px;
}

.mouse-btn.active{
  background:var(--accent);
}

.canvas-wrap{
  width:100%;
  height:320px;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
}

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

/* ================= MONITOR ================= */
/* Стиль для полноэкранного режима */
.monitor-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  background: black;
}

/* Стиль для обычного режима */
#mon:not(.monitor-fullscreen) {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border: 1px solid #444;
  border-radius: 8px;
}

.card {
  position: relative;
  overflow: hidden;
}
/* ================= mobile ================= */
/* Мобильное меню */
.mobile-nav {
  position: fixed;
  top: 0;
  left: -100%;
  width: 300px;
  height: 100vh;
  background-color: var(--surface-color);
  z-index: 1000;
  transition: left 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.mobile-nav.active {
  left: 0;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: #0f172a;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--text-color);
}

.mobile-brand img {
  height: 32px;
  width: 32px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.mobile-nav-links {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: #0f172a;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
}

.nav-icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

/* Оверлей */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Адаптивность меню */
@media (max-width: 768px) {
  nav {
    display: none !important;
  }
  
  .burger-btn {
    display: block !important;
  }
}

@media (min-width: 769px) {
  .mobile-nav {
    display: none !important;
  }
  
  .nav-overlay {
    display: none !important;
  }
}

/* Стили для бургер кнопки */
#burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.5rem;
  color: var(--text-color);
}

#burger.active {
  color: var(--primary-color);
}

/* Для мобильных устройств */
@media (max-width: 768px) {
  #burger {
    display: block;
  }
  
  .mobile-nav {
    width: 280px;
  }
}

@media (max-width: 480px) {
  .mobile-nav {
    width: 100%;
  }
}

/* Блокировка скролла */
body.no-scroll {
  overflow: hidden;
}
/* ================= mobile ================= */
/* ===== HEADER ===== */
.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0.75rem 1rem;
  background:#0f172a;
  position:sticky;
  top:0;
  z-index:1000;
}

.brand{
  display:flex;
  align-items:center;
  gap:.5rem;
}

.brand img{
  width:32px;
  height:32px;
}

/* ===== NAV DESKTOP ===== */
.nav{
  display:flex;
  gap:1rem;
}

.nav a{
  color:#f1f5f9;
  text-decoration:none;
  font-weight:500;
}

.nav a:hover{
  color:#3b82f6;
}


.warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  padding: 12px;
  border-radius: 8px;
  margin: 10px 0;
  font-size: 0.9em;
}

#keyInfo {
  margin-top: 20px;
  padding: 15px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.current-key {
  padding: 10px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 6px;
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 15px;
  text-align: center;
  transition: all 0.3s ease;
}

.current-key.blocked {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.current-key.warning-msg {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid #f59e0b;
}

.key-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  font-family: monospace;
}

.key-stats div {
  padding: 8px;
  background: rgba(100, 116, 139, 0.1);
  border-radius: 4px;
}

.key-stats span {
  color: #3b82f6;
  font-weight: bold;
}

#keyHistory {
  margin-top: 20px;
  padding: 15px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

#keyHistory h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1em;
  color: #64748b;
}

#historyList {
  max-height: 200px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin: 4px 0;
  background: rgba(100, 116, 139, 0.05);
  border-radius: 4px;
  border-left: 3px solid #3b82f6;
}

.history-time {
  color: #64748b;
  font-size: 0.8em;
  min-width: 70px;
}

.history-key {
  color: #3b82f6;
  font-weight: bold;
  flex-grow: 1;
  margin: 0 10px;
}

.history-code {
  color: #94a3b8;
  font-size: 0.85em;
  font-family: monospace;
}

/* Стили для F-клавиш */
.key.f-key {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b !important;
  position: relative;
}

.key.f-key::after {
  content: "🔒";
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 0.7em;
  opacity: 0.7;
}

.keyboard-row.row-0 {
  margin-bottom: 15px !important;
  border-bottom: 2px solid rgba(245, 158, 11, 0.3);
  padding-bottom: 10px;
}

.key {
  /* твои существующие стили клавиш */
  position: relative;
  transition: all 0.15s ease;
}

.key.active {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
  color: white !important;
  transform: translateY(2px);
  box-shadow: 0 3px 6px rgba(59, 130, 246, 0.4);
  z-index: 1;
}

.key.f-key.active {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  box-shadow: 0 3px 6px rgba(245, 158, 11, 0.4);
}

/* Полоса прокрутки для истории */
#historyList::-webkit-scrollbar {
  width: 6px;
}

#historyList::-webkit-scrollbar-track {
  background: rgba(100, 116, 139, 0.1);
  border-radius: 3px;
}

#historyList::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 3px;
}


/*--gamepad--/*

/* Статус подключения */
.status-disconnected,
.status-connected {
  display: flex;
  align-items: center;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.status-disconnected {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
  border: 2px solid #ef4444;
  color: #ef4444;
}

.status-connected {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
  border: 2px solid #22c55e;
  color: #22c55e;
}

.status-xbox { color: #107c10 !important; border-color: #107c10 !important; }
.status-playstation { color: #003087 !important; border-color: #003087 !important; }
.status-nintendo { color: #e60012 !important; border-color: #e60012 !important; }
.status-generic { color: #8b5cf6 !important; border-color: #8b5cf6 !important; }

.status-icon {
  font-size: 2em;
  margin-right: 15px;
}

.status-text {
  flex-grow: 1;
  font-weight: 500;
}

.status-type {
  font-weight: bold;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
}

/* Макет геймпада */
.gamepad-layout {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.gamepad-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
}

.gamepad-left,
.gamepad-right,
.gamepad-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gamepad-center {
  flex: 2;
}

/* Стики */
.stick-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.stick-label {
  margin-bottom: 8px;
  font-size: 0.9em;
  color: #94a3b8;
}

.stick {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid #475569;
  position: relative;
  overflow: hidden;
}

.stick-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
}

.stick-value {
  margin-top: 8px;
  font-size: 0.8em;
  color: #64748b;
  font-family: monospace;
}

/* Кнопки действий */
.face-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.face-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2em;
  color: white;
  border: 3px solid;
  transition: all 0.1s ease;
  cursor: default;
}

.btn-a { border-color: #22c55e; }
.btn-b { border-color: #ef4444; }
.btn-x { border-color: #3b82f6; }
.btn-y { border-color: #eab308; }

/* D-Pad */
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 5px;
  width: 120px;
  height: 120px;
  position: relative;
}

.dpad-up,
.dpad-down,
.dpad-left,
.dpad-right {
  background: #475569;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: bold;
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-center { grid-column: 2; grid-row: 2; background: #334155; border-radius: 8px; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }

/* Бамперы и триггеры */
.bumper-trigger-row {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.bumper,
.trigger {
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: bold;
  text-align: center;
  min-width: 80px;
  border: 2px solid;
  transition: all 0.1s ease;
}

.bumper {
  background: #8b5cf6;
  color: white;
  border-color: #7c3aed;
}

.trigger {
  background: #06b6d4;
  color: white;
  border-color: #0891b2;
}

/* Специальные кнопки */
.gamepad-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.special-buttons {
  display: flex;
  gap: 20px;
}

.special-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #64748b;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2em;
  border: 2px solid #475569;
}

.shoulder-buttons {
  display: flex;
  gap: 20px;
}

.shoulder-btn {
  padding: 10px 25px;
  background: #334155;
  color: #cbd5e1;
  border-radius: 20px;
  font-weight: bold;
  border: 2px solid #475569;
}

/* Активное состояние */
.face-btn.active,
.dpad-up.active,
.dpad-down.active,
.dpad-left.active,
.dpad-right.active,
.bumper.active,
.trigger.active,
.special-btn.active,
.shoulder-btn.active {
  transform: translateY(2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  filter: brightness(1.2);
}

/* История */
#gamepadHistory {
  margin-top: 20px;
  padding: 15px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

#gamepadHistory h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1em;
  color: #64748b;
}

#historyList {
  max-height: 200px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin: 4px 0;
  background: rgba(100, 116, 139, 0.05);
  border-radius: 4px;
  border-left: 3px solid;
}

.history-button {
  border-left-color: #3b82f6;
}

.history-axis {
  border-left-color: #8b5cf6;
}

.history-time {
  color: #64748b;
  font-size: 0.8em;
  min-width: 70px;
}

.history-button-name {
  color: #3b82f6;
  font-weight: bold;
  flex-grow: 1;
  margin: 0 10px;
}

.history-value {
  color: #94a3b8;
  font-size: 0.85em;
  font-family: monospace;
  background: rgba(30, 41, 59, 0.5);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Адаптивность */
@media (max-width: 768px) {
  .gamepad-top {
    flex-direction: column;
  }
  
  .gamepad-left,
  .gamepad-right,
  .gamepad-center {
    margin-bottom: 20px;
  }
  
  .bumper-trigger-row {
    flex-direction: column;
    align-items: center;
  }
  
  .gamepad-bottom {
    flex-direction: column;
    gap: 15px;
  }
  
  .special-buttons,
  .shoulder-buttons {
    justify-content: center;
  }
}


/*--------/*
/* Общие адаптивные стили */
@media (max-width: 1200px) {
  .keyboard-row {
    gap: 3px !important;
  }
  
  .key {
    padding: 8px 4px !important;
    font-size: 0.75em !important;
  }
}

@media (max-width: 768px) {
  /* Адаптация клавиатуры */
  .keyboard-container {
    overflow-x: auto;
    padding: 10px;
    margin: 0 -10px;
  }
  
  .kb {
    min-width: 600px;
  }
  
  .keyboard-row {
    gap: 2px !important;
    margin-bottom: 4px !important;
  }
  
  .key {
    padding: 6px 3px !important;
    font-size: 0.7em !important;
    min-height: 35px !important;
  }
  
  .key-space {
    min-width: 150px !important;
  }
  
  /* Адаптация геймпада */
  .gamepad-top {
    flex-direction: column !important;
  }
  
  .gamepad-left,
  .gamepad-right,
  .gamepad-center {
    width: 100% !important;
    margin-bottom: 20px !important;
  }
  
  .stick {
    width: 80px !important;
    height: 80px !important;
  }
  
  .face-buttons {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin: 20px auto !important;
    max-width: 150px !important;
  }
  
  .face-btn {
    width: 45px !important;
    height: 45px !important;
    font-size: 1em !important;
  }
  
  .center-buttons {
    flex-direction: column !important;
    gap: 20px !important;
  }
  
  .dpad-container,
  .special-buttons {
    width: 100% !important;
    justify-content: center !important;
  }
  
  .trigger-row {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: center !important;
  }
  
  .bumper,
  .trigger {
    min-width: 100px !important;
  }
  
  /* Информационные блоки */
  .keyboard-info,
  .keyboard-history,
  #gamepadInfo,
  #gamepadHistory {
    padding: 10px !important;
  }
  
  .key-stats-grid,
  .info-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .current-key-display {
    flex-direction: column !important;
    text-align: center !important;
    gap: 10px !important;
  }
  
  .key-preview {
    font-size: 2em !important;
  }
}

@media (max-width: 480px) {
  /* Мобильная адаптация */
  .key {
    padding: 5px 2px !important;
    font-size: 0.65em !important;
    min-height: 30px !important;
  }
  
  .key-space {
    min-width: 120px !important;
  }
  
  .key-modifier {
    font-size: 0.6em !important;
  }
  
  /* Геймпад на мобильных */
  .stick {
    width: 60px !important;
    height: 60px !important;
  }
  
  .stick-dot {
    width: 20px !important;
    height: 20px !important;
  }
  
  .face-btn {
    width: 40px !important;
    height: 40px !important;
  }
  
  .special-btn,
  .shoulder-btn {
    width: 40px !important;
    height: 40px !important;
    font-size: 1em !important;
  }
  
  .bumper,
  .trigger {
    min-width: 80px !important;
    padding: 8px 12px !important;
    font-size: 0.9em !important;
  }
  
  /* Статус */
  .status-disconnected,
  .status-connected {
    flex-direction: column !important;
    text-align: center !important;
    gap: 10px !important;
    padding: 12px !important;
  }
  
  .status-icon {
    margin-right: 0 !important;
    font-size: 1.5em !important;
  }
  
  /* Информационные сетки */
  .key-stats-grid,
  .info-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  
  .history-header {
    flex-direction: column !important;
    gap: 10px !important;
    text-align: center !important;
  }
  
  .history-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 5px !important;
  }
  
  .history-time {
    min-width: auto !important;
    font-size: 0.7em !important;
  }
}

/* Планшетная адаптация (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .keyboard-row {
    gap: 4px !important;
  }
  
  .key {
    padding: 10px 6px !important;
    font-size: 0.85em !important;
    min-height: 45px !important;
  }
  
  .key-space {
    min-width: 200px !important;
  }
  
  .gamepad-top {
    flex-wrap: wrap !important;
  }
  
  .gamepad-left,
  .gamepad-right {
    flex: 1 !important;
    min-width: 200px !important;
  }
  
  .gamepad-center {
    order: -1 !important;
    width: 100% !important;
    margin-bottom: 30px !important;
  }
  
  .center-buttons {
    flex-direction: row !important;
    justify-content: space-around !important;
  }
}

/* Высота экрана */
@media (max-height: 600px) {
  .keyboard-history,
  #gamepadHistory {
    max-height: 150px !important;
  }
  
  .history-list {
    max-height: 100px !important;
  }
  
  .keyboard-row {
    margin-bottom: 3px !important;
  }
  
  .key {
    min-height: 25px !important;
    padding: 4px 3px !important;
  }
}

/* Ориентация телефона */
@media (orientation: portrait) and (max-width: 768px) {
  .keyboard-container {
    transform: scale(0.9);
    transform-origin: top center;
  }
  
  .gamepad-layout {
    transform: scale(0.95);
    transform-origin: top center;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .keyboard-row {
    gap: 1px !important;
  }
  
  .key {
    padding: 3px 2px !important;
    font-size: 0.6em !important;
    min-height: 20px !important;
  }
  
  .gamepad-top {
    flex-direction: row !important;
  }
  
  .gamepad-center {
    flex-direction: row !important;
  }
}

/* Адаптивные контейнеры */
.keyboard-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gamepad-layout {
  position: relative;
  transition: all 0.3s ease;
}


/* Исправленные стили для стиков */
.stick {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid #475569;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
}

.stick-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  position: absolute;
  top: calc(50% - 15px);
  left: calc(50% - 15px);
  transition: transform 0.1s ease-out;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

/* Центрирующие линии (для визуального контроля) */
.stick::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(100, 116, 139, 0.3);
  z-index: 1;
}

.stick::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(100, 116, 139, 0.3);
  z-index: 1;
}

/* Адаптивные размеры стиков */
@media (max-width: 768px) {
  .stick {
    width: 80px;
    height: 80px;
  }
  
  .stick-dot {
    width: 20px;
    height: 20px;
    top: calc(50% - 10px);
    left: calc(50% - 10px);
  }
}

@media (max-width: 480px) {
  .stick {
    width: 60px;
    height: 60px;
  }
  
  .stick-dot {
    width: 16px;
    height: 16px;
    top: calc(50% - 8px);
    left: calc(50% - 8px);
  }
}

/* Для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
  .stick {
    width: 100px;
    height: 100px;
  }
  
  .stick-dot {
    width: 25px;
    height: 25px;
    top: calc(50% - 12.5px);
    left: calc(50% - 12.5px);
  }
}

/* Контейнер стика должен быть правильно центрирован */
.stick-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
}

/* Значения стиков */
.stick-value {
  margin-top: 8px;
  font-size: 0.8em;
  color: #64748b;
  font-family: monospace;
  text-align: center;
  min-height: 1.2em;
  padding: 4px 8px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 4px;
  min-width: 120px;
}

/* Фокус на стики при наведении */
.stick:hover .stick-dot {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Активный стик (когда двигается) */
.stick-dot.moving {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
/*--------------------------------------------------------------------------------------------------------------------------------*/

/*------------------------------------------------------------------------------------------------------------------------------------------*/