:root{
  --bg:#1c2230;
  --panel:#d8dde7;
  --bezel:#566071;
  --screen:#bfe3ff;
  --screen2:#92cfff;
  --text:#07131f;
  --btn:#f2f2f2;
  --btn2:#d4d4d4;
  --red:#c93b3b;
  --blue:#2f7ee6;
  --yellow:#d6b12e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, Segoe UI, sans-serif;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  background:
    radial-gradient(circle at top, rgba(80,160,255,0.35), transparent 35%),
    linear-gradient(180deg, #111827, var(--bg));
  font-family: var(--sans);
  color:#111;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
  padding:16px;
}

.device{
  width:min(950px, 100%);
  background: linear-gradient(180deg, var(--panel), #b6bdca);
  border: 4px solid var(--bezel);
  border-radius: 18px;
  box-shadow:
    0 22px 55px rgba(0,0,0,0.45),
    inset 0 2px 0 rgba(255,255,255,0.7);
  padding:16px;
  overflow:hidden;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 10px 14px;
  flex-wrap:wrap;
}

.brand{
  font-weight:900;
  letter-spacing:0.8px;
  text-transform:uppercase;
  font-size:14px;
  color:#1b2430;
  display:flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
}

.brand .dot{
  width:12px;
  height:12px;
  border-radius:50%;
  background: radial-gradient(circle at 30% 30%, #fff, #4da6ff 45%, #1b4e91);
  border:1px solid rgba(0,0,0,0.35);
  box-shadow:0 0 12px rgba(77,166,255,0.8);
}

.model{
  font-family: var(--mono);
  font-size:12px;
  color:#333;
  opacity:0.9;
}

.screen-wrap{
  background: #303846;
  border-radius: 14px;
  padding:12px;
  border: 3px solid #171b22;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.08);
}

.screen{
  background: linear-gradient(180deg, var(--screen), var(--screen2));
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,0.45);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.25),
    inset 0 12px 30px rgba(255,255,255,0.22);
  padding:12px;
  color: var(--text);
  font-family: var(--mono);
  max-width:100%;
  overflow:hidden;
}

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

.label{
  font-size:12px;
  opacity:0.88;
  flex: 1 1 auto;
  min-width: 240px;
  line-height:1.45;
}

.split{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  width:100%;
  margin:0 auto;
  max-width:100%;
}

.split > div{
  min-width:0;
  max-width:100%;
}

@media (min-width: 820px){
  .split{
    grid-template-columns: 1fr 1fr;
  }

  textarea{
    min-height: 220px;
  }
}

textarea{
  width:100%;
  max-width:100%;
  min-width:0;
  display:block;
  min-height:160px;
  resize:vertical;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.5);
  background: rgba(255,255,255,0.62);
  color:#07131f;
  font-family: var(--mono);
  font-size: 15px;
  line-height:1.45;
  padding:12px;
  outline:none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
  overflow-wrap:anywhere;
  word-break:break-word;
}

textarea:focus{
  border-color:#1e63bd;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    0 0 0 3px rgba(47,126,230,0.18);
}

#outText{
  background: rgba(255,255,255,0.72);
  font-weight:700;
}

.controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  padding:12px 2px 4px;
  align-items:center;
  justify-content:flex-start;
}

.btns{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

button{
  border: 2px solid rgba(0,0,0,0.45);
  background: linear-gradient(180deg, var(--btn), var(--btn2));
  border-radius: 10px;
  padding:10px 14px;
  font-weight:800;
  font-family: var(--sans);
  cursor:pointer;
  box-shadow:
    0 4px 0 rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.7);
  transition: transform 0.03s ease-in-out;
}

button:active{
  transform: translateY(2px);
  box-shadow:
    0 2px 0 rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.7);
}

.btn-blue{
  background: linear-gradient(180deg, #7db3ff, var(--blue));
  color:#071026;
}

.btn-yellow{
  background: linear-gradient(180deg, #ffe08a, var(--yellow));
  color:#241b05;
}

.btn-red{
  background: linear-gradient(180deg, #ff7777, var(--red));
  color:#180000;
}

.foot{
  margin-top:10px;
  font-size:12px;
  opacity:0.88;
  color:#222;
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.foot code{
  font-family: var(--mono);
  background: rgba(255,255,255,0.35);
  padding:2px 5px;
  border-radius:5px;
}
