html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  display: flex;
  justify-content: center;
  align-items: center;
}

* {
  box-sizing: border-box;
}

.browser-window {
  width: 90vw;
  height: 85vh;
  max-width: 1100px;
  max-height: 750px;
  border: 2px solid #333;
  border-radius: 10px;
  background: #111;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.search-container {
  display: flex;
  padding: 15px 20px;
  background: #222;
  border-bottom: 2px solid #333;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.search-container input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 6px;
  border: 2px solid #333;
  background: #111;
  color: #e0e0e0;
}

.search-container button {
  padding: 10px 15px;
  border: 2px solid #333;
  border-radius: 6px;
  background: #111;
  color: #caa6ff;
  font-weight: bold;
  cursor: pointer;
}

.button-field {
  position: relative;
  padding: 20px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.dfi-box {
  border: 2px solid #333;
  border-radius: 10px;
  padding: 25px;
  background: #111;
  line-height: 1.6;
}

.dfi-box h1 {
  margin: 0 0 20px 0;
  font-size: 2rem;
  color: #f2f2f2;
}

.dfi-box p {
  margin: 0 0 20px 0;
  font-size: 1rem;
  color: #e0e0e0;
}

.dfi-box .section-title {
  margin-bottom: 12px;
  font-weight: 700;
  color: #f2f2f2;
}

.dfi-box ul {
  margin: 0 0 28px 0;
  padding-left: 28px;
}

.dfi-box li {
  margin: 6px 0;
  font-size: 1rem;
  color: #e0e0e0;
}

.dfi-box .footer-text {
  margin-top: 10px;
  font-size: 1rem;
  color: #f2f2f2;
}

.post-preview {
  cursor: pointer;
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  width: fit-content;
  min-width: 0;
  max-width: none;
}

.post-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #f2f2f2;
  line-height: 1.2;
}

.post-row {
  position: relative;
  width: 100%;
  height: 100%;
}

.floating-post {
  position: absolute;
  will-change: transform;
  max-width: 360px;
  transition: transform 0.6s ease, opacity 0.3s ease;
}

.floating-post.expanded {
  z-index: 50;
}

.floating-post.expanded .dfi-box {
  transform: scale(1.05, 1.2);
  transition: transform 0.35s ease;
}

.post-dim {
  opacity: 0.2;
}

.form-layout {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.form-top-left {
  position: absolute;
  left: 20px;
  top: 20px;
  z-index: 3;
}

.form-bottom-left {
  position: absolute;
  left: 20px;
  bottom: 0;
  z-index: 2;
  width: calc(100% - 40px);
}

.dots-branch-wrap {
  position: relative;
}

.dot-frame {
  position: relative;
  z-index: 2;
  width: 360px;
  height: 80px;
  border: 0;
  outline: none;
  background: transparent;
  display: block;
  overflow: hidden;
}

/* wider frame so left-shifted branch/leaves do not clip */
.branch-frame {
  position: absolute;
  left: -90px;
  top: 30px;
  z-index: 1;
  width: 560px;
  height: 260px;
  border: 0;
  outline: none;
  background: transparent;
  display: block;
  overflow: hidden;
}

.grass-frame {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 110px;
  border: 0;
  outline: none;
  background: transparent;
  display: block;
  overflow: visible;
}

#menuMount {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 20px;
  border-top: 2px solid #333;
  flex-shrink: 0;
  min-height: 170px;
  box-sizing: border-box;
}

.stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-shrink: 0;
}

.stack-item {
  position: relative;
  display: inline-block;
  margin: 6px 0;
  cursor: pointer;
}

.stack-item button {
  position: relative;
  z-index: 10;
  background: #111;
  border: none;
  color: #777;
  font-size: 14px;
  padding: 9px 16px;
  cursor: pointer;
}

.stack-item button:hover,
.stack-item.active button {
  color: #fff;
}

.layer {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  z-index: 1;
}

.l1 { --x:-1px; --y:-1px; transform: translate(var(--x), var(--y)); background:#444; }
.l2 { --x:-2px; --y:-2px; transform: translate(var(--x), var(--y)); background:#3a3a3a; }
.l3 { --x:-3px; --y:-3px; transform: translate(var(--x), var(--y)); background:#333; }
.l4 { --x:-4px; --y:-4px; transform: translate(var(--x), var(--y)); background:#2a2a2a; }
.l5 { --x:-5px; --y:-5px; transform: translate(var(--x), var(--y)); background:#222; }
.l6 { --x:-6px; --y:-6px; transform: translate(var(--x), var(--y)); background:#1a1a1a; }
.l7 { --x:-7px; --y:-7px; transform: translate(var(--x), var(--y)); background:#111; }

.stack-item:active {
  transform: translate(1px, 1px);
}

.side-info {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  min-height: 120px;
  padding-top: 8px;
  padding-left: 12px;
  padding-right: 12px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

.side-info-inner {
  width: 100%;
  max-width: 540px;
}

.side-info p {
  margin: 0 0 14px 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #d0d0d0;
}

.side-info strong {
  font-size: 1rem;
  color: #f2f2f2;
}

.dfi-keyboard {
  width: 100%;
  max-width: 600px;
  transform: scale(0.72);
  transform-origin: top left;
}

.dfi-keyboard .row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.dfi-keyboard .key {
  min-width: 44px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1;
  border-radius: 8px;
  background: linear-gradient(
    180deg,
    #5aa9ff 0%,
    #2f6bff 50%,
    #1b3cff 100%
  );
  color: #a8b0b8;
  opacity: 0.95;
  animation: keyFloat 8s ease-in-out infinite;
  transition: transform 0.15s ease, box-shadow 0.12s ease;
}

.dfi-keyboard .key.number {
  background: linear-gradient(
    180deg,
    #4fd1c5 0%,
    #14b8a6 50%,
    #0f766e 100%
  );
  color: #363c40;
}

@keyframes keyFloat {
  0% { transform: translate(0px, 0px); }
  50% { transform: translate(1px, -4px); }
  100% { transform: translate(0px, 0px); }
}

.dfi-keyboard .key:nth-child(odd) { animation-duration: 9s; }
.dfi-keyboard .key:nth-child(3n) { animation-duration: 11s; }
.dfi-keyboard .key:nth-child(5n) { animation-duration: 10s; }

.dfi-keyboard .key:active {
  transform: scale(0.94);
}

.dfi-keyboard .row.qwerty { padding-left: 0; }
.dfi-keyboard .row.asdf { padding-left: 26px; }
.dfi-keyboard .row.zxcv { padding-left: 52px; }

@media (max-width: 700px) {
  .browser-window {
    width: 94vw;
    height: 88vh;
  }

  #menuMount {
    gap: 18px;
    padding: 16px;
  }

  .stack-item button {
    font-size: 13px;
    padding: 8px 14px;
  }

  .floating-post {
    max-width: 280px;
  }

  .form-top-left {
    left: 14px;
    top: 14px;
  }

  .form-bottom-left {
    left: 14px;
    bottom: 0;
    width: calc(100% - 28px);
  }

  .dot-frame {
    width: 62vw;
    max-width: 320px;
    min-width: 220px;
    height: 80px;
  }

  .branch-frame {
    left: -90px;
    top: 30px;
    width: 95vw;
    max-width: 560px;
    min-width: 420px;
    height: 260px;
    overflow: hidden;
  }

  .grass-frame {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 110px;
  }

  .dfi-keyboard {
    transform: scale(0.46);
    transform-origin: top left;
    max-width: 600px;
  }
}
