﻿/* ==========================================================================
   1. Global Styles
   ========================================================================== */
html,
body {
  height: 100%;
  margin: 0;
  background: #000014;
  color: #e7eaf3;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  cursor: grab;
}

canvas {
  display: block;
}

body:focus,
body:active {}

body.free-look canvas {
  cursor: grabbing !important;
}

/* ==========================================================================
   2. Top UI Bar
   ========================================================================== */
.top-ui {
  cursor: pointer;
  position: fixed;
  z-index: 20;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(10, 12, 28, 0.55);
  border: 1px solid rgba(170, 190, 255, 0.15);
  padding: 6px 8px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

@media (max-width: 328px) {
  .top-ui {
    flex-wrap: wrap;
    justify-content: center;
  }
}

.gear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(170, 190, 255, 0.2);
  background: linear-gradient(180deg, rgba(30, 35, 70, 0.75), rgba(14, 16, 38, 0.75));
  color: #cfe6ff;
  cursor: pointer;
  user-select: none;
  transition: transform 0.06s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.gear-btn:hover {
  box-shadow: 0 0 0 3px rgba(110, 160, 255, 0.15) inset;
}

.gear-btn:active {
  transform: translateY(1px) scale(0.98);
}

.gear-btn .ic {
  font-size: 18px;
  line-height: 1;
}

/* ==========================================================================
   3. Panels (Common Styles)
   ========================================================================== */
.debug-panel,
.info-panel,
.help-panel {
  position: fixed;
  min-width: 360px;
  max-width: 480px;
  background: rgba(12, 14, 30, 0.85);
  border: 1px solid rgba(170, 190, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  color: #eaf2ff;
  backdrop-filter: blur(2px);
  height: fit-content;
  z-index: 9998;
}

.debug-panel, .info-panel, .help-panel {
  cursor: default;
  z-index: 9999;
}
.gear-btn:focus,
.dp-btn:focus,
.hp-close:focus,
.ip-close:focus {
  outline: none;
}
.debug-panel.hidden,
.info-panel.hidden,
.help-panel.hidden {
  display: none;
}

/* Firefox */
.help-panel {
  scrollbar-width: thin;
  scrollbar-color: #00a8ff33 #0a0e24f2;
}

/* Chrome, Edge, Safari */
.help-panel::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.help-panel::-webkit-scrollbar-track {
  background: #0a0e24f2;
}

.help-panel::-webkit-scrollbar-thumb {
  background-color: #00a8ff33;
  border-radius: 6px;
  border: 3px solid #0a0e24f2;
}

.help-panel::-webkit-scrollbar-thumb:hover {
  background-color: #00a8ff66;
}

/* Panel Headers */
.dp-head,
.ip-head,
.hp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(170, 190, 255, 0.12);
}

.dp-head{
  gap: 50px;
}

.hp-head{
display: grid !important;
grid-template-columns: auto 30px;
text-align: center;
}

.dp-title,
.ip-title,
.hp-title {
  font: 600 14px/1 system-ui;
  flex-grow: 1;
}

.ip-title {
  text-align: center;
  margin-left: 10px;
  line-height: 20px;
}

.ip-close,
.hp-close {
  background: transparent;
  border: 0;
  color: #cfe6ff;
  font: 600 16px/1 system-ui;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}

.ip-close:hover,
.hp-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Panel Bodies */
.dp-body,
.ip-body,
.hp-body {
  padding: 12px 14px;
}

/* ==========================================================================
   4. Debug Panel
   ========================================================================== */
.dp-head {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 140, 190, 0.15);
  background: linear-gradient(180deg, rgba(45, 25, 55, 0.4), rgba(25, 15, 35, 0.4));
}

.dp-title {
  font-weight: 600;
  font-size: 13px;
  color: #ffb8e6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.dp-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dp-btn {
  height: 34px !important;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 140, 190, 0.25);
  background: linear-gradient(180deg, rgba(70, 40, 80, 0.8), rgba(40, 20, 50, 0.8));
  color: #ffc8eb;
  font-size: 12px;
  letter-spacing: 0.2px;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: box-shadow 0.2s ease, transform 0.06s ease;
  white-space: nowrap;
}

.dp-tabs .dp-btn:nth-child(1){
  width: 110px;
}

.dp-tabs .dp-btn:nth-child(2), .dp-tabs .dp-btn:nth-child(3), .dp-tabs .dp-btn:nth-child(4){
  width: 90px;
}

@media(max-width: 460px){

  .dp-tabs{
    flex-wrap: wrap;
  }
    .dp-tabs .dp-btn:nth-child(2), .dp-tabs .dp-btn:nth-child(3), .dp-tabs .dp-btn:nth-child(4){
    width: 110px !important;
  }
}

@media(max-width: 321px){
  .dp-title{
    display: none;
  }
}

