:root {
  color-scheme: dark;
  accent-color: var(--accent-dot);
  --purple-deep: #1a0b28;
  --purple-mid: #2b1040;
  --purple-panel: rgba(43, 16, 64, 0.72);
  --lavender: #c4a8ff;
  --lavender-soft: #9d7fd6;
  --lavender-muted: rgba(196, 168, 255, 0.55);
  --accent-dot: #b388ff;
  --glass-bg: rgba(35, 12, 52, 0.55);
  --glass-border: rgba(157, 101, 255, 0.28);
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--purple-deep);
  color: var(--lavender);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.45;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Forest cabin: vector asset + mor tint katmanları (arkada görsel) */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(120% 80% at 50% 100%, rgba(20, 8, 35, 0.88) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 30%, rgba(80, 40, 120, 0.4) 0%, transparent 50%),
    linear-gradient(165deg, rgba(31, 10, 50, 0.55) 0%, rgba(18, 6, 28, 0.75) 45%, rgba(13, 4, 20, 0.85) 100%),
    url("./assets/wallpaper.svg");
  background-size: auto, auto, auto, cover;
  background-position: center, center, center, center;
  background-repeat: no-repeat;
}

.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono {
  font-family: var(--font-mono);
}

/* ——— Bars ——— */
.bar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 1rem;
  background: var(--purple-panel);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--lavender-soft);
  text-shadow: 0 0 12px rgba(157, 101, 255, 0.25);
}

.bar--bottom {
  border-bottom: none;
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
  font-size: 0.82rem;
  color: var(--lavender-muted);
  flex-wrap: nowrap;
  width: 100%;
  gap: 0.35rem;
  justify-content: flex-start;
}

.bar-bottom__fill {
  flex: 1 1 0;
  min-width: 0;
}

.bar-bottom__fill--start {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-width: 1.25rem;
}

.bar-bottom__fill--end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.bar-bottom__stats {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-align: center;
}

.bar-bottom__square {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  border-radius: 3px;
  background: var(--accent-dot);
  opacity: 0.9;
  box-shadow: 0 0 10px rgba(179, 136, 255, 0.55);
}

.bar__cluster {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.bar__cluster--end {
  justify-content: flex-end;
}

.bar__center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90vw, 28rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.06em;
  font-size: 0.88rem;
  color: var(--lavender);
}

.ws-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ws-dots .ws-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 1.5px solid var(--lavender-soft);
  opacity: 0.65;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: content-box;
}

.ws-dots .ws-dot:hover {
  opacity: 0.95;
  border-color: var(--lavender);
}

.ws-dots .ws-dot:focus-visible {
  outline: 2px solid var(--accent-dot);
  outline-offset: 2px;
}

.ws-dots .ws-dot--on {
  background: var(--accent-dot);
  border-color: var(--accent-dot);
  box-shadow: 0 0 8px rgba(179, 136, 255, 0.75);
  opacity: 1;
}

/* Eski statik span noktalar (ilk boyama) */
.ws-dots span:not(.ws-dot) {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--lavender-soft);
  opacity: 0.65;
}

.ws-dots span.on {
  background: var(--accent-dot);
  border-color: var(--accent-dot);
  box-shadow: 0 0 8px rgba(179, 136, 255, 0.75);
  opacity: 1;
}

.ws-title {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--lavender-muted);
}

.bar-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 30% 25%, #e8d4ff 0%, #6b3d9e 45%, #2a1040 100%);
  border: 1px solid rgba(196, 168, 255, 0.35);
  box-shadow: 0 0 12px rgba(179, 136, 255, 0.35);
}

.bar-avatar--end {
  background: radial-gradient(circle at 70% 30%, #ffd6f0 0%, #8b4da6 50%, #301040 100%);
}

.glyph {
  color: var(--lavender-soft);
  font-size: 0.75rem;
  opacity: 0.9;
}

.glyph--soft {
  opacity: 0.45;
}

.vol {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-right: 0.25rem;
}

/* ——— Stage ——— */
.stage {
  position: relative;
  z-index: 3;
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  gap: 1rem;
  width: 100%;
  max-width: none;
  padding: 1rem 1.25rem 1.25rem;
  min-height: 0;
}

.shortcuts {
  position: relative;
  z-index: 1;
  border-radius: 12px;
  padding: 0.85rem 1.1rem 1rem;
  max-width: 22rem;
  flex-shrink: 0;
  align-self: flex-start;
  margin-bottom: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.shortcuts.is-hidden {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.shortcuts__hint {
  margin: 0 0 0.65rem;
  font-size: clamp(0.78rem, 1.1vw + 0.55rem, 0.95rem);
  color: var(--lavender-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.shortcuts__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: clamp(0.82rem, 1.15vw + 0.55rem, 1.05rem);
}

.shortcuts__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid rgba(157, 101, 255, 0.12);
  color: var(--lavender-soft);
}

.shortcuts__list li .shortcut-btn {
  margin-right: auto;
}

.shortcut-btn {
  font: inherit;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--lavender-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.shortcut-btn:hover {
  color: var(--lavender);
}

.shortcuts__list li:last-child {
  border-bottom: none;
}

kbd {
  font-family: inherit;
  font-size: 0.72em;
  padding: 0.12em 0.35em;
  border-radius: 4px;
  border: 1px solid rgba(196, 168, 255, 0.35);
  background: rgba(26, 11, 40, 0.6);
  color: var(--lavender);
}

code {
  font-family: inherit;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(26, 11, 40, 0.75);
  border: 1px solid rgba(157, 101, 255, 0.25);
}

.sep {
  margin: 0 0.4rem;
  opacity: 0.35;
}

/* ——— GNUCHANOS pencere masaüstü ——— */
.gnuchanos-desktop {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: min(52vh, 420px);
  border-radius: 10px;
  border: 1px dashed rgba(157, 101, 255, 0.28);
  background: rgba(10, 4, 18, 0.28);
  overflow: visible;
  z-index: 2;
  container-type: size;
  container-name: gchu-desk;
}

.gchu-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: 10px;
  border: 1px solid rgba(157, 101, 255, 0.45);
  background: rgba(26, 11, 40, 0.88);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2) inset,
    0 16px 44px rgba(0, 0, 0, 0.48);
  min-width: 160px;
  min-height: 0;
  z-index: 1;
  /* Okunabilir taban; @container ile masaüstü genişliğine göre artar (cqw = %1 genişlik) */
  font-size: clamp(16px, 0.55vw + 14px, 24px);
  line-height: 1.35;
  height: auto;
  max-height: var(--gchu-win-max, min(88vh, 720px));
  overflow: hidden;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: rgba(179, 136, 255, 0.55) rgba(10, 4, 18, 0.55);
  container-type: inline-size;
  container-name: gchu-win;
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

@keyframes gchu-win-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gchu-window--spawn {
  animation: gchu-win-enter 0.24s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .gchu-window--spawn {
    animation: none;
  }

  .gchu-window {
    transition: none;
  }
}

.gchu-window ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.gchu-window ::-webkit-scrollbar-track {
  background: rgba(10, 4, 18, 0.55);
  border-radius: 8px;
}

.gchu-window ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(157, 101, 255, 0.55), rgba(120, 70, 180, 0.45));
  border-radius: 8px;
  border: 2px solid rgba(10, 4, 18, 0.4);
}

.gchu-window ::-webkit-scrollbar-thumb:hover {
  background: rgba(179, 136, 255, 0.75);
}

.gchu-window--focus {
  border-color: rgba(179, 136, 255, 0.88);
  box-shadow:
    0 0 0 1px rgba(179, 136, 255, 0.22) inset,
    0 0 0 1px rgba(179, 136, 255, 0.35),
    0 22px 56px rgba(0, 0, 0, 0.55);
}

.gchu-window--max {
  border-radius: 8px;
}

.gchu-window--off-ws {
  display: none !important;
}

.gchu-window__titlebar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.32rem 0.35rem 0.32rem 0.45rem;
  color: var(--lavender-soft);
  background: linear-gradient(180deg, rgba(52, 22, 78, 0.65) 0%, rgba(43, 16, 64, 0.5) 100%);
  border-bottom: 1px solid var(--glass-border);
  cursor: grab;
}

