:root {
   --bg: #eaedf5;
   --frame: #ffffff;
   --panel: #f7f9fc;
   --panel-lite: #e5e9f2;
   --screen: #0b1328;
   --btn: #f0f3f7;
   --btn-border: #b4bac5;
   --text: #20242b;
   --muted: #7a7f85;
   --accent: #ff7a00;
}

* {
   box-sizing: border-box;
}

body {
   margin: 0;
   background: var(--bg);
   color: var(--text);
   font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
      Helvetica, Arial, sans-serif;
   display: flex;
   flex-direction: column;
   align-items: center;
   padding: 20px;
   min-height: 100vh;
}

.device {
   position: relative;
   background: var(--frame);
   border: 4px solid #bfc4ce;
   border-radius: 20px;
   box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15),
      inset 0 2px 4px rgba(255, 255, 255, 0.6);
   width: 100%;
   /* height: 1220px; */
   max-width: 1440px;
}

.device::before {
   content: "";
   position: absolute;
   inset: 0;
   border-radius: 16px;
   background: radial-gradient(
            circle at 20px 20px,
            #d5d8df 0,
            #a5a9b1 60%,
            #8a8f99 100%
         )
         0 0/20px 20px,
      radial-gradient(
            circle at calc(100% - 20px) 20px,
            #d5d8df 0,
            #a5a9b1 60%,
            #8a8f99 100%
         )
         100% 0/20px 20px,
      radial-gradient(
            circle at 20px calc(100% - 20px),
            #d5d8df 0,
            #a5a9b1 60%,
            #8a8f99 100%
         )
         0 100%/20px 20px,
      radial-gradient(
            circle at calc(100% - 20px) calc(100% - 20px),
            #d5d8df 0,
            #a5a9b1 60%,
            #8a8f99 100%
         )
         100% 100%/20px 20px;
   background-repeat: no-repeat;
   pointer-events: none;
}

.preview.part {
   flex-direction: column;
}

header {
   position: relative;
   background: linear-gradient(#fff, #e5e9f2);
   color: var(--text);
   padding: 20px 24px;
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 20px;
   border-radius: 16px 16px 0 0;
   box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

header::after {
   content: "";
   position: absolute;
   top: -9px;
   right: 24px;
   width: 14px;
   height: 14px;
   border-radius: 50%;
   background: #2cd355;
   box-shadow: 0 0 6px #2cd355, inset 0 -2px 4px rgba(0, 0, 0, 0.4);
   transition: background 0.2s, box-shadow 0.2s;
}

header.busy::after {
   background: #ffb300;
   box-shadow: 0 0 6px #ffb300, inset 0 -2px 4px rgba(0, 0, 0, 0.4);
}

header.error::after {
   background: #ff4d4f;
   box-shadow: 0 0 6px #ff4d4f, inset 0 -2px 4px rgba(0, 0, 0, 0.4);
}

.error-box {
   background: #ff4d4f;
   color: #fff;
   padding: 12px 24px;
   margin: 0 24px 24px;
   border-radius: 8px;
   display: none;
}

.logo {
   height: 20px;
   width: auto;
   object-fit: contain;
}

header .status {
   background: var(--panel-lite);
   border: 2px solid var(--btn-border);
   padding: 6px 12px;
   border-radius: 10px;
   letter-spacing: 0.15em;
}

.wrap {
   display: grid;
   grid-template-columns: 400px 1fr;
   grid-gap: 30px;
   padding: 24px;
}

.panel {
   background: var(--panel);
   color: var(--text);
   padding: 16px;
   border-radius: 12px;
   box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6),
      0 6px 12px rgba(0, 0, 0, 0.08);
}

.panel.screen {
   background: var(--screen);
   border: 4px solid var(--panel-lite);
   color: #e6edf7;
   height: 960px;
   position: relative;
}

.panel.screen::after {
   content: "";
   position: absolute;
   inset: 0;
   background: repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.05) 2px,
      transparent 2px,
      transparent 4px
   );
   pointer-events: none;
}

.panel h2 {
   margin: 0 0 12px;
   font-weight: 800;
   letter-spacing: 0.08em;
   font-size: 14px;
   color: var(--accent);
}

.panel.screen h2 {
   color: #d4e6ff;
}

.group {
   background: var(--panel-lite);
   border-radius: 12px;
   padding: 24px;
   margin-bottom: 24px;
}

