* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

body {
  margin: 0;
  background: #e7e0d2;
  color: #2b2b2b;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.65;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto -1px;
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 0;
  flex-wrap: wrap;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 14px;
  position: relative;
  z-index: 2;
}

.nav a {
  color: #5a2d2d;
  text-decoration: none;
  background: #ded7c9;
  border: 1px solid #b9aa91;
  border-bottom: 1px solid #b9aa91;
  padding: 7px 18px 6px;
  margin-right: 4px;
  border-radius: 4px 4px 0 0;
}

.nav a:hover {
  color: #7d1f1f;
  background: #e9e2d4;
  text-decoration: underline;
}

.nav a.active {
  color: #7d1f1f;
  background: #f4efe5;
  border-bottom: 1px solid #f4efe5;
  text-decoration: underline;
  position: relative;
  top: 1px;
}

.brand {
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand img {
  width: auto;
  height: 130px;
  max-width: 160px;
  display: block;
}

@media (min-width: 901px) {
  .brand img {
    height: 160px;
    max-width: 220px;
  }
}

@media (min-width: 901px) {
  .site-header {
    height: 165px;
  }
}

main {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  flex: 1;
}

.panel {
  background: #f4efe5;
  border: 1px solid #b9aa91;
  padding: 28px;
  margin: 0 0 24px;
}

.panel h1,
.panel h2,
.panel h3 {
  margin-top: 0;
  line-height: 1.2;
}

.panel h1 {
  font-size: clamp(30px, 5vw, 52px);
  letter-spacing: .03em;
  text-align: center;
  text-transform: uppercase;
}

.panel h1.cart-title {
  font-size: 40px;
}

.panel h2 { font-size: clamp(24px, 4vw, 36px); }
.panel h3 { font-size: 22px; }

.broadcast-frame {
  position: relative;
  background: #000;
  border: 1px solid #333;
  box-shadow: 0 0 0 4px #111;
  margin: 24px auto;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.broadcast-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video-frame {
  background: #000;
  border: 1px solid #333;
  box-shadow: 0 0 0 4px #111;
  margin: 24px auto;
  overflow: hidden;
}

.video-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

.promo-video-frame {
  position: relative;
}

.promo-play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.65);
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  padding-left: 7px;
}

.promo-play-button:hover {
  background: rgba(0,0,0,.72);
}

.promo-play-button.hidden {
  display: none;
}

@media (max-width: 600px) {
  .promo-play-button {
    display: none;
  }
}

.stream-overlay {
  position: absolute;
  left: 14px;
  top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Arial, Helvetica, sans-serif;
  z-index: 3;
}

.live-badge,
.stream-timer {
  background: rgba(0,0,0,.55);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  padding: 5px 9px;
  font-size: 14px;
  letter-spacing: .08em;
  text-shadow: 1px 1px 2px #000;
}

.live-badge span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #d40000;
  border-radius: 50%;
  margin-right: 6px;
}

.stream-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 4;
}

.volume-slider {
  width: 110px;
  accent-color: #111;
  cursor: pointer;
}

.fullscreen-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.cta-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.button {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  background: #6b3a3a;
  border: 1px solid #4b2525;
  padding: 12px 18px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 14px;
  transition: all .15s ease;
}

.button:hover {
  background: #8a4545;
  border-color: #5b2929;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
}

button,
.button,
.buy-button {
  cursor: pointer;
}

.button.secondary {
  background: #6b3a3a;
  border-color: #4b2525;
}

.button.secondary:hover {
  background: #8a4545;
  border-color: #5b2929;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
}

.service-content {
  display: flex;
  flex-direction: column;
}

.service-buttons {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.demo-button {
  background: #8a4545;
  border: 1px solid #5b2929;
  color: #fff;
}

.demo-button:hover {
  background: #a85b5b;
}

.service-content > .buy-button {
  margin-top: auto;
  align-self: flex-end;
}

.demo-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.demo-modal.active {
  display: flex;
}

.demo-modal-content {
  position: relative;
  width: min(900px, 92vw);
  aspect-ratio: 16 / 9;
  background: #111;
  border: 1px solid #b9aa91;
  box-shadow: 0 0 0 4px #111;
}

.demo-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.demo-close {
  position: absolute;
  right: -14px;
  top: -14px;
  width: 36px;
  height: 36px;
  border: 1px solid #4b2525;
  background: #6b3a3a;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.demo-close:hover {
  background: #8a4545;
  border-color: #5b2929;
}

@media (max-width: 760px) {
  .panel { padding: 20px; }
  .service-card { grid-template-columns: 1fr; }
  .losses-list { columns: 1; }

  .demo-close {
    right: 8px;
    top: 8px;
  }
}

.service-controls {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}

.quantity-input {
  width: 56px;
  padding: 7px;
  text-align: center;
}

.tabs {
  margin-top: 24px;
}

.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
}