.gchu-window__titlebar button,
.gchu-window__titlebar .gchu-window__max,
.gchu-window__titlebar .gchu-window__close {
  cursor: pointer;
}

.gchu-window--focus .gchu-window__titlebar {
  border-bottom-color: rgba(179, 136, 255, 0.42);
}

.gchu-window__drag {
  flex: 1;
  min-width: 0;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.12rem 0;
}

.gchu-window__drag:active {
  cursor: grabbing;
}

.gchu-window__max {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 0.95em;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--lavender-muted);
  padding: 0.15rem 0.38rem;
  border-radius: 6px;
  min-width: 1.75rem;
}

.gchu-window__max:hover {
  color: var(--lavender);
  background: rgba(179, 136, 255, 0.1);
  border-color: rgba(179, 136, 255, 0.2);
}

.gchu-window__max:focus-visible {
  outline: 2px solid rgba(179, 136, 255, 0.55);
  outline-offset: 1px;
}

.gchu-window__close {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 1.2em;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--lavender-muted);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

.gchu-window__close:hover {
  color: #ffb8c6;
  background: rgba(220, 80, 100, 0.18);
  border-color: rgba(255, 120, 140, 0.25);
}

.gchu-window__close:focus-visible {
  outline: 2px solid rgba(255, 150, 170, 0.55);
  outline-offset: 1px;
}

.gchu-window__body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto;
  flex-grow: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.gchu-window--fixed-h .gchu-window__body {
  flex: 1 1 auto;
  flex-grow: 1;
  min-height: 0;
}

/* Uygulama DOM / ileride tam sayfa iframe buraya */
.gchu-window__frame {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto;
  flex-grow: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.35rem 0.35rem 0.35rem 0.45rem;
  color: var(--lavender-muted);
}

.gchu-window__frame > * {
  min-width: 0;
  min-height: 0;
}

.gchu-window--fixed-h .gchu-window__frame {
  flex: 1 1 auto;
  flex-grow: 1;
  min-height: 0;
}

/* Boyutlandırılmış pencerede kalan dikey alan */
.gchu-window--fixed-h .gchu-window__frame::after {
  content: "";
  flex: 1 1 auto;
  min-height: 0;
}

.gchu-window__frame > .gchu-window__iframe {
  flex: 1 1 auto;
  min-height: min(220px, 45vh);
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: rgba(10, 4, 18, 0.45);
}

.gchu-window__resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 42%,
    rgba(179, 136, 255, 0.12) 42%,
    rgba(179, 136, 255, 0.12) 46%,
    rgba(179, 136, 255, 0.45) 46%,
    rgba(179, 136, 255, 0.45) 50%,
    rgba(179, 136, 255, 0.75) 50%,
    rgba(179, 136, 255, 0.75) 100%
  );
  border-radius: 0 0 9px 0;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.gchu-window--max .gchu-window__resize {
  display: none;
}

/* Pencere içi: sıkı dikey boşluk; yazı boyutu .gchu-window + @container ile ölçeklenir */
.gchu-window .shell-muted {
  margin: 0;
  font-size: inherit;
  max-width: 100%;
}

.gchu-window .gchu-welcome-body {
  margin: 0;
  line-height: 1.5;
  text-align: left;
  max-width: 100%;
  display: grid;
  gap: 1rem;
}

.gchu-window .gchu-welcome-body h1 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--lavender);
}

.gchu-window .gchu-welcome-body .gchu-welcome-links {
  display: grid;
  gap: 0.75rem;
}

.gchu-window .gchu-welcome-body .gchu-welcome-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.95rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(10, 4, 18, 0.72);
  border: 1px solid rgba(157, 101, 255, 0.18);
  color: var(--lavender);
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.gchu-window .gchu-welcome-body .gchu-welcome-card:hover {
  transform: translateY(-1px);
  background: rgba(157, 101, 255, 0.12);
  border-color: rgba(196, 168, 255, 0.32);
}

