/* Ostatnia Wojna Światowa — minimalist mobile-first */
:root {
  --bg: #f5f0e8;
  --surface: #ffffff;
  --surface-2: #efe8dc;
  --text: #1a1814;
  --text-muted: #8a8478;
  --line: rgba(26, 24, 20, 0.08);
  --accent: #c24d3e;
  --accent-ink: #ffffff;
  --shadow: 0 20px 60px rgba(26, 24, 20, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
}

html[data-theme="dark"] {
  --bg: #1a1814;
  --surface: #242019;
  --surface-2: #2d2820;
  --text: #f0ebe0;
  --text-muted: #8a8478;
  --line: rgba(240, 235, 224, 0.08);
  --accent: #e87a6c;
  --accent-ink: #1a1814;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
  min-height: 100dvh;
}

body {
  display: flex;
  justify-content: center;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  opacity: 0.7;
}

.app {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px 22px calc(180px + env(safe-area-inset-bottom, 0px)) 22px;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 4px;
}
.dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  display: block;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s;
}
.icon-btn:hover {
  background: var(--line);
}
.icon-btn:active {
  transform: scale(0.95);
}
.icon-btn .icon {
  display: none;
}
html[data-theme="light"] .icon-btn .icon-moon {
  display: block;
}
html[data-theme="dark"] .icon-btn .icon-sun {
  display: block;
}

/* Content */
.content {
  padding: 32px 2px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.cover {
  margin: 0 auto 28px;
  width: 220px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rating {
  display: flex;
  gap: 3px;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 14px;
  letter-spacing: 2px;
}

.title {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(30px, 7.5vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--text);
}
.author {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 22px;
  letter-spacing: 0.02em;
}
.excerpt {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 28px;
  max-width: 44ch;
}

/* Actions */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  transition:
    transform 0.15s,
    background 0.15s,
    color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-ghost {
  background: transparent;
}
.btn-ghost:hover {
  background: var(--surface-2);
}

/* Player — sticky bottom */
.player {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  width: calc(100% - 32px);
  max-width: 488px;
  background: var(--surface);
  border-radius: 26px;
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}
.player-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.player-label {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.player-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.time {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  min-width: 34px;
  text-align: center;
}
.progress {
  flex: 1;
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--text);
  border-radius: 999px;
  transition: width 0.2s linear;
}
.play-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  cursor: pointer;
  transition:
    transform 0.15s,
    background 0.2s;
  padding: 0;
}
.play-btn:hover {
  background: var(--accent);
  color: var(--accent-ink);
}
.play-btn:active {
  transform: scale(0.94);
}
.play-btn .ic-pause {
  display: none;
}
.play-btn.playing .ic-play {
  display: none;
}
.play-btn.playing .ic-pause {
  display: block;
}

/* Brand dot (header) */
.brand {
  display: inline-block;
  text-decoration: none;
}
.brand-dot {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s;
}
.lang:hover {
  background: var(--surface-2);
  opacity: 1;
}

/* Prose sections — long-form content */
.prose {
  margin-top: 44px;
  max-width: 44ch;
}
.prose h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--text);
  line-height: 1.2;
}
.prose p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}
.prose p strong {
  color: var(--text);
  font-weight: 600;
}
.prose p em {
  font-style: italic;
  color: var(--text);
}
.prose .pull {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 19px;
  line-height: 1.45;
  padding: 14px 0 14px 18px;
  border-left: 2px solid var(--accent);
  color: var(--text);
  margin: 16px 0 4px;
}

/* Share */
.share {
  margin-top: 44px;
  max-width: 44ch;
}
.share h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 8px;
}
.share-sub {
  color: var(--text-muted);
  margin: 0 0 16px;
  font-size: 14px;
}
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.2s,
    transform 0.15s;
  font-family: inherit;
}
.share-btn:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
  opacity: 1;
}
.share-btn:active {
  transform: scale(0.97);
}

.share-native {
  display: inline-flex;
  margin-bottom: 14px;
}
.share-btn.share-wa {
  background: #25d3661a;
}
.share-btn.share-tg {
  background: #229ed91a;
}
.share-btn.share-fb {
  background: #1877f21a;
}
.share-btn.share-x {
  background: #0000001a;
}
html[data-theme="dark"] .share-btn.share-x {
  background: #ffffff14;
}
.share-btn.share-pi {
  background: #bd081c1a;
}
.share-btn.share-reddit {
  background: #ff45001a;
}
.share-btn.share-ln {
  background: #0a66c21a;
}
.share-btn.share-messenger {
  background: #0084ff1a;
}

.disclosure {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: var(--surface);
}
.disclosure > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.disclosure > summary::-webkit-details-marker {
  display: none;
}
.disclosure > summary::after {
  content: "+";
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.disclosure[open] > summary::after {
  content: "−";
}
.disclosure > :not(summary) {
  padding: 0 16px 14px;
}

.qr-wrap {
  text-align: center;
}
.qr-wrap img {
  display: block;
  margin: 10px auto 10px;
  width: 220px;
  height: 220px;
  max-width: 100%;
  background: var(--bg);
  border-radius: 12px;
  padding: 8px;
}
.embed-box {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  margin-bottom: 10px;
  box-sizing: border-box;
}

/* Footer */
.foot {
  margin-top: auto;
  padding: 24px 4px 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.foot p {
  margin: 2px 0;
}

/* Larger screens — keep single column, centered */
@media (min-width: 560px) {
  .app {
    padding-top: 28px;
  }
  .cover {
    width: 240px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