label {
   display: block;
   font-size: 12px;
   color: #3b4d63;
   opacity: 0.9;
   margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
select {
   width: 100%;
   padding: 9px 10px;
   border-radius: 10px;
   border: 1px solid #b4bac5;
   background: #fff;
   color: var(--text);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
   outline: 2px solid var(--accent);
}

input[type="file"] {
   width: 100%;
}

.hidden-file {
   display: none;
}

.row {
   display: grid;
   grid-template-columns: 1fr 1fr;
   grid-gap: 10px;
   padding-bottom: 10px;
}

.row3 {
   display: grid;
   grid-template-columns: 1fr 1fr 1fr;
   grid-gap: 10px;
}

.btn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   background: linear-gradient(#fff, #e0e4ea);
   color: var(--text);
   border: 2px solid var(--btn-border);
   padding: 10px 14px;
   border-radius: 12px;
   cursor: pointer;
   font-weight: 700;
   letter-spacing: 0.06em;
   box-shadow: 0 4px 0 var(--btn-border), 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:hover {
   filter: brightness(1.05);
}

.btn:active {
   transform: translateY(2px);
   box-shadow: 0 2px 0 var(--btn-border), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
   opacity: 0.5;
   cursor: not-allowed;
}

#btnTelegram .dots {
   display: none;
   margin-left: 8px;
}

#btnTelegram.loading .dots {
   display: inline-flex;
}

#btnTelegram.loading .btn-label {
   display: none;
}

#btnTelegram .dots span {
   width: 4px;
   height: 4px;
   margin: 0 2px;
   background: currentColor;
   border-radius: 50%;
   animation: blink 1s infinite ease-in-out;
}

#btnTelegram .dots span:nth-child(2) {
   animation-delay: 0.2s;
}

#btnTelegram .dots span:nth-child(3) {
   animation-delay: 0.4s;
}

@keyframes blink {
   0%,
   80%,
   100% {
      opacity: 0;
   }
   40% {
      opacity: 1;
   }
}

.file-btn {
   margin-top: 8px;
}

.file-name {
   margin-left: 8px;
   font-size: 12px;
   color: var(--muted);
}

.preview {
   background: #000;
   border-radius: 8px;
   min-height: 694px;
   display: flex;
   align-items: center;
   justify-content: center;
   border: 4px inset #222;
   box-shadow: 0 0 20px rgba(255, 122, 0, 0.3);
}

.preview img {
   max-width: 100%;
   max-height: 100%;
}

.dropzone {
   border: 2px dashed var(--btn-border);
   border-radius: 12px;
   padding: 14px;
   text-align: center;
   color: var(--muted);
   background: #fff;
}

.chips {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
   margin-top: 8px;
}

.chip {
   display: inline-flex;
   align-items: center;
   gap: 4px;
   background: #fff;
   border: 1px solid var(--btn-border);
   color: var(--text);
   padding: 4px 8px;
   border-radius: 999px;
   font-size: 12px;
   cursor: pointer;
}

.chip .close {
   background: var(--panel-lite);
   border-radius: 50%;
   padding: 0 4px;
   line-height: 1;
   font-weight: 700;
   cursor: pointer;
}

.chip.active {
   outline: 2px solid var(--accent);
}

.generate {
   display: flex;
   gap: 10px;
   align-items: center;
   padding: 24px;
   margin-bottom: 24px;
}

.muted {
   color: var(--muted);
   font-size: 12px;
}

.joy {
   position: relative;
   width: 200px;
   height: 200px;
   background: var(--panel-lite);
   border: 2px solid var(--btn-border);
   border-radius: 12px;
   background-image: linear-gradient(var(--btn-border) 1px, transparent 1px),
      linear-gradient(90deg, var(--btn-border) 1px, transparent 1px);
   background-size: 20px 20px;
   margin: 0 auto 12px;
   touch-action: none;
}

.joy-dot {
   position: absolute;
   width: 32px;
   height: 32px;
   background: var(--accent);
   border-radius: 50%;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
   cursor: grab;
}

.joy.active .joy-dot {
   cursor: grabbing;
}

.progress {
   height: 4px;
   background: #e0e3eb;
   border-radius: 10px;
   overflow: hidden;
   margin-bottom: 8px;
}

.progress .bar {
   height: 100%;
   width: 40%;
   background: var(--accent);
   animation: progress 1s linear infinite;
}

@keyframes progress {
   from {
      margin-left: -40%;
   }

   to {
      margin-left: 100%;
   }
}

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


