/* Taptu 2011 — atkūrimas. Tamsi bazė, spalvotos srautų juostos, kaladėlės su nuotrauka. */
:root {
  --bg: #1c1c1c;
  --bar: #2b2b2b;
  --tile: #ffffff;
  --tile-fg: #1a1a1a;
  --muted: #8a8a8a;
  --tile-w: 31.5vw;
  --tile-h: 40vw;
}
@media (min-width: 700px) {
  :root { --tile-w: 210px; --tile-h: 260px; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: #fff;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  overscroll-behavior-y: contain;
}

/* ---------------------------------------------------- viršutinė juosta */
#topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  height: 52px; padding: 0 14px;
  background: var(--bar);
  border-bottom: 1px solid #000;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
#logo { font-size: 26px; font-weight: 300; letter-spacing: -1px; user-select: none; }
#logo .a { color: #9a9a9a; }
#logo .b { color: #fff; font-weight: 500; }
#topbar .spacer { flex: 1; }
.icon-btn {
  background: none; border: 0; color: #cfcfcf; cursor: pointer;
  font-size: 21px; line-height: 1; padding: 8px; border-radius: 6px;
}
.icon-btn:active { background: #3d3d3d; }
.icon-btn.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------- srauto juosta */
.stream { margin-bottom: 4px; }
.stream-bar {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 12px;
  font-size: 15px; font-weight: 500; color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,.35);
}
.stream-bar .name { flex: 1; }
.stream-bar .count { font-size: 12px; opacity: .75; font-weight: 400; }

/* ---------------------------------------------------- kaladėlių eilė */
.row {
  display: flex; gap: 6px;
  padding: 6px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.row::-webkit-scrollbar { display: none; }

.tile {
  flex: 0 0 var(--tile-w);
  width: var(--tile-w); height: var(--tile-h);
  background: var(--tile); color: var(--tile-fg);
  border-radius: 2px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  scroll-snap-align: start;
  box-shadow: 0 1px 3px rgba(0,0,0,.6);
  transition: transform .08s;
}
.tile:active { transform: scale(.97); }
.tile.read { opacity: .5; }

.tile .thumb {
  position: relative; flex: 1; min-height: 0;
  background: #3a3a3a center/cover no-repeat;
}
.tile .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 35%, rgba(0,0,0,.82) 100%);
}
.tile .headline {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 6px 7px;
  font-size: 12.5px; line-height: 1.22; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.9);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile .meta {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 7px; height: 26px;
  font-size: 10.5px; color: #6b6b6b; background: #fff;
  border-top: 1px solid #ececec;
}
.tile .meta img { width: 12px; height: 12px; border-radius: 2px; flex: 0 0 auto; }
.tile .meta .src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .meta .ago { margin-left: auto; flex: 0 0 auto; color: #9a9a9a; }

.row .empty { color: var(--muted); font-size: 13px; padding: 22px 10px; }

/* ---------------------------------------------------- „Tau" juosta */
.stream.smart { margin-bottom: 10px; }
.stream.smart .stream-bar {
  height: 38px; font-size: 16px; font-weight: 600;
  background-image: linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,0));
}
.stream.smart .tile {
  flex-basis: 62vw; width: 62vw; height: auto; min-height: 50vw;
}
@media (min-width: 700px) {
  .stream.smart .tile { flex-basis: 320px; width: 320px; min-height: 300px; }
}
.stream.smart .thumb { min-height: 34vw; flex: none; }
@media (min-width: 700px) {
  .stream.smart .thumb { min-height: 180px; }
}
.stream.smart .headline { font-size: 14.5px; -webkit-line-clamp: 3; }

.tile .badge {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  background: #7b2ff7; color: #fff;
  font-size: 10px; font-weight: 600; letter-spacing: .2px;
  padding: 3px 7px; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.tile .why {
  padding: 8px 9px;
  font-size: 12.5px; line-height: 1.35; color: #2b1d47;
  background: #efe6ff; border-top: 2px solid #7b2ff7;
}
.tile .why::before { content: "→ "; color: #7b2ff7; font-weight: 700; }

#settings textarea {
  width: 100%; background: #171717; border: 1px solid #3d3d3d; color: #ddd;
  border-radius: 5px; padding: 11px; font-size: 13px; line-height: 1.5;
  font-family: inherit; resize: vertical;
}

/* ---------------------------------------------------- skaitymo vaizdas */
#reader {
  position: fixed; inset: 0; z-index: 100;
  background: #fff; color: #16181d;
  transform: translateY(100%); transition: transform .22s ease-out;
  display: flex; flex-direction: column;
}
#reader.open { transform: translateY(0); }
#reader-bar {
  display: flex; align-items: center; gap: 8px;
  height: 50px; padding: 0 8px; flex: 0 0 auto;
  background: var(--bar); color: #fff;
}
#reader-bar .title {
  flex: 1; font-size: 13px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; color: #d8d8d8;
}
#reader-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 18px 18px 60px;
}
#reader-body h1.a-title {
  font-size: 25px; line-height: 1.22; margin: 0 0 6px; font-weight: 700;
}
#reader-body .a-meta { color: #8a8a8a; font-size: 12.5px; margin-bottom: 18px; }
#reader-body .content { font-size: 17.5px; line-height: 1.62; }
#reader-body .content p { margin: 0 0 1.05em; }
#reader-body .content img { max-width: 100%; height: auto; border-radius: 3px; margin: 10px 0; }
#reader-body .content h2, #reader-body .content h3 { font-size: 19px; margin: 1.4em 0 .4em; }
#reader-body .content a { color: #0a6cc4; }
#reader-body .content figure { margin: 12px 0; }
#reader-body .fallback {
  background: #fff5e5; border: 1px solid #f0c987; border-radius: 4px;
  padding: 14px; font-size: 14.5px; line-height: 1.5;
}
.loader { color: #999; font-size: 14px; padding: 30px 0; text-align: center; }

/* ---------------------------------------------------- nustatymai */
#settings {
  position: fixed; inset: 0; z-index: 110;
  background: #232323; color: #eee;
  transform: translateY(100%); transition: transform .22s ease-out;
  display: flex; flex-direction: column;
}
#settings.open { transform: translateY(0); }
#settings .body { flex: 1; overflow-y: auto; padding: 14px 14px 50px; }
#settings h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .6px;
  color: #fff; margin: 20px 0 8px; padding: 5px 9px; border-radius: 3px;
}
#settings .feed {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 4px; border-bottom: 1px solid #333; font-size: 14px;
}
#settings .feed .t { flex: 1; }
#settings .feed .u { display: block; font-size: 11px; color: #7e7e7e; margin-top: 2px; }
#settings .feed .dead { color: #ff6b6b; font-size: 11px; }
#settings .feed button {
  background: #3a3a3a; color: #ddd; border: 0; border-radius: 4px;
  padding: 5px 10px; font-size: 12px; cursor: pointer;
}
#settings .addrow { display: flex; gap: 6px; margin-top: 10px; }
#settings input {
  flex: 1; background: #171717; border: 1px solid #3d3d3d; color: #eee;
  border-radius: 4px; padding: 9px; font-size: 14px;
}
#settings .addrow button {
  background: #0091d5; color: #fff; border: 0; border-radius: 4px;
  padding: 0 15px; font-size: 14px; cursor: pointer;
}
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #000d; color: #fff; padding: 10px 18px; border-radius: 20px;
  font-size: 13px; z-index: 200; opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
#toast.show { opacity: 1; }
