:root {
  --bg: #0f1221;
  --body-bg: #0b0f1d;
  --panel: #14182b;
  --muted: #8b93a7;
  --txt: #e9ecf1;
  --brand: #7dd3fc;
  --brand-2: #60a5fa;
  --ok: #22c55e;
  --warn: #eab308;
  --err: #ef4444;
  --radius: 18px;
  --gap: 14px;
}

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

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(180deg, var(--body-bg), var(--bg) 35%);
  color: var(--txt);
  display: flex;
  flex-direction: column;
}

header {
  padding: 16px;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.15) 0%, rgba(125, 211, 252, 0.1));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.container {
  max-width: 1200px;
  margin-inline: auto;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.logo img {
  height: 35px;
  width: 35px;
  border-radius: 8px;
}

.title {
  font-size: clamp(14px, 2vw, 22px);
}

main {
  max-width: 1516px;
  margin-inline: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  flex: 1;
  min-height: 0;
}

@media (max-width: 1100px) {
  main {
    grid-template-columns: 1fr;
  }
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.25);
}

.panel {
  padding: 16px;
}

h2, h3 {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: none;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: #08111f;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(96, 165, 250, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(96, 165, 250, 0.45);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(96, 165, 250, 0.3);
}

.btn.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--txt);
  box-shadow: none;
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn.warn {
  background: linear-gradient(180deg, #f59e0b, #eab308);
  box-shadow: 0 10px 24px rgba(234, 179, 8, 0.35);
}

.btn.ok {
  background: linear-gradient(180deg, #34d399, #22c55e);
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.35);
}

.btn.err {
  background: linear-gradient(180deg, #fb7185, #ef4444);
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.35);
}

.select, select, .text {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--txt);
  padding: 10px 12px;
  border-radius: 12px;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.tab.active {
  background: linear-gradient(180deg, rgba(125, 211, 252, 0.18), rgba(96, 165, 250, 0.18));
  color: var(--brand) !important;
  border-color: rgba(125, 211, 252, 0.3);
}

.editor-wrap {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  min-height: 280px;
  background-color: #0b1020;
}

.editor {
  width: 100%;
  height: 380px;
}

#preview-panel {
  justify-content: center;
}

iframe.preview {
  width: 100%;
  height: 380px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: white;
}

.outt {
  background: #0a0e1a;
  border-top: 5px solid rgba(49, 45, 45, 0.79);
  padding: 0 10px 10px;
  height: 0;
  opacity: 0;
  z-index: 1000;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: fixed;
  bottom: 0;
  left: 0;
  transition: height 0.3s ease, opacity 0.3s ease;
}

.outt.open {
  height: 180px;
  opacity: 1;
  padding-top: 10px;
}

.outt-close {
  position: absolute;
  right: 12px;
  top: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: whitesmoke;
  font-size: 14px;
  line-height: 1;
  transition: all 0.2s;
}

.outt-close:hover {
  color: var(--err);
  background: rgba(239, 68, 68, 0.1);
}

.outt-close:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.28);
  outline-offset: 2px;
}

.outt-title {
  position: absolute;
  left: 12px;
  top: 8px;
  background: rgba(78, 78, 78, 0.6);
  color: rgb(224, 224, 224);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.output-btn {
  gap: 10px;
  display: flex;
  position: absolute;
  right: 12px;
  top: 38px;
  z-index: 10;
}

.out {
  border-radius: 12px;
  padding: 10px;
  flex-grow: 1;
  overflow-y:auto;
  margin-top: 40px;
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.out div {
  margin-bottom: 4px;
}

.footer {
  display: flex;
  flex-direction: column;
  padding: 12px;
  margin-top: 20px;
  z-index: 0;
  flex-shrink: 0;
}

.copyright {
  opacity: 0.7;
  font-size: 13px;
  text-align: center;
}

.console-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  height: 45px;
  width: 45px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, #2b2d4f, #1a1c3a);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.3s;
  color: var(--brand);
}

.console-btn:hover {
  background: linear-gradient(135deg, #3a3d5f, #24264a);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.console-btn:active {
  transform: scale(0.95);
}

.console-btn i {
  transition: transform 0.3s;
}



@media (max-width: 768px) {
  .title {
    font-size: 14px;
  }
  
  .btn {
    padding: 7px 10px;
    font-size: 10px;
  }
  
  .btn span {
    display: none;
  }
  
  .output-btn {
    flex-direction: column;
    right: 8px;
    gap: 6px;
  }
  
  .outt.open {
    height: 200px;
  }
  
  .console-btn {
    right: 15px;
    bottom: 15px;
    height: 40px;
    width: 40px;
  }
}

@media (max-width: 480px) {
  .outt-title { 
    font-size: 11px; 
    padding: 3px 7px; 
  }
  
  .outt-close { 
    right: 8px; 
    top: 6px; 
    width: 24px; 
    height: 24px; 
  }
  
  main {
    padding: 8px;
  }
}