body { height: 100dvh; display: grid; grid-template: auto minmax(0, 1fr) / minmax(0, 1fr); overflow: hidden; }
#animacje { display: grid; grid-template: 'widok bok' minmax(0, 1fr) 'os os' auto / minmax(0, 1fr) clamp(304px, 26vw, 400px); min-height: 0; }
.podglad { grid-area: widok; }
.os { grid-area: os; min-width: 0; }

/* siatka viewportu z osiami X i Y */
.siatka {
  background:
    linear-gradient(#8f3a49, #8f3a49) 0 50% / 100% 1px no-repeat,
    linear-gradient(#5f7f25, #5f7f25) 50% 0 / 1px 100% no-repeat,
    repeating-linear-gradient(90deg, #4a4a4a 0 1px, transparent 1px 48px) calc(50% + 0px) 0 / 4800px 100%,
    repeating-linear-gradient(#4a4a4a 0 1px, transparent 1px 48px) 0 50% / 100% 4800px,
    var(--widok);
}

.podglad { position: relative; border-top: 4px solid var(--panel); container-type: size; display: grid; place-items: center; }
.kadr { --ar: 1.7778; width: min(100cqw - 48px, (100cqh - 48px) * var(--ar)); aspect-ratio: var(--ar); background: #000; outline: 2px solid var(--pom); }
.kadr video { width: 100%; height: 100%; display: block; cursor: pointer; }
.podglad p { position: absolute; padding: 8px 16px; background: var(--tlo); border-radius: 4px; }

.pasek { background: var(--panel); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 8px 16px; }
.pasek h2 { font-size: 24px; line-height: 32px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.pasek div { display: flex; gap: 4px; justify-content: flex-end; }
#graj { width: 64px; }
#graj .i-pauza, .gra #graj .i-graj { display: none; }
.gra #graj .i-pauza { display: inline; }
#dzwiek[aria-pressed=true] .i-off, #dzwiek[aria-pressed=false] .i-on { display: none; }

.tor { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--btn) transparent; }
.linia { position: relative; width: max-content; min-width: 100%; padding: 0 16px 16px; }
.miarka { height: 40px; margin: 0 -16px; cursor: ew-resize; touch-action: none; background: repeating-linear-gradient(90deg, #4a4a4a 0 1px, transparent 1px 24px) 16px 100% / 100% 8px no-repeat; }
.klipy { display: flex; gap: 4px; }
.klip { --w: 1.35; flex: none; height: clamp(150px, 27vh, 300px); width: calc(clamp(150px, 27vh, 300px) * var(--w)); padding: 0; display: flex; flex-direction: column; text-align: left; overflow: hidden; background: var(--klip); color: #fff; position: relative; }
.klip:hover { background: #6688b0; }
.klip span { flex: none; padding: 4px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.klip img { flex: 1; min-height: 0; width: 100%; object-fit: cover; }
.klip.top { --w: 1.75; background: var(--zol); color: #1d1d1d; }
.klip.top:hover { background: #ffcb5c; }
.klip.top span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin: 0 10px 1px 2px; background: currentColor; transform: rotate(45deg); }
.klip[aria-current=true]::after { content: ""; position: absolute; inset: 0; border: 4px solid var(--pom); border-radius: 4px; }
.klip:focus-visible { outline-offset: -4px; }
.glowica { position: absolute; left: 0; top: 8px; bottom: 0; width: 2px; margin-left: -1px; background: #6a97dc; pointer-events: none; }
.glowica b { position: absolute; top: 0; left: 1px; transform: translateX(-50%); padding: 0 8px; border-radius: 4px; background: var(--nieb); color: #fff; font-weight: 400; }

/* kolumna edytorów po prawej, jak Outliner i Properties w Blenderze */
.wlasciwosci { grid-area: bok; display: flex; flex-direction: column; gap: 4px; border: solid var(--tlo); border-width: 4px 0 4px 4px; background: var(--tlo); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--btn) transparent; }
.okno { flex: none; background: var(--panel); border-radius: 6px; overflow: hidden; }
.okno:last-child, .okno:has(+ [hidden]) { flex-grow: 1; }
.okno h2 { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #262626; font-size: 16px; line-height: 24px; color: #fff; }
.okno h2 svg { width: 16px; height: 16px; fill: var(--pom); shape-rendering: crispEdges; }

#dane { padding: 12px; display: grid; gap: 4px; }
#dane div { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; align-items: center; }
#dane dt { text-align: right; overflow-wrap: anywhere; }
#dane :is(a, button) { display: block; width: 100%; min-height: 40px; padding: 8px 12px; text-align: left; background: #1d1d1d; border-radius: 4px; color: #fff; text-decoration: none; overflow-wrap: anywhere; }
#dane :is(a, button):hover { background: var(--nieb); }

#profile { list-style: none; padding: 0; }
#profile li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 8px 12px; background: var(--lista); }
#profile li:nth-child(even) { background: #2d2d2d; }
#profile img, #profile .brak { grid-row: span 2; width: 56px; height: 56px; border-radius: 4px; background: var(--btn); object-fit: cover; display: block; }
#profile b { font-weight: 400; color: #fff; overflow-wrap: anywhere; }
#profile div { display: flex; flex-wrap: wrap; gap: 4px; }
#profile a { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 2px 10px; border-radius: 4px; background: var(--btn); color: #fff; text-decoration: none; white-space: nowrap; }
#profile a:hover { background: var(--nieb); }
#profile svg { width: 16px; height: 16px; shape-rendering: crispEdges; flex: none; }

@media (max-width: 800px) {
  /* telefon: wszystko pod sobą, strona się przewija */
  body { height: auto; display: block; overflow: visible; }
  #animacje { display: block; }
  .podglad { height: 40dvh; min-height: 240px; }
  .wlasciwosci { border-width: 4px 0; overflow: visible; }
  .kadr { width: min(100cqw - 16px, (100cqh - 24px) * var(--ar)); }
}
@media (max-width: 640px) {
  header { padding: 8px 8px 0; }
  h1 { gap: 8px; }
  .pasek { grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px; padding: 8px; }
  .pasek h2 { font-size: 16px; }
  .linia { padding: 0 8px 12px; }
  .klip { height: 168px; width: calc(140px * var(--w)); }
}
@media (max-height: 520px) { .klip { height: 72px; width: calc(90px * var(--w)); } .miarka { height: 32px; } }