.dp-btn:hover {
  box-shadow: 0 0 0 2px rgba(255, 140, 190, 0.2) inset;
}

.dp-btn:active {
  transform: translateY(1px);
}

.dp-body {
  display: grid;
  gap: 12px;
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #22182D #100D20;
}

.dp-body::-webkit-scrollbar {
  width: 8px;
}

.dp-body::-webkit-scrollbar-track {
  background: #100D20;
}

.dp-body::-webkit-scrollbar-thumb {
  background-color: #22182D;
  border-radius: 4px;
}

.dp-body::-webkit-scrollbar-thumb:hover {
  background-color: #3A2D4A;
}

.dp-section {
  padding: 8px;
  border-radius: 8px;
  background: rgba(30, 15, 40, 0.3);
  border: 1px solid rgba(255, 140, 190, 0.08);
}

.dp-section:not(:first-child) {
  margin-top: 12px;
}

.dp-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #d4a8ff;
  margin-bottom: 15px;
  margin-top: 6px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dp-subsection-title {
  font-size: 11px;
  font-weight: 600;
  color: #aab5d6;
  text-transform: uppercase;
  margin-top: 12px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* Tabs */
.dp-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(170, 190, 255, .12);
}

@media(max-width:330px) {
  .dp-tabs {
    flex-wrap: wrap;
  }
}

.dp-btn.active {
  box-shadow: 0 0 0 2px rgba(255, 140, 190, 0.2) inset;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.dp-placeholder {
  text-align: center;
  color: #aab5d6;
  font-size: 14px;
}

/* Grid & Controls */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 120px);
  gap: 8px 12px;
  justify-content: center;
  align-items: center;
}

.grid-resolution{
  grid-template-columns: repeat(3, 120px);
}

.grid-zoom {
  display: grid;
  grid-template-columns: auto 175px;
  gap: 10px 12px;
  align-items: center;
}

@media(max-width: 450px) {
  .grid-zoom{
    display: flex;
    flex-direction: column;
  }

  .grid{
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
}

.grid label {
  font-size: 14px;
  color: #aab5d6;
  white-space: nowrap;
  overflow: hidden;
  text-align: center;
}

.code-output {
  margin-top: 8px;
  padding: 8px;
  background: rgba(10, 5, 15, 0.6);
  border: 1px solid rgba(255, 140, 190, 0.12);
  border-radius: 6px;
  font-family: Tahoma;
  font-size: 11.3px;
  line-height: 1.8;
  color: #d8c4ff;
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

@media(max-width: 300px) {
  .quantity-control {
    gap: 10px;
    flex-direction: column;
  }
}

.render-btn{
      height: 32px;
background: rgba(90, 162, 255, 0.15);
border: 1px solid rgba(90, 162, 255, 0.3);
border-radius: 6px;
color: #5aa2ff;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}

.quantity-btn { touch-action: manipulation; }

.quantity-control input {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(170, 190, 255, 0.18);
  border-radius: 8px;
  color: #eaf2ff;
  font: 13px ui-monospace, Menlo, Consolas;
  outline: none;
  transition: all 0.2s ease;
}

.quantity-control input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(90, 162, 255, 0.4);
}

.quantity-btn {
  background: rgba(90, 162, 255, 0.15);
  border: 1px solid rgba(90, 162, 255, 0.3);
  color: #5aa2ff;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}

.quantity-btn:hover, .render-btn:hover {
  background: rgba(90, 162, 255, 0.25);
  border-color: rgba(90, 162, 255, 0.5);

}

.quantity-btn:active, .render-btn:active, .render-btn.active {
  background: rgba(90, 162, 255, 0.35);
}

/* ==========================================================================
   5. Info Panel
   ========================================================================== */
.ip-body {
  font: 15px Tahoma;
  color: #d7e6ff
}

.ip-body p {
  margin: 0 0 10px
}

a:link,
a:visited {
  text-decoration: none;
  color: #bc968f
}

.general-link:link,
.general-link:hover {
  border-bottom: 1px solid
}

.light-green:link,
.light-green:visited {
  line-height: 21px;
  transition: .4s;
  font-size: 14px
}

.light-green:hover {
  color: #FF3000;
  border-bottom: 1px solid
}

a.light-green {
  color: darkseagreen;
  transition: .4s
}

.social-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all .3s ease;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(12, 14, 30, .85);
  height: 80px
}

.social-item:hover {
  border-color: rgba(255, 255, 255, .2);
  box-shadow: 0 8px 25px rgba(0, 0, 0, .3)
}

.social-label {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-align: center
}

.vk-icon,
.telegram-icon {
  width: 48px;
  height: 48px
}

.telegram-icon .st0 {
  fill: rgba(12, 14, 30, .85)
}

.telegram-icon .st1 {
  fill: #c8daea
}

.telegram-icon .st2 {
  fill: #a9c9dd
}

/* ==========================================================================
   6. Help Panel
   ========================================================================== */
.hp-body {
  font: 15px Tahoma;
  color: darkseagreen
}

.hp-body kbd {
  /*font: 600 13.5px/1 ui-monospace, Menlo, Consolas;*/
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(170, 190, 255, .18);
  color: #eaf2ff;
  display: inline-block;
  margin: 0 2px
}

.hp-body .hint {
  opacity: .9;
  color: #d7e6ff
}

.hp-body ul {
  margin: 8px 0 0 18px;
  padding: 0
}

.hp-body li {
  margin: 6px 0
}

.accordion-header {
  /* cursor: pointer; */
  padding: 10px 2px;
  font-size: 16px;
  color: #0099cc;
  transition: color .3s ease;
  position: relative;
  border-bottom: 1px solid rgba(170, 190, 255, .12);
  overflow-anchor: none
}

.accordion-header:hover {
  color: #33b5e5
}

.accordion-header::after {
  content: '＋';
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  transition: transform .3s ease
}

.accordion-header.active::after {
  content: '−';
  transform: translateY(-50%) rotate(180deg)
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height .5s ease-out, padding .5s ease-out, opacity .5s ease-out;
  padding: 0 10px;
  opacity: 0
}

.accordion-content p {
  margin-top: 0;
  margin-bottom: 0
}

.accordion-header.active+.accordion-content {
  max-height: 5000px;
  padding: 15px 10px 5px;
  opacity: 1;
  transition: max-height .5s ease-in, padding .5s ease-in, opacity .5s ease-in
}

/* ==========================================================================
   7. Overlays & Effects
   ========================================================================== */
/* Loader */
#loaderOverlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.66);
  backdrop-filter: blur(2px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease
}

#loaderOverlay.show {
  opacity: 1;
  pointer-events: auto
}

.lo-card {
  min-width: 320px;
  max-width: 70vw;
  background: #0b1020;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  padding: 18px 18px 14px;
  color: #cfe3ff
}

.lo-title {
  font: 600 14px/1.2 system-ui, Segoe UI, Roboto, Arial;
  color: #cfe3ff;
  opacity: .9;
  margin-bottom: 10px;
  letter-spacing: .3px
}

.lo-bar-wrap {
  height: 10px;
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
  overflow: hidden;
  position: relative
}

.lo-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5aa2ff, #8ac5ff);
  transition: width .2s ease
}

