
/* TinyPixels — retro-inspired light theme */

:root{
  --bg: #dff0ff;
  --tile: #d2b48c;
  --tile2:#caa27a;
  --ink:#1b2b3a;
  --muted:#516a7b;
  --card:#ffffff;
  --card2:#f6fbff;
  --line:#b4c9d9;
  --accent:#ff5b9a;
  --accent2:#3ddc97;
  --warn:#ffcc00;
  --danger:#ff4b4b;
  --shadow: rgba(0,0,0,.12);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--ink);
  background: var(--bg);
  font-family: "Trebuchet MS", Tahoma, Arial, sans-serif;
}

/* Pixel-ish floor tiles */
.wrap{
  max-width: 1080px;
  margin: 18px auto 40px;
  padding: 0 16px 24px;
}
.wrap::before{
  content:"";
  display:block;
  height:16px;
  border-radius:14px 14px 0 0;
  background: repeating-linear-gradient(
    45deg,
    var(--tile),
    var(--tile) 10px,
    var(--tile2) 10px,
    var(--tile2) 20px
  );
  border: 2px solid rgba(255,255,255,.5);
  box-shadow: 0 10px 30px var(--shadow);
  margin-bottom: 14px;
}

/* sky + clouds */
.sky{
  position:fixed;
  inset:0;
  pointer-events:none;
  background: linear-gradient(#bfe6ff 0%, #dff0ff 55%, #f7fbff 100%);
  z-index:-2;
}
.cloud{
  position:absolute;
  top:60px;
  width:240px;
  height:80px;
  background: rgba(255,255,255,.8);
  border-radius: 60px;
  filter: blur(.2px);
  box-shadow: 0 12px 0 rgba(255,255,255,.7), 0 22px 12px rgba(0,0,0,.05);
  opacity:.95;
  animation: floaty 28s linear infinite;
}
.cloud::before,.cloud::after{
  content:"";
  position:absolute;
  background: rgba(255,255,255,.85);
  border-radius: 50%;
}
.cloud::before{ width:90px;height:90px; left:25px; top:-38px;}
.cloud::after{ width:110px;height:110px; left:105px; top:-58px;}
.c1{ left:-260px; top:70px; animation-duration: 55s;}
.c2{ left:-260px; top:150px; width:300px; animation-duration: 72s; opacity:.85;}
.c3{ left:-260px; top:250px; width:220px; animation-duration: 62s; opacity:.75;}
@keyframes floaty{
  from{ transform: translateX(0); }
  to{ transform: translateX(calc(100vw + 520px)); }
}

/* topbar */
.topbar{
  position:sticky;
  top:0;
  z-index:5;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  padding: 12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap: wrap;
  gap:14px;
}
.topbar__left{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap: wrap;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand__logo{ width:46px; height:46px; image-rendering: pixelated; }
.brand__name{ font-weight:800; letter-spacing:.2px; }
.brand__tag{ color:var(--muted); font-size:12px; margin-top:2px; }
.topbar__right{ display:flex; gap:10px; align-items:center; }
.nav{
  display:flex;
  align-items:flex-start;
  gap:8px;
  flex-wrap: wrap;
}
.nav__link{
  text-decoration:none;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 8px 20px var(--shadow);
}
.nav__link:hover{ transform: translateY(-1px); }
.nav__link--active{
  background: linear-gradient(180deg, #ff7bb5 0%, #ff5b9a 100%);
  color: #fff;
  border-color: rgba(0,0,0,.12);
}
.nav__group{
  position: relative;
  display:flex;
  flex-direction:column;
  padding-bottom: 10px;
}
.nav__link--group{
  cursor: default;
}
.nav__submenu{
  display:none;
  position:absolute;
  top:100%;
  left:0;
  flex-direction:column;
  gap:6px;
  padding:8px;
  background: rgba(255,255,255,.96);
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 14px 30px var(--shadow);
  min-width: 180px;
}
.nav__group:hover .nav__submenu,
.nav__group:focus-within .nav__submenu,
.nav__group--active .nav__submenu{
  display:flex;
}
.nav__sublink{
  text-decoration:none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-weight: 700;
}
.nav__sublink:hover{ transform: translateY(-1px); }
.nav__sublink--active{
  background: linear-gradient(180deg, #ff7bb5 0%, #ff5b9a 100%);
  color: #fff;
  border-color: rgba(0,0,0,.12);
}

.chip{
  display:flex; align-items:center; gap:8px;
  padding: 8px 10px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.9);
  border-radius: 999px;
  box-shadow: 0 6px 14px var(--shadow);
  font-size: 13px;
}
.chip__dot{
  width:10px;height:10px;border-radius:50%;
  background: var(--accent2);
  box-shadow: 0 0 0 3px rgba(61,220,151,.15);
}
.chip__role{
  margin-left:6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,91,154,.12);
  color: #b61f62;
  font-weight:700;
  font-size: 11px;
}

/* cards */
.card{
  border-radius: 16px;
  background: linear-gradient(180deg, var(--card) 0%, var(--card2) 100%);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 14px 35px var(--shadow);
  padding: 16px;
  margin: 12px 0;
}
.card__title{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin: 0 0 10px;
}
.card__title h2{ margin:0; font-size: 18px; }
.badge{
  font-size: 12px;
  font-weight:800;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 204, 0, .18);
  color: #7a5a00;
  border: 1px dashed rgba(122, 90, 0, .35);
}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}

