:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  --brand: #ee4023;
  --brand-dark: #5a1309;
  --ink: #fff7f3;
  --muted: #ffd2c5;
  --paper: #fffaf5;
  --shadow: rgba(26, 10, 4, .28);
  --reader-zoom: 1;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 300px;
  min-height: 80px;
  margin: 0;
  background: transparent;
}

body:not(.magazine-page) {
  width: 300px;
  height: 80px;
  overflow: hidden;
}

body.magazine-page {
  color-scheme: dark;
  min-height: 100vh;
  overflow: hidden;
  background: #050505;
}

.wc-widget {
  position: relative;
  width: 300px;
  height: 80px;
  overflow: hidden;
  padding: 5px 6px 4px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 15%, rgba(255, 255, 255, .22), transparent 24px),
    linear-gradient(135deg, #1b0603 0%, var(--brand-dark) 43%, var(--brand) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 18px rgba(78, 16, 6, .28);
}

.wc-widget::after {
  position: absolute;
  inset: auto -18px -42px auto;
  width: 112px;
  height: 112px;
  content: "";
  background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 62%);
  pointer-events: none;
}

.wc-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 17px;
  margin-top: 3px;
}

.wc-nav {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(0, 0, 0, .2);
  backdrop-filter: blur(8px);
}

.wc-nav button {
  height: 13px;
  min-width: 35px;
  padding: 0 5px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  line-height: 13px;
  cursor: pointer;
}

.wc-nav button.active {
  color: #711908;
  background: #fff5f0;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}

.wc-match {
  position: relative;
  z-index: 1;
  height: 51px;
  padding: 4px 5px 3px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(0, 0, 0, .14));
}

.wc-loading,
.wc-empty {
  display: grid;
  place-items: center;
  height: 43px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.wc-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
  align-items: center;
  height: 29px;
  gap: 5px;
}

.wc-team {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
}

.wc-team.away {
  justify-content: flex-end;
  text-align: right;
}

.wc-team-name {
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1px;
  line-height: 1;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .42);
  white-space: nowrap;
}

.wc-flag {
  width: 24px;
  height: 17px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 3px;
  background: rgba(255, 255, 255, .16);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .45), 0 2px 5px rgba(0, 0, 0, .24);
}

.wc-score {
  min-width: 54px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  color: #fff;
  background: rgba(0, 0, 0, .24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 20px;
  text-align: center;
}

.wc-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  height: 15px;
  overflow: hidden;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.wc-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wc-meta span:last-child {
  text-align: right;
}

.wc-live,
.wc-next-live {
  justify-self: center;
  padding: 1px 5px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.wc-live {
  background: rgba(255, 255, 255, .18);
}

.wc-next-live {
  background: rgba(255, 255, 255, .2);
  animation: wcBlink 1s steps(2, start) infinite;
}

.mag-banner {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  width: 300px;
  height: 80px;
  overflow: hidden;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, .24), transparent 24px),
    linear-gradient(90deg, rgba(255, 255, 255, .11) 0 1px, transparent 1px 100%),
    linear-gradient(135deg, #1b0603 0%, var(--brand-dark) 43%, var(--brand) 100%);
  background-size: auto, 14px 100%, auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
  opacity: 1;
  text-decoration: none;
  text-align: left;
  transition: opacity .24s ease, transform .24s ease;
}

.mag-banner[hidden] {
  display: grid;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.mag-banner::after {
  position: absolute;
  inset: 0 0 0 auto;
  width: 86px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2));
  pointer-events: none;
}

.mag-banner:focus-visible {
  outline: 3px solid #fff6e6;
  outline-offset: -4px;
}

.mag-cover {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 60px;
  border-radius: 4px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .7), transparent 25%),
    linear-gradient(180deg, #ffffff 0%, #ffe6dd 45%, #d82014 46%, #711908 100%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .3), inset 5px 0 0 rgba(0, 0, 0, .13);
  transform: rotate(-4deg);
}

.mag-cover::before,
.mag-cover::after {
  position: absolute;
  right: 8px;
  left: 9px;
  height: 3px;
  content: "";
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
}

.mag-cover::before {
  top: 34px;
}

.mag-cover::after {
  top: 42px;
  width: 18px;
}

.mag-copy {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  gap: 2px;
}

.mag-kicker,
.mag-action {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.mag-title {
  overflow: hidden;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .42);
  white-space: nowrap;
}

.mag-action {
  justify-self: start;
  margin-top: 3px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #711908;
  background: #fff5f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}

.reader-page {
  position: relative;
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #050505;
}

.reader-toolbar {
  position: absolute;
  right: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 24;
  transform: translateX(50%);
  display: grid;
  grid-template-columns: 40px 40px 40px minmax(150px, auto) 40px 40px 58px 40px 40px;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 7px;
  color: #fff4f1;
  background:
    radial-gradient(circle at 8% 15%, rgba(255, 255, 255, .22), transparent 24px),
    linear-gradient(135deg, #1b0603 0%, var(--brand-dark) 43%, var(--brand) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 30px rgba(0, 0, 0, .52);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.reader-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(0, 0, 0, .18);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
}

.reader-icon:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .14);
}

.reader-icon:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.reader-home {
  font-size: 22px;
}