.gchu-window .gchu-welcome-body .gchu-welcome-card strong {
  display: block;
  font-size: 0.95rem;
}

.gchu-window .gchu-welcome-body .gchu-welcome-card span {
  font-size: 0.82rem;
  color: var(--lavender-soft);
}

.gchu-window .gchu-welcome-body .gchu-welcome-actions {
  font-size: 0.82rem;
  color: var(--lavender-muted);
}

.gchu-window .gchu-welcome-body p {
  margin: 0 0 0.55em;
}

.gchu-window .gchu-welcome-body p:last-child {
  margin-bottom: 0;
}

.gchu-window .gchu-welcome-body code {
  font-size: 0.92em;
  padding: 0.08em 0.28em;
  border-radius: 4px;
  background: rgba(20, 8, 35, 0.55);
  border: 1px solid rgba(160, 32, 240, 0.25);
}

.gchu-window .gchu-welcome-body kbd {
  font-size: 0.88em;
  padding: 0.06em 0.28em;
  border-radius: 3px;
  border: 1px solid rgba(179, 136, 255, 0.4);
  background: rgba(10, 4, 18, 0.5);
}

.gchu-window .shell-field {
  margin: 0;
  font-size: inherit;
  width: 100%;
}

.gchu-window .shell-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  margin-top: 0;
  box-sizing: border-box;
}

.gchu-window .shell-row > .shell-btn {
  flex: 1 1 auto;
  min-width: 0;
}

.gchu-window .shell-row > label.shell-field {
  flex: 1 1 auto;
  min-width: 0;
}

.gchu-window .shell-row--wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 0.35rem;
  width: 100%;
  margin-top: 0;
}

.gchu-window .shell-btn {
  padding: 0.28rem 0.5rem;
}

.gchu-window .shell-input,
.gchu-window .shell-textarea,
.gchu-window .shell-btn,
.gchu-window input[type="file"],
.gchu-window input[type="number"],
.gchu-window input[type="range"] {
  font-size: inherit;
  font-family: inherit;
}

