* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111;
  font-family: Arial, "Helvetica Neue", sans-serif;
  color: #1a130e;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-app {
  width: 100%;
  height: 100%;
}

.loading,
.error-screen {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}

.screen {
  width: 1920px;
  height: 1080px;
  position: relative;
  transform-origin: center center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.95), transparent 30%),
    linear-gradient(180deg, #fffefa 0%, #fff7ea 100%);
}

/* ========= HEADER ========= */

.header {
  position: absolute;
  left: 30px;
  right: 30px;
  top: 14px;
  height: 100px;
  display: grid;
  grid-template-columns: 1fr 360px 1fr;
  align-items: center;
  gap: 16px;
}

.brand {
  text-align: center;
}

.brand-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 68px;
  line-height: 0.78;
  font-weight: 900;
  color: #35150b;
}

.brand-sub {
  margin-top: 8px;
  font-size: 18px;
  letter-spacing: 18px;
  font-weight: 800;
  color: #35150b;
}

.main-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: Impact, "Arial Black", Arial, sans-serif;
  font-size: 50px;
  line-height: 1;
  letter-spacing: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.main-title.hot {
  color: #6b240f;
}

.main-title.cold {
  color: #075da8;
  justify-content: flex-end;
}

.title-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: #fff7ef;
  border: 2px solid #ebc8af;
}

.main-title.cold .title-icon {
  background: #f1fbff;
  border-color: #b9e1ff;
}

/* ========= MAIN GRID ========= */

.content {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 122px;
  bottom: 50px;
  display: grid;
  grid-template-columns: 44% 56%;
  gap: 14px;
}

/* ========= LEFT ========= */

.left {
  display: grid;
  grid-template-columns: 54% 46%;
  grid-template-rows: 43% 32% 25%;
  gap: 14px;
}

.classic-block { grid-column: 1; grid-row: 1; }
.noncoffee-block { grid-column: 2; grid-row: 1; }
.author-block { grid-column: 1; grid-row: 2; }
.adds-block { grid-column: 2; grid-row: 2; }
.options-block { grid-column: 1 / 3; grid-row: 3; }

/* ========= RIGHT ========= */

.right {
  display: grid;
  grid-template-columns: 39% 61%;
  grid-template-rows: 31% 34% 35%;
  gap: 14px;
}

.new-block { grid-column: 1; grid-row: 1; }
.smoothie-block { grid-column: 2; grid-row: 1; }
.ice-block { grid-column: 1 / 3; grid-row: 2; }
.lemonade-block { grid-column: 1; grid-row: 3; }
.tea-block { grid-column: 2; grid-row: 3; }

/* ========= COMMON CARD ========= */

.panel {
  position: relative;
  background: rgba(255,255,255,0.95);
  border: 2px solid #e8c6ad;
  border-radius: 22px;
  box-shadow: 0 10px 26px rgba(70, 35, 15, 0.07);
  overflow: hidden;
}