.logos {
   display: flex;
   align-items: center;
   gap: 10px 40px;
}
.delirium-logo {
   height: 60px;
   object-fit: contain;
}
#drop {
   margin-bottom: 8px;
}
.btn_2 {
   margin-top: 0;
   margin-bottom: 0;
   padding: 8px 14px;
   width: 100%;
   border-radius: 10px;
   box-shadow: none;
}
#text {
   margin-bottom: 10px;
}
div:has(#color) {
   margin-bottom: 10px;
}
input[type="color"] {
   -webkit-appearance: none;
   -moz-appearance: none;
   appearance: none;
   width: 60px;
   height: 30px;
   border: 1px solid #b4bac5;
   border-radius: 10px;
   cursor: pointer;
   background-color: #fff;
}
input[type="color"]::-webkit-color-swatch-wrapper {
   padding: 0;
   border-radius: 10px;
   background-color: black;
}
input[type="color"]::-webkit-color-swatch {
   padding: 0;
   border-radius: 8px;
   border: none;
}
input[type="checkbox"] {
   position: relative;
   width: 30px;
   height: 30px;
   border: 1px solid #b4bac5;
   background-color: #fff;
   border-radius: 10px;
   appearance: none;
}
input[type="checkbox"]:checked {
   background-color: var(--accent);
   border: 1px solid var(--accent);
}
input[type="checkbox"]:checked::before {
   content: " ";
   position: absolute;
   top: 1px;
   left: 1px;
   right: 1px;
   bottom: 1px;
   border: 4px solid #fff;
   border-radius: 8px;
}

.panel-right {
   display: flex;
   justify-content: space-between;

   background: var(--panel);
   color: var(--text);
   border-radius: 12px;
   box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6),
      0 6px 12px rgba(0, 0, 0, 0.08);
}
.panel-right .group {
   margin-bottom: 0;
   height: fit-content;
   min-height: 110px;
}
.panel-right .panel {
   gap: 20px;
   justify-content: space-between;

   background: none;
   border-radius: none;
   box-shadow: none;
}
.generate {
   margin: 0;
}
#btnTelegram {
   width: 100%;
}
#telegramLink {
   width: 100%;
   font-family: Arial, sans-serif;
   font-size: 11px;
   text-decoration: none;
   background: linear-gradient(#fff, #ebd5c6);
}
#telegramMsg .copy-code {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   padding: 4px 8px;
   border-radius: 8px;
   border: 1px solid var(--btn-border);
   background: rgba(255, 255, 255, 0.85);
   font-family: "Roboto Mono", "Fira Mono", monospace;
   font-size: 12px;
   line-height: 1.2;
   cursor: pointer;
   color: var(--text);
   transition: background 0.2s ease, border-color 0.2s ease,
      color 0.2s ease;
   appearance: none;
}

#telegramMsg .copy-code::after {
   content: "⧉";
   font-size: 12px;
   opacity: 0.6;
}

#telegramMsg .copy-code:hover,
#telegramMsg .copy-code:focus {
   background: #fff5ec;
   border-color: var(--accent);
   color: var(--accent);
   outline: none;
}

#telegramMsg .copy-code.copied {
   background: #e5f8eb;
   border-color: #2cd355;
   color: #1b7f3b;
}

#telegramMsg .copy-code.copied::after {
   content: "✔";
   opacity: 1;
}
#seed {
   min-width: 100px;
}

footer {
   max-width: 1440px;
   width: 100%;
   text-transform: uppercase;
   font-weight: 600;
   margin-bottom: 40px;
   margin-left: 40px;
}
footer a {
   color: var(--accent);
   text-decoration: underline;
}
footer .logo_imgs {
   height: 80px;
   padding-top: 10px;
   display: flex;
   align-items: end;
   gap: 20px;
}
footer .logo_imgs img {
   max-height: 80px;
   object-fit: contain;
}

@media (max-width: 1200px) {
   .panel-right {
      flex-direction: column;
   }

   footer .logo_imgs img {
      max-width: 120px;
      width: 100%;
      object-fit: contain;
   }
   footer .logo_imgs {
      margin-bottom: 20px;
   }
}
@media (max-width: 600px) {
   .row3 {
      grid-template-columns: 1fr;
   }
   .logos {
      flex-direction: column;
   }
   .logos img {
      height: auto;
      width: 100%;
      max-width: 40vw;
   }
}