.gchu-window .shell-input,
.gchu-window .shell-textarea {
  padding: 0.3rem 0.4rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.gchu-window input[type="file"]:not(.shell-file-input) {
  width: 100%;
  max-width: 100%;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(157, 101, 255, 0.35);
  background: rgba(10, 4, 18, 0.72);
  color: var(--lavender-soft);
  color-scheme: dark;
}

.gchu-wall .gchu-wall-url {
  background: rgba(10, 4, 18, 0.78);
  color: var(--lavender);
}

.gchu-window input[type="range"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.gchu-window .shell-input--calc {
  font-size: 1.12em;
  margin-bottom: 0.3rem;
}

.gchu-window .shell-input--sm {
  width: 5rem;
}

.gchu-window .shell-display {
  margin: 0;
  font-size: 1.1em;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.gchu-window .shell-embed-wrap {
  margin-top: 0.35rem;
}

/* Müzik: genişlik + masaüstü yüksekliğine göre; köşeden büyütünce iframe de oranlı */
.gchu-window .gchu-embed {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(220px, 38vh, 36em);
  height: auto;
  margin-top: 0;
  margin-inline: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(10, 4, 18, 0.65);
  box-sizing: border-box;
  flex-shrink: 0;
}

.gchu-window--fixed-h .gchu-window__frame .gchu-embed {
  flex: 1 1 auto;
  min-height: min(180px, 28cqh);
  max-height: none;
  height: auto;
}

.gchu-window .gchu-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.gchu-window .shell-textarea {
  resize: vertical;
  min-height: 3.2em;
  max-height: 12em;
}

.gchu-window .shell-textarea--tall {
  min-height: 5em;
  max-height: min(18em, 40vh);
}

.gchu-window--fixed-h .gchu-window__frame > textarea.gchu-ed {
  flex: 1 1 auto;
  min-height: 10em;
  max-height: none;
  resize: vertical;
}

.gchu-window--fixed-h .gchu-window__frame > .gchu-music-root > textarea.gchu-m-ta {
  flex: 0 0 auto;
  max-height: 7em;
  min-height: 3em;
  resize: vertical;
}

.gchu-window .shell-laps {
  margin: 0;
  padding-left: 1em;
  max-height: 5.5em;
  font-size: inherit;
  flex-shrink: 0;
}

.gchu-window--fixed-h .gchu-window__frame .gchu-t-laps {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

.gchu-window__frame > *:last-child {
  margin-bottom: 0;
}

.gchu-window .calc-grid {
  gap: 0.28rem;
  flex: 0 0 auto;
  width: 100%;
  align-content: start;
}

.gchu-window--fixed-h .gchu-window__frame > .gchu-c-grid {
  flex: 1 1 auto;
  min-height: 0;
}

.gchu-window .calc-grid button {
  padding: 0.38rem 0.28rem;
}

/* Masaüstü alanı (gchu-desk) ve pencere genişliği (gchu-win): ölçek / yeniden boyut */
@container gchu-desk (min-width: 280px) {
  .gchu-window {
    /* cqw = %1 masaüstü genişliği; 2.6cqw ≈ 2.6% → ~15–26px aralığı */
    font-size: clamp(17px, 2.6cqw + 8px, 24px);
  }

  .gchu-window .shell-textarea--tall {
    max-height: min(20em, 52cqh, 72vh);
  }

  .gchu-window--fixed-h .gchu-window__frame > textarea.shell-textarea--tall {
    max-height: none;
  }
}

@container gchu-win (min-width: 220px) {
  .gchu-window .gchu-embed {
    max-height: min(14em, min(260px, 52cqi));
  }

  .gchu-window--fixed-h .gchu-window__frame .gchu-embed {
    max-height: none;
  }
}

/* Music Player: masaüstü oranı JS ile; Text Editor benzeri gövde + oynatıcı şeridi */
.gchu-window--music {
  min-width: min(100%, 280px);
}

.gchu-window--fixed-h .gchu-window__frame > .gchu-music-root {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  box-sizing: border-box;
}

.gchu-music-root {
  width: 100%;
  box-sizing: border-box;
}

.gchu-m-stack {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.gchu-m-chrome {
  display: grid;
  grid-template-columns: minmax(4.5rem, 30%) 1fr;
  grid-template-rows: auto auto auto auto;
  gap: 0.32rem 0.55rem;
  align-items: center;
  flex-shrink: 0;
}

.gchu-m-art-wrap {
  grid-column: 1;
  grid-row: 1 / -1;
  position: relative;
  width: 100%;
  max-width: 7.5rem;
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(10, 4, 18, 0.78);
  box-shadow: inset 0 0 0 1px rgba(160, 32, 240, 0.12);
}

.gchu-m-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.gchu-m-art[src] {
  display: block;
}

.gchu-m-art-wrap:has(.gchu-m-art[src]) .gchu-m-art-fallback {
  display: none;
}

.gchu-m-art-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 4rem;
  font-size: clamp(1.4rem, 3.5cqw, 2rem);
  color: rgba(200, 180, 255, 0.55);
}

.gchu-m-meta {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.gchu-m-title {
  font-weight: 600;
  color: var(--lavender);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gchu-m-artist {
  font-size: 0.88em;
  opacity: 0.88;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gchu-m-times {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.82em;
  opacity: 0.9;
}

.gchu-m-scrub {
  grid-column: 2;
  grid-row: 3;
  width: 100%;
}

.gchu-m-scrub-track {
  height: 6px;
  border-radius: 4px;
  background: rgba(30, 12, 48, 0.85);
  border: 1px solid rgba(160, 32, 240, 0.25);
  overflow: hidden;
}

.gchu-m-scrub-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(160, 32, 240, 0.55), rgba(200, 140, 255, 0.85));
  transition: width 0.25s ease-out;
}

.gchu-m-transport {
  grid-column: 2;
  grid-row: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  width: 100%;
}

.gchu-m-transport .shell-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.24rem 0.2rem;
  font-size: 0.92em;
}

.gchu-m-transport .gchu-m-pp {
  flex: 1.15 1 0;
}

.gchu-m-transport .gchu-m-active {
  border-color: rgba(200, 140, 255, 0.65);
  background: rgba(160, 32, 240, 0.18);
}

.gchu-m-hint {
  flex-shrink: 0;
  margin: 0;
  font-size: 0.82em;
}

.gchu-m-footer {
  flex-shrink: 0;
  margin-top: 0;
}

.gchu-embed.gchu-embed--dim {
  opacity: 0.42;
  transition: opacity 0.2s ease;
}

#modal-music .gchu-music-root {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: min(calc(100vh - 6rem), 720px);
  overflow: auto;
}

#modal-music .gchu-m-stack {
  flex: 1 1 auto;
  min-height: 10rem;
}

#modal-music .gchu-m-stack .gchu-embed {
  flex: 1 1 auto;
  min-height: 140px;
  max-height: min(42vh, 360px);
}

/* Alarm: masaüstü ~%35 × ~%24; simetrik Saat : Dk : Sn kadranı */
.gchu-window--alarm {
  min-width: min(100%, 260px);
}

.gchu-window--fixed-h .gchu-window__frame > .gchu-alarm-root {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-align: center;
}

.gchu-alarm-root {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.gchu-al-hint {
  margin: 0;
  max-width: 22rem;
}

.gchu-al-dial {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.35rem 0.45rem;
  width: 100%;
  max-width: 20rem;
  margin-inline: auto;
  padding: 0.35rem 0.45rem 0.45rem;
  border-radius: 10px;
  border: 1px solid rgba(160, 32, 240, 0.3);
  background: rgba(10, 4, 18, 0.5);
  box-sizing: border-box;
}

.gchu-al-slot {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 0.16rem;
  flex: 1 1 5rem;
  min-width: 4rem;
  max-width: 6.5rem;
}

.gchu-al-slot-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  width: 100%;
}

.gchu-al-lab {
  font-size: 0.68em;
  letter-spacing: 0.06em;
  opacity: 0.82;
  text-transform: uppercase;
}

.gchu-al-slot .shell-input {
  width: 100%;
  max-width: 5.2rem;
  text-align: center;
  box-sizing: border-box;
}

.gchu-alarm-root .gchu-al-step {
  min-width: 2rem;
  max-width: 100%;
  padding: 0.14rem 0.32rem;
  font-size: 1.05em;
  line-height: 1.1;
}

.gchu-al-sep {
  font-size: 1.35em;
  opacity: 0.42;
  padding-bottom: 0.38rem;
  flex: 0 0 auto;
}

.gchu-al-r {
  margin: 0.1rem 0 0;
  font-size: clamp(1.15rem, 3cqw, 1.7rem);
  letter-spacing: 0.04em;
  min-height: 1.45em;
}

.gchu-al-r--tick {
  color: var(--lavender);
  text-shadow: 0 0 14px rgba(200, 140, 255, 0.32);
}

.gchu-al-actions {
  width: 100%;
  max-width: 20rem;
  margin-top: 0.05rem;
}

#modal-alarm .gchu-alarm-mount .gchu-alarm-root {
  padding: 0.4rem 0;
  max-width: 24rem;
  margin-inline: auto;
}

/* Game Library (games.json) + oynatma — GNUCHANOS mor / glass ile uyumlu */
.gchu-window--library {
  min-width: min(100%, 520px);
}

.gchu-window--fixed-h .gchu-window__frame > .gchu-lib {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(12rem, 28%) 1fr;
  column-gap: 0.65rem;
  row-gap: 0;
  padding: 0.35rem 0.4rem 0.35rem 0.35rem;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  container-type: size;
  container-name: gchu-lib;
  background: linear-gradient(165deg, rgba(31, 10, 50, 0.75) 0%, rgba(18, 6, 28, 0.88) 50%, rgba(13, 4, 20, 0.92) 100%);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  color: var(--lavender-soft);
}

.gchu-lib--loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  grid-column: 1 / -1;
}