.tab-buttons button {
  cursor: pointer;
  color: #5a2d2d;
  background: #ded7c9;
  border: 1px solid #b9aa91;
  border-bottom: 1px solid #b9aa91;
  padding: 7px 18px 6px;
  margin-right: 4px;
  border-radius: 4px 4px 0 0;
  font: inherit;
}

.tab-buttons button:hover {
  color: #7d1f1f;
  background: #e9e2d4;
  text-decoration: underline;
}

.tab-buttons button.active {
  color: #7d1f1f;
  background: #f4efe5;
  border-bottom: 1px solid #f4efe5;
  text-decoration: underline;
  position: relative;
  top: 1px;
}

.tab-panel {
  display: none;
  background: #f4efe5;
  border: 1px solid #b9aa91;
  padding: 22px;
}

.tab-panel.active {
  display: block;
}

.losses-list,
.top-list {
  columns: 2;
  column-gap: 36px;
  padding-left: 22px;
}

.top-list { columns: 1; }

.services-list {
  display: grid;
  gap: 22px;
  margin-bottom: 0px;
}

.sale-card {
  position: relative;
}

.sale-card {
  position: relative;
}

.sale-badge {
  position: absolute;
  top: 12px;
  left: 12px;

  background: #c62828;
  color: #fff;

  padding: 6px 12px;

  font-size: 12px;
  font-weight: bold;
  letter-spacing: .05em;

  text-transform: uppercase;

  z-index: 2;
}

.service-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  background: #efe6d6;
  border: 1px solid #b9aa91;
  padding: 0 18px 0 0;
}

.service-card img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: none;
  background: #000;
}

.service-content {
  display: flex;
  flex-direction: column;
  padding: 18px 0;
}

.service-card h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.25;
}

.service-number {
  color: #a6a6a6;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stream-controls {
  opacity: 1;
  transition: opacity .3s ease;
}

@media (max-width: 760px) {
  .panel { padding: 20px; }
  .service-card { grid-template-columns: 1fr; }
  .losses-list { columns: 1; }
}



.stream-controls.hidden {
  opacity: 0;
  pointer-events: none;
}

.floating-cart {
  position: fixed;
  right: 24px;
  bottom: 24px;

  width: 72px;
  height: 72px;

  background: #f4efe5;
  border: 1px solid #b9aa91;

  display: none;
  align-items: center;
  justify-content: center;

  text-decoration: none;

  box-shadow: 0 3px 10px rgba(0,0,0,.18);

  z-index: 100;
}

.floating-cart.visible {
  display: flex;
}

.floating-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(0,0,0,.28);
}

.floating-cart img {
  width: 42px;
  height: 42px;
  display: block;
}

#cartCount {
  position: absolute;

  top: -8px;
  right: -8px;

  min-width: 24px;
  height: 24px;

  padding: 0 6px;

  background: #8a4545;
  color: #fff;

  border-radius: 50%;

  font-size: 13px;
  font-weight: bold;

  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-items {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.cart-item {
  display: grid;
  grid-template-columns: 58px 1fr 40px 90px;
  align-items: center;
  gap: 14px;

  background: #efe6d6;
  border: 1px solid #b9aa91;
  padding: 7px 10px;
}

.cart-remove {
  width: 32px;
  height: 32px;
  padding: 0;

  border: none;
  background: transparent;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
}

.cart-remove img {
  width: 32px;
  height: 32px;
  display: block;
}

.cart-remove:hover {
  transform: translateY(-1px);
}

.cart-item > img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  display: block;
  background: #000;
}

.cart-item h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1;
}

.cart-item p {
  margin: 0;
  text-align: right;
  white-space: nowrap;
  justify-self: end;
}

.cart-item > div {
  display: flex;
  align-items: center;
  height: 100%;
}

.cart-total {
  margin-top: 18px;
  text-align: right;
  font-size: 20px;
  font-weight: bold;
}

.cart-actions {
  margin-top: 22px;
  text-align: right;
}

.hidden {
  display: none;
}

.buy-button.clicked {
  animation: buttonClick .28s ease;
}