.panel.blue {
  border-color: #9bd2fb;
  background: linear-gradient(180deg, #fbfeff 0%, #ffffff 100%);
}

.panel-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 6px 16px;
  padding: 7px 20px 9px;
  border-radius: 12px;
  font-family: Impact, "Arial Black", Arial, sans-serif;
  font-size: 35px;
  line-height: 0.9;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(180deg, #8b3414, #65210e);
}

.panel.blue .panel-head {
  background: linear-gradient(180deg, #0c73c6, #07599e);
}

.panel.green .panel-head {
  background: linear-gradient(180deg, #639944, #42772f);
}

.panel-head.small {
  font-size: 32px;
}

.panel-icon {
  font-size: 22px;
}

/* ========= HOT LISTS ========= */

.hot-list {
  padding: 0 14px 12px;
  display: grid;
  gap: 4px;
}

.hot-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  border-bottom: 1px solid rgba(110, 72, 39, 0.12);
}

.hot-name {
  font-size: 23px;
  line-height: 1.03;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hot-prices {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.price-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.price-chip .vol {
  padding: 2px 5px;
  border-radius: 5px;
  background: #fff1de;
  color: #7c2f12;
  font-size: 11px;
  font-weight: 900;
}

.price-chip .val {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  color: #111;
}

.classic-block .hot-row:first-child {
  background: #fff2e0;
  border-radius: 10px;
  padding: 6px 8px;
  min-height: 54px;
  margin-bottom: 4px;
}

.classic-block .hot-row:first-child .hot-name {
  font-size: 24px;
  white-space: normal;
}

.classic-block .hot-row:first-child .price-chip .val {
  font-size: 32px;
}

.noncoffee-block .hot-name,
.author-block .hot-name {
  font-size: 21px;
}

.noncoffee-block .price-chip .vol,
.author-block .price-chip .vol {
  display: none;
}

.noncoffee-block .price-chip .val,
.author-block .price-chip .val {
  font-size: 22px;
}

/* ========= ADDS ========= */

.adds-list {
  padding: 2px 20px 12px;
  display: grid;
  gap: 6px;
}

.adds-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px dotted rgba(104,62,36,.20);
  font-size: 23px;
  font-weight: 900;
}

.adds-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========= OPTIONS ========= */

.options-title {
  margin: 8px 0 0;
  text-align: center;
  font-family: Impact, "Arial Black", Arial, sans-serif;
  font-size: 26px;
  letter-spacing: 2px;
  color: #6b240f;
  text-transform: uppercase;
}

.options-grid {
  height: calc(100% - 42px);
  padding: 8px 14px 12px;
  display: grid;
  grid-template-columns: 18% 29% 31% 22%;
  gap: 10px;
}

.option-card {
  border: 1.5px solid #ead0bb;
  border-radius: 14px;
  background: #fffdf9;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.option-title {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 6px;
  text-align: center;
}

.option-simple {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 4px;
}

.option-simple .bean {
  font-size: 32px;
}

.option-simple .big {
  font-size: 30px;
  font-weight: 900;
}

.option-prices {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  text-align: center;
}

.option-prices > div {
  flex: 1;
}

.option-prices .small {
  font-size: 14px;
  font-weight: 800;
}

.option-prices .big {
  font-size: 24px;
  font-weight: 900;
}

.option-types {
  display: grid;
  gap: 4px;
  align-content: center;
  text-align: left;
  padding-left: 8px;
}

.option-types .option-title {
  text-align: left;
  margin-bottom: 4px;
}

.option-types div {
  font-size: 18px;
  font-weight: 800;
}

/* ========= COLD GRIDS ========= */

.cold-grid {
  height: calc(100% - 56px);
  padding: 0 12px 12px;
  display: grid;
  gap: 10px;
}

.new-block .cold-grid {
  grid-template-columns: repeat(3, 1fr);
}

.smoothie-block .cold-grid {
  grid-template-columns: repeat(4, 1fr);
}

.ice-block .cold-grid {
  grid-template-columns: repeat(5, 1fr);
}

.tea-block .cold-grid {
  grid-template-columns: repeat(4, 1fr);
}

.cold-card {
  position: relative;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,251,255,0.96));
  border: 1px solid rgba(7,93,168,0.14);
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto auto auto;
  justify-items: center;
  align-items: end;
  text-align: center;
  padding: 6px 6px 8px;
  animation: fadeUp 0.6s ease both;
}

.cold-card:nth-child(2) { animation-delay: .05s; }
.cold-card:nth-child(3) { animation-delay: .1s; }
.cold-card:nth-child(4) { animation-delay: .15s; }
.cold-card:nth-child(5) { animation-delay: .2s; }

.cold-image {
  width: 100%;
  height: 100%;
  min-height: 95px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
}

.cold-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 118%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 10px 10px rgba(0,0,0,0.14));
  animation: floatDrink 4.8s ease-in-out infinite;
}