.gchu-lib-spinner {
  width: 36px;
  height: 36px;
  margin-bottom: 0.75rem;
  border: 2px solid rgba(157, 101, 255, 0.22);
  border-top-color: rgba(196, 168, 255, 0.95);
  border-radius: 50%;
  animation: gchu-lib-spin 0.7s linear infinite;
}

@keyframes gchu-lib-spin {
  to {
    transform: rotate(360deg);
  }
}

.gchu-lib--error .gchu-lib-err-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--lavender);
}

.gchu-lib-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.45rem 0.55rem;
  margin: 0 0.35rem 0.55rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(157, 101, 255, 0.28);
  border-radius: 0 0 10px 10px;
  background: linear-gradient(100deg, rgba(157, 101, 255, 0.12) 0%, transparent 65%);
}

.gchu-lib-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border-right: 1px solid var(--glass-border);
  background: rgba(10, 4, 18, 0.5);
  padding-top: 0.25rem;
}

.gchu-lib-sidebar .shell-input.gchu-lib-search {
  flex-shrink: 0;
  margin: 0 0.45rem 0.4rem;
  /* width:100% + yatay margin taşmasın (köşe kırpılmasın) */
  width: calc(100% - 0.9rem);
  max-width: calc(100% - 0.9rem);
  box-sizing: border-box;
}

.gchu-lib-brand-mark {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(196, 168, 255, 0.55), rgba(80, 40, 130, 0.9));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 20px rgba(157, 101, 255, 0.25);
}

.gchu-lib-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.gchu-lib-brand-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lavender);
}

.gchu-lib-brand-sub {
  font-size: 0.62rem;
}

.gchu-lib-search:focus-visible {
  outline: 2px solid rgba(157, 101, 255, 0.55);
  outline-offset: 1px;
}

.gchu-lib-list-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  margin: 0 0.45rem;
  border-radius: 0 0 8px 8px;
}

.gchu-lib-list {
  list-style: none;
  margin: 0;
  padding: 0.2rem 0;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(157, 101, 255, 0.35) rgba(10, 4, 18, 0.3);
}

.gchu-lib-list::-webkit-scrollbar {
  width: 7px;
}

.gchu-lib-list::-webkit-scrollbar-track {
  background: rgba(10, 4, 18, 0.25);
}

.gchu-lib-list::-webkit-scrollbar-thumb {
  background: rgba(157, 101, 255, 0.35);
  border-radius: 4px;
}

.gchu-lib-list::-webkit-scrollbar-thumb:hover {
  background: rgba(157, 101, 255, 0.5);
}

.gchu-lib-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.5rem 0.32rem 0.35rem;
  cursor: default;
  border-left: 3px solid transparent;
  color: var(--lavender-soft);
  border-radius: 0 4px 4px 0;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}

.gchu-lib-item:focus-visible {
  outline: none;
  background: rgba(157, 101, 255, 0.12);
  border-left-color: rgba(196, 168, 255, 0.45);
}

.gchu-lib-item:hover {
  background: rgba(157, 101, 255, 0.1);
}

.gchu-lib-item--active {
  background: rgba(157, 101, 255, 0.24);
  border-left-color: var(--accent-dot);
  box-shadow: 0 0 12px rgba(157, 101, 255, 0.08);
}

.gchu-lib-thumb {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(157, 101, 255, 0.28);
}

.gchu-lib-thumb--ph {
  display: inline-block;
  width: 56px;
  height: 56px;
  background: rgba(43, 16, 64, 0.55);
  border-radius: 4px;
  border: 1px solid var(--glass-border);
}

.gchu-lib-item-title {
  font-size: 0.8em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.gchu-lib-count {
  flex-shrink: 0;
  margin: 0;
  padding: 0.3rem 0.45rem 0.45rem;
  font-size: 0.68em;
  color: var(--lavender-muted);
  border-top: 1px solid rgba(157, 101, 255, 0.08);
}

.gchu-lib-load-more {
  flex-shrink: 0;
  margin: 0 0.45rem 0.45rem;
  width: calc(100% - 0.9rem);
  max-width: calc(100% - 0.9rem);
  box-sizing: border-box;
  font-size: 0.72rem;
}

.gchu-lib-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.gchu-lib-main--empty .gchu-lib-toolbar,
.gchu-lib-main--empty .gchu-lib-body {
  opacity: 0.42;
  pointer-events: none;
}

.gchu-lib-empty {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
  background: rgba(10, 4, 18, 0.78);
  backdrop-filter: blur(5px);
  pointer-events: none;
}

.gchu-lib-empty[hidden] {
  display: none !important;
}

.gchu-lib-empty-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--lavender);
}

.gchu-lib-empty-hint {
  margin: 0;
  max-width: 14rem;
  font-size: 0.75rem;
  line-height: 1.35;
}

.gchu-lib-main--browse .gchu-lib-hero-wrap .gchu-lib-hero {
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(157, 101, 255, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 30%, rgba(80, 40, 120, 0.4) 0%, transparent 50%),
    linear-gradient(165deg, rgba(31, 10, 50, 0.9) 0%, rgba(13, 4, 20, 0.95) 100%);
  background-color: rgba(10, 4, 18, 0.92);
}

.gchu-lib-browse-lead {
  margin: 0 0 0.45rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--lavender-muted);
}

.gchu-lib-browse-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.gchu-lib-browse-chip {
  font-size: 0.68rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(43, 16, 64, 0.55);
  border: 1px solid rgba(157, 101, 255, 0.28);
  color: var(--lavender-soft);
}

.gchu-lib-browse-chip strong {
  color: var(--lavender);
  font-weight: 600;
  margin-left: 0.25rem;
}

.gchu-lib-hero-wrap {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  /* Sabit yükseklik bandı: cqh küçülünce kapak çökmez, OYNA satırı başlığa yapışmaz */
  height: clamp(168px, 34cqi, 240px);
  min-height: 168px;
  max-height: 240px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(157, 101, 255, 0.22);
  box-sizing: border-box;
}

.gchu-lib-hero {
  position: absolute;
  inset: 0;
  height: 100%;
  min-height: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: rgba(10, 4, 18, 0.92);
}