label{
  display:block;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
}
input[type="text"], input[type="email"], input[type="password"], textarea, select{
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.95);
  outline:none;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.03);
}
textarea{ min-height: 140px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 13px; }

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

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius: 12px;
  padding: 10px 14px;
  text-decoration:none;
  border: 1px solid rgba(0,0,0,.10);
  background: white;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 10px 22px var(--shadow);
  cursor:pointer;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn--primary{
  background: linear-gradient(180deg, #ff7bb5 0%, #ff5b9a 100%);
  border-color: rgba(0,0,0,.12);
  color: #fff;
}
.btn--success{
  background: linear-gradient(180deg, #57e6b0 0%, #3ddc97 100%);
  border-color: rgba(0,0,0,.12);
  color: #083824;
}
.btn--danger{
  background: linear-gradient(180deg, #ff7373 0%, #ff4b4b 100%);
  border-color: rgba(0,0,0,.12);
  color: #fff;
}
.btn--ghost{
  background: rgba(255,255,255,.8);
}

.hr{
  height:1px;
  background: rgba(0,0,0,.08);
  margin: 14px 0;
}

.flash{
  padding: 12px 14px;
  border-radius: 12px;
  margin: 12px 0;
  font-weight: 800;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 10px 22px var(--shadow);
}
.flash--success{ background: rgba(61,220,151,.18); }
.flash--error{ background: rgba(255,75,75,.16); }
.flash--info{ background: rgba(255,204,0,.16); }

.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 14px;
  border:1px solid rgba(0,0,0,.08);
}
.table th,.table td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  vertical-align: top;
}
.table th{
  text-align:left;
  font-size:12px;
  letter-spacing:.4px;
  text-transform: uppercase;
  background: rgba(0,0,0,.04);
}
.table tr:last-child td{ border-bottom:none; }
.kbd{
  display:inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.85);
  font-weight:800;
  font-size: 12px;
}
.small{ color:var(--muted); font-size: 12px; line-height: 1.4; }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

.preview{
  width:100%;
  height: 260px;
  border-radius: 14px;
  border:1px solid rgba(0,0,0,.10);
  background: #fff;
}

.footer{
  margin-top: 40px;
  padding: 18px 16px 26px;
  border-top: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.7);
}
.footer__inner{
  max-width: 1080px;
  margin: 0 auto;
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap: wrap;
}
.footer__small{ color: var(--muted); font-size: 12px; max-width: 680px; }

/* retro speech bubble */
.bubble{
  position: relative;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 12px 28px var(--shadow);
}
.bubble::after{
  content:"";
  position:absolute;
  left: 26px;
  bottom:-10px;
  width: 18px;
  height: 18px;
  background: rgba(255,255,255,.95);
  border-left: 1px solid rgba(0,0,0,.10);
  border-bottom: 1px solid rgba(0,0,0,.10);
  transform: rotate(45deg);
}

.editor-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin: 0 0 8px;
}
.editor-toolbar__group{
  display:flex;
  align-items:center;
  gap:6px;
}
.editor-toolbar .btn{ padding: 8px 10px; }
.editor-select{
  padding: 8px 10px;
  border-radius: 10px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.95);
  font-weight: 800;
}
.editor-label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 6px 8px;
  border-radius: 10px;
  border:1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.8);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.editor-toolbar__colors input[type="color"]{
  width: 32px;
  height: 28px;
  padding:0;
  background: transparent;
  border: none;
  cursor: pointer;
}
.editor{
  min-height: 240px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.95);
  padding: 12px;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.03);
  overflow:auto;
}
.editor:focus{ outline: 2px solid rgba(255,91,154,.25); }
.editor-frame{
  width:100%;
  min-height: 260px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.95);
  box-shadow: inset 0 2px 0 rgba(0,0,0,.03);
}
.editor-frame:focus{ outline: 2px solid rgba(255,91,154,.25); }
.editor-code{
  width:100%;
  min-height: 240px;
  border-radius: 12px;
  border:1px dashed var(--line);
  background: rgba(255,255,255,.95);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.03);
}
.link{ color: var(--accent); font-weight:800; text-decoration: none; }
.link:hover{ text-decoration: underline; }
.user-pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.editor-hints{ margin: 8px 0; }
.chip--btn{
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
}
.chip--btn:hover{ transform: translateY(-1px); }
.btn.is-active{ box-shadow: 0 0 0 2px rgba(255,91,154,.28); }
.modal{
  position: fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index: 20;
}
.modal.is-open{ display:flex; }
.modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
}
.modal__dialog{
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  width: min(460px, 92vw);
  box-shadow: 0 22px 50px rgba(0,0,0,.24);
  border: 1px solid rgba(0,0,0,.08);
  z-index: 1;
}
.modal__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}
.modal__title{ font-weight:900; font-size: 16px; }
.modal__close{ padding: 8px 10px; }