.new-block .cold-image img {
  max-height: 190px;
}

.smoothie-block .cold-image img {
  max-height: 165px;
}

.ice-block .cold-image img {
  max-height: 176px;
}

.tea-block .cold-image img {
  max-height: 150px;
}

.cold-name {
  width: 100%;
  margin-top: 4px;
  font-family: Impact, "Arial Black", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #111;
  line-height: 0.92;
  font-size: 21px;
  min-height: 38px;
  display: grid;
  place-items: center;
}

.smoothie-block .cold-name {
  font-size: 18px;
  min-height: 34px;
}

.ice-block .cold-name {
  font-size: 18px;
  min-height: 34px;
}

.tea-block .cold-name {
  font-size: 16px;
  min-height: 32px;
}

.cold-desc {
  width: 100%;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 700;
  color: #2f241e;
  min-height: 28px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.ice-block .cold-desc,
.new-block .cold-desc {
  display: none;
}

.cold-prices {
  width: 100%;
  min-height: 36px;
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 6px;
}

.cold-price-single,
.cold-price-pair {
  display: inline-flex;
  align-items: end;
  gap: 5px;
}

.cold-price-pair {
  gap: 8px;
}

.cold-price-block {
  display: grid;
  gap: 2px;
  justify-items: center;
}

.cold-vol {
  padding: 3px 8px;
  border-radius: 7px;
  background: #075da8;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.cold-val {
  font-size: 31px;
  font-weight: 900;
  line-height: .9;
  color: #111;
}

.ice-block .cold-val {
  font-size: 27px;
}

.tea-block .cold-val {
  font-size: 23px;
}

/* ========= BADGE ========= */

.badge {
  position: absolute;
  top: 7px;
  left: 8px;
  z-index: 5;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f0272a;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  transform: rotate(-7deg);
  box-shadow: 0 6px 14px rgba(200,0,0,0.18);
  animation: pulseBadge 1.3s ease-in-out infinite;
}

/* ========= SOLD ========= */

.cold-card.sold,
.hot-row.sold,
.lem-row.sold {
  opacity: 0.45;
}

.sold-overlay {
  position: absolute;
  inset: 10px;
  display: none;
  place-items: center;
  background: rgba(255,255,255,0.68);
  border-radius: 14px;
  z-index: 6;
}

.cold-card.sold .sold-overlay {
  display: grid;
}

.sold-overlay span,
.hot-row.sold::after,
.lem-row.sold::after {
  background: #d71920;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  padding: 7px 12px;
  border-radius: 8px;
  transform: rotate(-6deg);
  box-shadow: 0 7px 18px rgba(120,0,0,0.18);
}

.hot-row.sold::after,
.lem-row.sold::after {
  content: "РАСПРОДАНО";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(-5deg);
  font-size: 13px;
  padding: 4px 8px;
}

/* ========= LEMONADE ========= */

.lem-grid {
  padding: 0 14px 12px;
  display: grid;
  gap: 6px;
}

.lem-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-bottom: 1px solid rgba(7,93,168,0.13);
}

.lem-name {
  font-size: 21px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lem-prices {
  display: flex;
  gap: 5px;
  white-space: nowrap;
}

.lem-prices .price-chip .val {
  font-size: 22px;
}

.lem-prices .price-chip .vol {
  font-size: 11px;
}

/* ========= FOOTER ========= */

.footer {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 8px;
  height: 32px;
  border: 1.5px solid #ecd4c1;
  border-radius: 14px;
  background: rgba(255,255,255,0.82);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  text-align: center;
  color: #6e301a;
  font-size: 18px;
  font-weight: 800;
}

/* ========= ANIMATIONS ========= */

@keyframes pulseBadge {
  0%, 100% {
    transform: rotate(-7deg) scale(1);
  }
  50% {
    transform: rotate(-7deg) scale(1.12);
  }
}

@keyframes floatDrink {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