.gchu-lib-hero-overlay {
  position: absolute;
  inset: 0;
  height: auto;
  min-height: 0;
  padding: 0.65rem 0.85rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 0.2rem;
  background: linear-gradient(180deg, transparent 0%, rgba(13, 4, 20, 0.45) 45%, rgba(13, 4, 20, 0.92) 100%);
  pointer-events: none;
}

.gchu-lib-title {
  margin: 0;
  font-size: clamp(0.95rem, 3.2cqi + 0.5rem, 1.35rem);
  font-weight: 600;
  line-height: 1.2;
  max-height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  color: var(--lavender);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

.gchu-lib-segment {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.72em;
  color: var(--lavender-muted);
}

.gchu-lib-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(43, 16, 64, 0.45);
  transition: opacity 0.15s ease;
}

.gchu-lib-play {
  flex-shrink: 0;
  border: 1px solid rgba(196, 168, 255, 0.45);
  border-radius: 8px;
  padding: 0.45rem 2rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(157, 101, 255, 0.45), rgba(80, 40, 120, 0.75));
  color: #f4ecff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 0 20px rgba(157, 101, 255, 0.15);
}

.gchu-lib-play:hover:not(:disabled) {
  border-color: rgba(196, 168, 255, 0.65);
  filter: brightness(1.08);
}

.gchu-lib-play:focus-visible {
  outline: 2px solid rgba(196, 168, 255, 0.75);
  outline-offset: 2px;
}

.gchu-lib-play:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gchu-lib-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  flex: 1 1 auto;
  min-width: 0;
}

.gchu-lib-stat {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.gchu-lib-stat-k {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--lavender-muted);
}

.gchu-lib-stat-v {
  font-size: 0.72rem;
  color: var(--lavender-soft);
  line-height: 1.25;
  word-break: break-word;
}

.gchu-lib-toolbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gchu-lib-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.65rem 0.9rem 0.85rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(157, 101, 255, 0.28) transparent;
}

.gchu-lib-main--browse .gchu-lib-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gchu-lib-browse-random {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0.45rem;
}

.gchu-lib-browse-random[hidden] {
  display: none !important;
}

.gchu-lib-browse-random-lab {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.gchu-lib-random-list {
  list-style: none;
  margin: 0;
  padding: 0.2rem 0.15rem 0.3rem 0;
  flex: 1 1 auto;
  min-height: 7rem;
  max-height: min(42cqi, 15rem);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(157, 101, 255, 0.4) rgba(10, 4, 18, 0.4);
  border: 1px solid rgba(157, 101, 255, 0.22);
  border-radius: 8px;
  background: rgba(10, 4, 18, 0.4);
}

.gchu-lib-random-list::-webkit-scrollbar {
  width: 8px;
}

.gchu-lib-random-list::-webkit-scrollbar-thumb {
  background: rgba(157, 101, 255, 0.38);
  border-radius: 6px;
}

.gchu-lib-random-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--lavender-soft);
  border: 1px solid transparent;
}

.gchu-lib-random-item:hover,
.gchu-lib-random-item:focus-visible {
  background: rgba(157, 101, 255, 0.14);
  border-color: rgba(157, 101, 255, 0.28);
  outline: none;
}

.gchu-lib-random-thumb {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(157, 101, 255, 0.25);
}

.gchu-lib-random-title {
  font-size: 0.78em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-width: 0;
}

.gchu-lib-main--browse .gchu-lib-desc {
  flex-shrink: 0;
}

.gchu-lib-main--browse .gchu-lib-desc-lab {
  flex-shrink: 0;
}

.gchu-lib-main--browse .gchu-lib-genre-pills {
  flex-shrink: 0;
  margin-top: 0.5rem;
}