@keyframes buttonClick {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(.96);
    background: #4f2424;
    box-shadow: inset 0 2px 5px rgba(0,0,0,.35);
  }

  100% {
    transform: scale(1);
  }
}

.site-footer {
  width: 100%;
  margin-top: 50px;

  padding: 10px 16px;

  text-align: center;

  background: #d2c8b6;
  border-top: 1px solid #b9aa91;

  color: #5a2d2d;
  font-size: 14px;
}

.site-footer div {
  margin: 1px 0;
}

.site-footer a {
  color: #5a2d2d;
  font-weight: bold;
  text-decoration: underline;
}

.site-footer a:hover {
  color: #7d1f1f;
}

.site-footer a:hover {
  color: #7d1f1f;
}

@media (max-width: 900px) {
  .tab-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0;
    scrollbar-width: none;
  }

  .tab-buttons::-webkit-scrollbar {
    display: none;
  }

  .tab-buttons button {
    flex: 0 0 auto;
  }
}

@media (max-width: 600px) {
  .service-card {
    padding: 0;
  }

  .service-card img {
    width: 100%;
  }

  .service-content {
    padding: 18px 18px 0;
  }

  .service-content > .buy-button,
  .service-buttons .buy-button {
    width: calc(100% + 36px);
    margin: 18px -18px 0;
    align-self: stretch;
    text-align: center;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .service-buttons {
    display: block;
    margin-top: auto;
  }

  .service-buttons .button:not(.buy-button) {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 18px auto 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    color: #6b3a3a;
    font-size: 16px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
  }

  .service-buttons .button:not(.buy-button)::before {
    content: "▶";
    font-size: 13px;
    line-height: 1;
  }

  .service-buttons .button:not(.buy-button):hover {
    background: transparent;
    box-shadow: none;
    text-decoration: underline;
    color: #8a4545;
  }

  .service-buttons .buy-button {
    margin-top: 26px;
  }

  .service-controls {
    display: block;
  }

  .service-controls label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
  }

  .service-controls .quantity-input {
    flex: 0 0 56px;
  }

  .service-controls .buy-button {
    width: calc(100% + 36px);
    margin: 0 -18px 0;
    display: block;
    text-align: center;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
}

@media (max-width: 360px) {
  main {
    width: calc(100% - 16px);
  }

  .panel {
    padding: 14px;
  }

  .tab-panel {
    padding: 12px;
  }

  .service-card h2 {
    font-size: 22px;
  }

  .floating-cart {
    right: 12px;
    bottom: 18px;
    width: 62px;
    height: 62px;
  }

  .floating-cart img {
    width: 36px;
    height: 36px;
  }
}

.nav {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  flex: 0 0 auto;
}

@media (max-width: 600px) {
  .cart-item {
    grid-template-columns: 48px 1fr 32px;
    gap: 10px;
  }

  .cart-item > img {
    width: 48px;
    height: 48px;
  }

  .cart-item h2 {
    font-size: 16px;
    line-height: 1.1;
  }

  .cart-item p {
    grid-column: 2 / 4;
    justify-self: end;
    font-size: 15px;
  }

  .cart-remove {
    width: 28px;
    height: 28px;
  }

  .cart-remove img {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 360px) {
  main,
  .nav {
    width: calc(100% - 16px);
  }

  .panel {
    padding: 12px;
  }

  .cart-item {
    grid-template-columns: 44px 1fr 28px;
    padding: 7px;
    gap: 8px;
  }

  .cart-item > img {
    width: 44px;
    height: 44px;
  }

  .cart-item h2 {
    font-size: 15px;
  }

  .cart-total {
    font-size: 18px;
  }
}

.top-form {
  margin-top: 26px;
}

.top-form-note {
  margin-bottom: 18px;
}

.top-form label {
  display: block;
  margin-bottom: 8px;
}

#topNickname {
  display: block;
  width: min(360px, 100%);
  height: 42px;
  padding: 8px 10px;
  margin-bottom: 14px;
  font-size: 16px;
}

#saveTopButton {
  display: inline-block;
  min-width: 160px;
}

@media (orientation: landscape) and (max-height: 520px) {
  .broadcast-frame,
  .video-frame,
  .demo-modal-content {
    max-height: calc(100vh - 24px);
    width: auto;
    aspect-ratio: 16 / 9;
  }

  .broadcast-frame video,
  .video-frame video,
  .demo-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .demo-modal {
    padding: 12px;
  }

  .demo-close {
    right: 8px;
    top: 8px;
  }
}