.lo-sub {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font: 500 12px/1.2 ui-monospace, Menlo, Consolas;
  color: #aaccff;
  opacity: .9
}

.lo-hint {
  margin-top: 10px;
  font: 400 11px/1.3 system-ui;
  color: #9fb8e6;
  opacity: .8
}

.lo-indet {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
  animation: ind 1.1s linear infinite
}

.lo-error {
  color: #ffb3b3
}

/* Notification */
#appNotification {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#appNotification.show {
  opacity: 1;
}

.notification-content {
  background: rgba(12, 14, 30, .85);
  border: 1px solid rgba(170, 190, 255, .18);
  border-radius: 14px;
  padding: 12px 20px;
  color: #eaf2ff;
  font: 600 14px/1 system-ui;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
  text-align: center;
  max-width: 300px;
}

/* Click Effect */
.click-effect-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99999;
}

.click-effect {
  position: fixed;
  border-radius: 50%;
  border: 3px solid rgba(255, 40, 40, 1);
  background: rgba(255, 60, 60, 0.4);
  transform: translate(-50%, -50%);
  opacity: 1;
  width: 50px;
  height: 50px;
  animation: click-anim 3s ease-out forwards;
  box-shadow: 0 0 10px rgba(255, 40, 40, 0.6);
}

/* ==========================================================================
   8. Badges
   ========================================================================== */
.free-badge {
  cursor: default;
  min-width: 31px;
  text-align: center;
  margin-left: 8px;
  padding: 6px 8px;
  font: 600 12px system-ui;
  opacity: .9;
  color: #fff;
  border-radius: 6px;
  border: 1px solid rgba(170, 190, 255, 0.2);
  user-select: none;
}

.free-badge.hidden {
  display: none
}

.badge--free {
  background: red;
  color: #cfe6ff
}

.badge--fix {
  background: #555;
  color: #cfe6ff
}

/* ==========================================================================
   9. Keyframes
   ========================================================================== */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(110, 160, 255, 0);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(110, 160, 255, 0.18);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(110, 160, 255, 0);
  }
}

@keyframes click-anim {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(2.7);
    opacity: 0;
  }
}

@keyframes ind {
  to {
    transform: translateX(100%)
  }
}

.top-ui.collapsed .gear-btn:not(#panelToggle):not(#iframeClose),
.top-ui.collapsed .free-badge {
  display: none !important;
}