.gchu-lib-body-lab {
  margin: 0 0 0.25rem;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gchu-lib-genre-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.gchu-lib-pill {
  font-size: 0.65rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(157, 101, 255, 0.14);
  border: 1px solid rgba(157, 101, 255, 0.28);
  color: var(--lavender-soft);
  text-transform: lowercase;
}

.gchu-lib-pill--genre {
  background: rgba(43, 16, 64, 0.55);
  border-color: var(--glass-border);
}

.gchu-lib-desc {
  font-size: 0.78em;
  line-height: 1.45;
  color: rgba(196, 168, 255, 0.82);
}

.gchu-lib-desc p {
  margin: 0 0 0.65em;
}

.gchu-lib-how {
  margin-top: 0.5rem !important;
  opacity: 0.95;
  color: var(--lavender-soft);
}

.gchu-lib-genres {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.gchu-lib-chip {
  font-size: 0.65rem;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: rgba(43, 16, 64, 0.5);
  border: 1px solid var(--glass-border);
  color: var(--lavender-soft);
}

.gchu-window--gameplay .gchu-gameplay {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
}

.gchu-window--gameplay .gchu-embed--gameplay {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: unset;
  border-radius: 6px;
  border-color: var(--glass-border);
  background: rgba(10, 4, 18, 0.65);
}

.gchu-window--gameplay .gchu-embed--gameplay iframe {
  width: 100%;
  height: 100%;
  min-height: 200px;
}

.gchu-window--fixed-h .gchu-window__frame > .gchu-gameplay {
  flex: 1 1 auto;
  min-height: 0;
}

/* ——— Duvar kağıdı yöneticisi (2 sekme + kaydırmalı hazır liste) ——— */
.gchu-window--wall {
  min-width: min(100%, 460px);
}

.gchu-wall {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.gchu-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 0;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(157, 101, 255, 0.35);
}

.gchu-tab {
  flex: 1;
  font: inherit;
  cursor: pointer;
  padding: 0.4rem 0.55rem;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: rgba(10, 4, 18, 0.4);
  color: var(--lavender-muted);
  border-radius: 7px 7px 0 0;
}

.gchu-tab:hover {
  color: var(--lavender);
}

.gchu-tab--active {
  color: var(--lavender);
  background: rgba(43, 16, 64, 0.5);
  border-bottom-color: rgba(179, 136, 255, 0.85);
}

.gchu-tabpanels {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gchu-tabpanel {
  flex: 1 1 auto;
  min-height: 0;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.gchu-tabpanel:not([hidden]) {
  display: flex;
}

.gchu-wall-hint {
  flex-shrink: 0;
  margin: 0;
}

.gchu-wall-list {
  list-style: none;
  margin: 0;
  padding: 0.1rem 0.15rem 0.25rem 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: min(38vh, 280px);
}

.gchu-window--fixed-h .gchu-wall-list {
  max-height: none;
}

.gchu-wall-list li {
  margin: 0;
  padding: 0;
}

.gchu-wall-item {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  min-height: 3rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(157, 101, 255, 0.38);
  background-color: rgba(26, 11, 40, 0.65);
  background-size: cover;
  background-position: center;
  color: #f2eaff;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.95), 0 1px 3px rgba(0, 0, 0, 0.85);
  box-sizing: border-box;
}

.gchu-wall-item:hover {
  border-color: rgba(179, 136, 255, 0.8);
  filter: brightness(1.06);
}

.gchu-wall-item--bare {
  background-image: none !important;
  color: var(--lavender-soft);
  text-shadow: none;
}

/* ——— Başlık satırı (launcher) ——— */
.gnuchanos-launcher__title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  color: var(--lavender-muted);
  letter-spacing: 0.04em;
}

.gnuchanos-launcher__title kbd {
  margin: 0 0.15rem;
}

/* ——— Launcher (rofi stub) ——— */
.launcher {
  position: fixed;
  z-index: 20;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  width: min(22rem, 92vw);
  padding: 0.65rem 0.75rem 0.75rem;
  border-radius: 10px;
}

.launcher.is-hidden {
  display: none;
}

.launcher__input {
  width: 100%;
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(157, 101, 255, 0.35);
  background: rgba(10, 4, 18, 0.65);
  color: var(--lavender);
  outline: none;
}

.launcher__input::placeholder {
  color: var(--lavender-muted);
}

.launcher__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 12rem;
  overflow: auto;
}

.launcher__list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  cursor: default;
  color: var(--lavender-soft);
  font-size: 0.78rem;
}

.launcher__list li[aria-selected="true"],
.launcher__list li:hover {
  background: rgba(80, 40, 120, 0.35);
}

.launcher__hint {
  font-size: 0.68rem;
  color: var(--lavender-muted);
}

/* ——— Üst bar ses ——— */
.vol--btn {
  font: inherit;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0.15rem 0.25rem;
  border-radius: 6px;
  color: inherit;
}

.vol--btn:hover {
  background: rgba(179, 136, 255, 0.15);
}

.bar-audio-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ——— Book Reader App ——— */
.gchu-books-root {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 0.75rem;
  overflow: hidden;
  background: rgba(19, 9, 31, 0.65);
  border-radius: 14px;
  border: 1px solid rgba(157, 101, 255, 0.16);
}

.books-shell {
  display: flex;
  gap: 1rem;
  min-height: 0;
  flex: 1;
  align-items: stretch;
  position: relative;
  height: 100%;
}

.books-sidebar {
  flex: 0 0 230px;
  min-width: 200px;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(10, 4, 18, 0.75);
  border: 1px solid rgba(157, 101, 255, 0.18);
  overflow: hidden;
  transition: width 0.2s ease, opacity 0.2s ease;
  min-height: 0;
}

.books-sidebar--hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.books-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow-y: auto;
  flex: 1;
  max-height: none;
}

.books-sidebar-show {
  position: relative;
  z-index: 2;
  opacity: 1;
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 0.75rem;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.books-sidebar-show--hidden {
  display: none;
  opacity: 0;
  visibility: hidden;
}

.books-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.books-sidebar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--lavender);
}

.books-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow-y: auto;
  max-height: calc(100vh - 14rem);
}

.books-sidebar-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.books-sidebar-button,
.books-sidebar-chapter {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(157, 101, 255, 0.15);
  color: var(--lavender);
}

.books-sidebar-item--active .books-sidebar-button,
.books-sidebar-chapter--active {
  background: rgba(157, 101, 255, 0.12);
  border-color: rgba(157, 101, 255, 0.4);
}

.books-sidebar-chapters {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.books-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 0.85rem 0.85rem 0.9rem 0.5rem;
  gap: 0.75rem;
  padding-bottom: 0; /* footer is outside scrollable content now */
}

.books-main > * {
  flex: 0 0 auto; /* ensure children don't collapse or overlap */
  min-width: 0;
  
}

.books-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 0.25rem;
  box-sizing: border-box;
}

.books-main > * {
  min-height: 0;
}

.books-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.books-list-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(157, 101, 255, 0.35);
  background: rgba(26, 11, 40, 0.55);
  transition: all 0.15s ease;
}

.books-list-item:hover {
  border-color: rgba(179, 136, 255, 0.65);
  background: rgba(26, 11, 40, 0.75);
}

.books-list-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--lavender);
}

.books-list-desc {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--lavender-muted);
  margin: 0;
}

.books-list-author {
  display: inline-block;
  font-size: 0.82rem;
  line-height: 1.35;
  color: rgba(196, 168, 255, 0.8);
}

.books-list-item .shell-btn {
  align-self: flex-start;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  margin-top: 0.15rem;
}

.books-book-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(157, 101, 255, 0.18);
  margin-bottom: 1rem;
}

.books-book-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--lavender);
}

.books-book-meta {
  font-size: 0.85rem;
  color: var(--lavender-muted);
}

.books-saved {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(179, 136, 255, 0.45);
  background: rgba(40, 19, 70, 0.55);
}

.books-saved-label {
  font-size: 0.78rem;
  color: var(--lavender-muted);
}

.books-saved-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--lavender);
}

.books-saved-author {
  font-size: 0.82rem;
  color: var(--lavender-muted);
}

.books-saved .shell-btn {
  width: fit-content;
  font-size: 0.85rem;
  padding: 0.3rem 0.55rem;
}

.books-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(157, 101, 255, 0.25);
}

.books-header .shell-btn {
  align-self: flex-start;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
}