.reader-status {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 10px;
  overflow: hidden;
  color: #fff4f1;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.page-jump input {
  width: 54px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 6px;
  color: #fff;
  background: rgba(0, 0, 0, .24);
  font: inherit;
  font-weight: 800;
  text-align: center;
}

.zoom-status {
  display: grid;
  place-items: center;
  height: 36px;
  min-width: 54px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(0, 0, 0, .22);
  font-size: 12px;
  font-weight: 800;
}

.reader-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: auto;
  padding: 20px 30px 92px;
  background:
    radial-gradient(circle at 50% 18%, rgba(238, 64, 35, .2), transparent 34%),
    linear-gradient(135deg, rgba(238, 64, 35, .13), transparent 28%),
    #050505;
}

.page-sidebar {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 14;
  width: min(286px, 84vw);
  padding: 12px 10px;
  border-right: 1px solid rgba(238, 64, 35, .28);
  background: rgba(8, 8, 10, .98);
  box-shadow: 16px 0 38px rgba(0, 0, 0, .55);
  transform: translateX(-104%);
  transition: transform .22s ease;
}

.page-sidebar.open {
  transform: translateX(0);
}

.page-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  margin-bottom: 10px;
}

.page-sidebar-title {
  color: #fff4f1;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
}

.page-sidebar-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  color: #f4bbb0;
  background: transparent;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.page-list {
  display: grid;
  grid-template-columns: 1fr;
  max-height: calc(100vh - 64px);
  overflow: auto;
  gap: 18px;
  padding: 2px 10px 22px;
}

.page-list-button {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 0;
  color: #f4bbb0;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  padding: 0;
}

.page-list-button.active {
  color: #fff;
  background: transparent;
}

.page-thumb {
  display: grid;
  place-items: center;
  width: 116px;
  min-height: 150px;
  border: 4px solid transparent;
  background: #111;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .5);
}

.page-list-button.active .page-thumb {
  border-color: #ee4023;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 8px 24px rgba(238, 64, 35, .32);
}

.page-thumb img,
.page-thumb canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.flipbook-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: min(calc(100vw - 72px), 1180px);
  height: min(calc(100vh - 132px), 760px);
  margin: auto;
  filter: drop-shadow(0 24px 36px rgba(0, 0, 0, .58));
  transform: scale(var(--reader-zoom));
  transform-origin: center center;
  transition: transform .18s ease;
}

.reader-stage.zoomed {
  place-items: start center;
  padding: 34px;
}

.flipbook {
  width: 100%;
  height: 100%;
}

.cover-single {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.cover-single img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 24px 42px rgba(0, 0, 0, .6), 0 0 0 1px rgba(238, 64, 35, .22);
}

.flip-page {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(238, 64, 35, .2);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .12), transparent 7%, transparent 93%, rgba(0, 0, 0, .12)),
    var(--paper);
  box-shadow: inset 0 0 0 8px rgba(10, 10, 10, .86), inset 0 0 0 10px rgba(238, 64, 35, .22), inset 0 0 18px rgba(0, 0, 0, .18);
}

.flip-page img,
.flip-page canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.flip-page-loading {
  color: #ee4023;
  font-size: 13px;
  font-weight: 800;
}

.reader-hotzone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 8;
  width: 20%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.reader-hotzone-prev {
  left: 0;
}

.reader-hotzone-next {
  right: 0;
}

.reader-hotzone:focus-visible {
  outline: 2px solid rgba(238, 64, 35, .9);
  outline-offset: -4px;
}

.reader-message {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: none;
  padding: 10px 12px;
  border-radius: 8px;
  color: #fff4f1;
  background: rgba(12, 12, 14, .94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .54), 0 0 0 1px rgba(238, 64, 35, .28);
  font-size: 13px;
  line-height: 1;
  text-align: center;
}

.reader-exit {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 25;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff4f1;
  text-decoration: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8), 0 0 14px rgba(238, 64, 35, .45);
  font-size: 42px;
  line-height: 1;
}

.reader-message.show {
  display: block;
}

@keyframes wcBlink {
  50% {
    opacity: .28;
  }
}

@media (max-width: 720px) {
  .reader-toolbar {
    bottom: max(8px, env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: calc(100vw - 16px);
    max-width: 430px;
    gap: 4px;
    padding: 5px;
  }

  .reader-icon {
    width: 100%;
    height: 34px;
    font-size: 22px;
  }

  .reader-status {
    grid-column: span 2;
    min-width: 0;
  }

  .flipbook-wrap {
    width: min(calc(100vw - 28px), 430px);
    height: min(calc(100vh - 140px), 610px);
    height: min(calc(100dvh - 140px), 610px);
  }

  .reader-stage {
    padding: 14px 14px 118px;
  }

  .reader-status {
    font-size: 11px;
    gap: 5px;
  }

  .page-jump span {
    display: none;
  }

  .page-jump input {
    width: 40px;
    height: 26px;
  }

  .zoom-status {
    height: 34px;
    min-width: 0;
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .reader-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .reader-status {
    grid-column: span 2;
  }

  .flipbook-wrap {
    width: min(calc(100vw - 18px), 360px);
    height: min(calc(100vh - 164px), 560px);
    height: min(calc(100dvh - 164px), 560px);
  }

  .reader-stage {
    padding: 10px 9px 146px;
  }
}

@media print {
  body {
    display: none;
  }
}