.books-chapter-title {
  margin: 0;
  font-size: 1.08rem;
  color: var(--lavender);
  font-weight: 600;
}

.books-section {
  margin: 0.55rem 0;
  padding: 0.6rem 0;
  display: block;
  flex: 0 0 auto;
}

.books-section-title {
  margin: 0.6rem 0 0.3rem;
  font-size: 0.92rem;
  color: rgba(196, 168, 255, 0.95);
  font-weight: 500;
}

.books-section-content {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--lavender-soft);
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 0.6rem 0.35rem;
  box-sizing: border-box;
  max-width: 100%;
  display: block;
}

.books-code {
  margin: 0.75rem 0 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: rgba(15, 7, 35, 0.8);
  border: 1px solid rgba(157, 101, 255, 0.18);
  color: #e9e0ff;
  overflow-x: auto;
  white-space: pre;
  font-size: 0.85rem;
  line-height: 1.5;
}

.books-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.books-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(157, 101, 255, 0.25);
}

/* Keep navigation visible without overlapping content */
.books-footer {
  position: relative;
  background: linear-gradient(180deg, rgba(10,4,18,0), rgba(10,4,18,0.12));
  padding: 0.5rem 0.35rem;
  z-index: 2;
}

.books-chapter-info {
  flex: 1 1 auto;
  text-align: center;
  font-size: 0.82rem;
  color: var(--lavender-muted);
}

.books-footer .shell-btn {
  font-size: 0.85rem;
  padding: 0.28rem 0.45rem;
  flex: 0 1 auto;
}

.books-footer .shell-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

#modal-books {
  min-width: min(100%, 460px);
}

#modal-books .gchu-books-root {
  max-height: min(calc(100vh - 6rem), 720px);
  overflow-y: auto;
}

.lang-select {
  font: inherit;
  font-size: 0.72rem;
  max-width: 7.75rem;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  border: 1px solid rgba(157, 101, 255, 0.45);
  /* Yerel açılır liste: color-scheme:dark bazen koyu yazı+koyu zemin (okunmaz) üretir */
  color-scheme: light;
  background-color: rgba(22, 12, 34, 0.95);
  color: #ebe3ff;
  cursor: pointer;
}

.lang-select:hover {
  border-color: rgba(196, 168, 255, 0.55);
}

.lang-select option,
.lang-select optgroup {
  background-color: #1a0f28;
  color: #f2eaff;
}

.lang-select:focus-visible {
  outline: 2px solid rgba(157, 101, 255, 0.45);
  outline-offset: 1px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Shell modallar ——— */
.shell-backdrop {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: rgba(0, 0, 0, 0.45);
}

.shell-backdrop.is-hidden {
  display: none;
}

.shell-modal {
  position: fixed;
  z-index: 16;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(32rem, 94vw);
  max-height: min(88vh, 40rem);
  overflow: auto;
  padding: 0.85rem 1rem 1rem;
  border-radius: 12px;
}

.shell-modal.is-hidden {
  display: none;
}

.shell-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.shell-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--lavender);
}

.shell-modal__close {
  font: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--lavender-muted);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

.shell-modal__close:hover {
  color: var(--lavender);
  background: rgba(179, 136, 255, 0.12);
}

.shell-muted {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  color: var(--lavender-muted);
}

.shell-field {
  display: block;
  margin: 0.35rem 0 0.2rem;
  font-size: 0.78rem;
}

.shell-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.shell-row--wrap {
  margin-top: 0.25rem;
}

.shell-btn {
  font: inherit;
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(43, 16, 64, 0.45);
  color: var(--lavender);
}

.shell-btn:hover {
  border-color: rgba(196, 168, 255, 0.45);
  background: rgba(80, 40, 120, 0.35);
}

.shell-btn--ghost {
  background: transparent;
}

.shell-input,
.shell-textarea {
  width: 100%;
  font: inherit;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(157, 101, 255, 0.35);
  background: rgba(10, 4, 18, 0.72);
  color: var(--lavender);
  resize: vertical;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.shell-input::placeholder,
.shell-textarea::placeholder {
  color: var(--lavender-muted);
  opacity: 1;
}

.shell-input:-webkit-autofill,
.shell-input:-webkit-autofill:hover,
.shell-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 40px rgba(10, 4, 18, 0.95) inset;
  -webkit-text-fill-color: var(--lavender);
  caret-color: var(--lavender);
}

.shell-input:focus-visible,
.shell-textarea:focus-visible {
  border-color: rgba(196, 168, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(157, 101, 255, 0.25);
}

/* Dosya seçici: native "Choose File" yerine shell düğmesi + gizli input */
.shell-file-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin: 0 0 0.35rem;
}

.shell-file-trigger {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.shell-file-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 2.5rem;
}

.shell-file-fake {
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.shell-file-status {
  flex: 1 1 10rem;
  min-width: 0;
  margin: 0;
  font-size: 0.72rem;
  color: var(--lavender-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-textarea--tall {
  min-height: 12rem;
}

.shell-input--calc {
  text-align: right;
  font-size: 1.1rem;
  margin-bottom: 0.45rem;
}

.shell-input--sm {
  width: 4.5rem;
  display: inline-block;
  margin-left: 0.25rem;
}

.shell-display {
  margin: 0.35rem 0;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  color: var(--lavender);
}

.shell-embed-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  margin-top: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.shell-embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.shell-laps {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  max-height: 8rem;
  overflow: auto;
  font-size: 0.75rem;
  color: var(--lavender-muted);
}

/* ——— Hesap makinesi ızgarası ——— */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.calc-grid button {
  font: inherit;
  cursor: pointer;
  padding: 0.5rem 0.35rem;
  border-radius: 8px;
  border: 1px solid rgba(157, 101, 255, 0.3);
  background: rgba(26, 11, 40, 0.55);
  color: var(--lavender-soft);
}

.calc-grid button:hover {
  background: rgba(80, 40, 120, 0.35);
}

@media (max-width: 720px) {
  .stage {
    flex-direction: column;
  }

  .gnuchanos-desktop {
    min-height: 240px;
  }
}
