:root {
  --nb-surface: rgba(19, 27, 52, 0.72);
  --nb-surface-border: rgba(202, 222, 255, 0.2);
  --nb-text-soft: #c8d7f6;
  --nb-focus-ring: 0 0 0 0.2rem rgba(91, 140, 255, 0.3);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(circle at 10% 10%, rgba(88, 101, 242, 0.3), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(32, 201, 151, 0.2), transparent 35%),
    #0b1020;
  position: relative;
  overflow-x: hidden;
}

.card {
  border: 1px solid var(--nb-surface-border);
  background: var(--nb-surface);
  backdrop-filter: blur(4px);
  transition: transform 0.18s ease, box-shadow 0.22s ease;
}

.app-topbar {
  border: 1px solid var(--nb-surface-border);
  border-radius: 0.9rem;
  padding: 0.7rem 0.8rem;
  background: linear-gradient(180deg, rgba(20, 29, 56, 0.68), rgba(20, 29, 56, 0.4));
}

.connection-pill {
  font-size: 0.74rem;
  line-height: 1;
  border-radius: 999px;
  padding: 0.34rem 0.55rem;
  border: 1px solid rgba(211, 226, 255, 0.35);
  color: var(--nb-text-soft);
}

.connection-pill.is-online {
  color: #b5ffe4;
  border-color: rgba(68, 225, 167, 0.65);
  background: rgba(29, 168, 126, 0.18);
}

.connection-pill.is-offline {
  color: #ffd3d3;
  border-color: rgba(255, 127, 127, 0.62);
  background: rgba(220, 53, 69, 0.2);
}

.connection-pill.is-pending {
  color: #d4e0ff;
  border-color: rgba(171, 194, 255, 0.45);
  background: rgba(13, 110, 253, 0.14);
}

.order-card-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.order-card-item.order-card-ready {
  opacity: 0.5;
}

.order-card-enter {
  animation: order-enter 240ms ease-out both;
}

@keyframes order-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.order-empty-card {
  border-style: dashed;
}

.nb-skeleton-row {
  height: 56px;
  border-radius: 0.7rem;
  border: 1px solid rgba(187, 210, 255, 0.22);
  background: linear-gradient(
    90deg,
    rgba(33, 48, 84, 0.45) 0%,
    rgba(75, 104, 163, 0.5) 50%,
    rgba(33, 48, 84, 0.45) 100%
  );
  background-size: 220% 100%;
  animation: nb-skeleton-wave 1.2s ease-in-out infinite;
}

@keyframes nb-skeleton-wave {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.btn {
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  filter: brightness(1.03);
}

.btn:active {
  transform: translateY(1px);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--nb-focus-ring);
}

.stat-box {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.8;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.order-image {
  max-height: 140px;
  object-fit: cover;
}

.player-screen {
  min-height: calc(100vh - 3rem);
  min-height: calc(100dvh - 3rem);
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.player-dialog-card {
  width: 100%;
  max-width: 860px;
  height: 75vh;
  height: 75dvh;
  max-height: calc(100dvh - 2rem);
  background: rgba(14, 19, 35, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  color: #eef3ff;
  overflow: hidden;
}

.player-dialog-card .card-body,
#playerStageContent {
  height: 100%;
  min-height: 0;
}

.event-player-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.event-player-bg::before,
.event-player-bg::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(42px);
}

.event-player-bg::before {
  width: 320px;
  height: 320px;
  left: -40px;
  top: 20%;
  background: rgba(111, 66, 193, 0.3);
}

.event-player-bg::after {
  width: 360px;
  height: 360px;
  right: -60px;
  bottom: 10%;
  background: rgba(13, 202, 240, 0.22);
}

.player-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.player-panel-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.player-panel-subtitle {
  font-size: 0.9rem;
  color: #d6def6;
  opacity: 1;
}

.neuro-status {
  font-size: 0.85rem;
  color: #c9d4ff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.neuro-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #20c997;
  box-shadow: 0 0 8px #20c997;
}

.player-stage-content {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.player-stage-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(206, 223, 255, 0.34);
  background: rgba(12, 20, 44, 0.62);
  color: #eef5ff;
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
}

.player-stage-close-btn:hover {
  background: rgba(20, 33, 68, 0.78);
  border-color: rgba(223, 236, 255, 0.5);
}

.start-stage {
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
}

.player-waiting-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 1.5rem;
  min-height: 75vh;
  min-height: 75dvh;
  max-height: 100dvh;
}

.player-waiting-screen:focus {
  outline: none;
}

.player-waiting-screen:focus-visible {
  box-shadow: var(--nb-focus-ring);
}

.player-waiting-smiley-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e8f0ff;
  filter: drop-shadow(0 8px 24px rgba(80, 120, 255, 0.35));
}

.player-waiting-smiley {
  width: clamp(120px, 28vw, 220px);
  height: clamp(120px, 28vw, 220px);
}

/* Подмигивание: правый глаз смайлика */
.player-waiting-eye-wink {
  transform-origin: 50% 50%;
  animation: player-wink 2.4s ease-in-out infinite;
}

@keyframes player-wink {
  0%, 45%, 55%, 100% {
    transform: scaleY(1);
    opacity: 0.9;
  }
  48%, 52% {
    transform: scaleY(0.08);
    opacity: 0.9;
  }
}

/* Подсказка «Нажми на экран» */
.player-waiting-hint {
  margin: 1rem 0 0;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  color: rgba(232, 240, 255, 0.85);
  animation: player-hint-pulse 2s ease-in-out infinite;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes player-hint-pulse {
  0%, 100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}

.start-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: fit-content;
  max-width: min(88vw, 720px);
  padding: 0.45rem;
  border-radius: 20px;
  border: 1px solid rgba(183, 208, 255, 0.3);
  background: linear-gradient(165deg, rgba(16, 28, 58, 0.72), rgba(10, 20, 46, 0.58));
  box-shadow: 0 14px 34px rgba(6, 12, 28, 0.36), 0 0 0 1px rgba(195, 214, 255, 0.08) inset;
  overflow: hidden;
}

.start-logo-wrap.has-image {
  padding: 0.22rem;
  border: 1px solid rgba(183, 208, 255, 0.22);
  background: rgba(10, 20, 46, 0.32);
  box-shadow: 0 8px 24px rgba(6, 12, 28, 0.26);
  border-radius: 20px;
  overflow: hidden;
}

.start-logo-text {
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f2f6ff;
  text-shadow: 0 8px 32px rgba(91, 140, 255, 0.28);
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
}

.start-logo-image {
  display: block;
  width: min(82vw, 500px);
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
  border-radius: 16px;
}

.start-logo-wrap.has-image .start-logo-image {
  width: auto;
  max-width: min(82vw, 500px);
  height: auto;
}

.start-btn {
  min-width: 220px;
  padding: 0.75rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.scenario-mode-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  max-width: min(760px, 100%);
}

.scenario-mode-btn {
  border-color: rgba(186, 209, 255, 0.5);
}

.scenario-mode-btn.active {
  color: #fff;
  border-color: rgba(135, 183, 255, 0.88);
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.32), rgba(124, 77, 255, 0.32));
}

.start-quick-btn {
  min-width: 220px;
}

.start-welcome-row {
  width: min(680px, 100%);
}

.player-chat-feed {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 0.35rem;
  padding-bottom: 0.35rem;
  scrollbar-width: none;
  scrollbar-color: rgba(91, 140, 255, 0.85) rgba(255, 255, 255, 0.08);
}

.player-chat-feed::-webkit-scrollbar {
  width: 0;
}

.player-chat-feed::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.player-chat-feed::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, #20c997, #5b8cff, #7c4dff);
  border: 2px solid rgba(10, 15, 32, 0.75);
}

.player-chat-feed::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #2ad4ae, #6a9bff, #8b66ff);
}

.player-chat-feed.is-scrolling {
  scrollbar-width: thin;
}

.player-chat-feed.is-scrolling::-webkit-scrollbar {
  width: 10px;
}

.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(111, 66, 193, 0.4);
  color: #f7ecff;
  flex-shrink: 0;
}

.chat-avatar.user {
  background: rgba(13, 110, 253, 0.45);
  color: #dff0ff;
}

.chat-bubble {
  max-width: 78%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 0.85rem;
  padding: 0.65rem 0.8rem;
  line-height: 1.4;
  color: #f7f9ff;
}

.chat-row.user .chat-bubble {
  background: rgba(13, 110, 253, 0.32);
  border-color: rgba(141, 188, 255, 0.48);
  color: #f2f7ff;
}

.chat-bubble-current {
  box-shadow: 0 0 0 1px rgba(32, 201, 151, 0.35) inset;
}

.typing-active::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: rgba(255, 255, 255, 0.75);
  animation: blink-caret 0.9s step-end infinite;
}

@keyframes blink-caret {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

.player-dialog-input {
  margin-top: auto;
  padding-top: 0.7rem;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, rgba(14, 19, 35, 0.96), rgba(14, 19, 35, 0.82) 70%, transparent);
  backdrop-filter: blur(4px);
  z-index: 2;
}

.step-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.step-progress-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.step-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #20c997, #5b8cff, #7c4dff);
  transition: width 0.25s ease;
}

.step-progress-percent {
  min-width: 42px;
  text-align: right;
  font-size: 0.82rem;
  color: #d3ddf7;
}

.player-input {
  background: rgba(7, 11, 24, 0.72);
  border: 1px solid rgba(204, 221, 255, 0.42);
  color: #fff;
}

.player-input:focus {
  background: rgba(10, 15, 32, 0.85);
  color: #fff;
  border-color: rgba(120, 170, 255, 0.85);
  box-shadow: 0 0 0 0.2rem rgba(91, 140, 255, 0.25);
}

.player-input::placeholder {
  color: #c6d3f3;
  opacity: 1;
}

.player-next-btn {
  background: linear-gradient(90deg, #5b8cff, #7c4dff);
  border: none;
}

.message-composer {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(184, 207, 255, 0.32);
}

.message-composer .player-input {
  border-radius: 999px;
  border: none;
  background: rgba(7, 11, 24, 0.35);
  box-shadow: none;
}

.composer-send-btn {
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(135deg, #20c997, #5b8cff);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
}

.composer-send-btn:disabled {
  opacity: 0.6;
}

.loader-stage {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.loader-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.loader-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #20c997;
  animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

.order-stage {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  overflow: auto;
  scrollbar-width: thin;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  padding-right: 0.25rem;
}

.order-result-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: auto;
  max-height: none;
  border-radius: 1.1rem;
  padding: 0.9rem;
  background: linear-gradient(165deg, rgba(91, 140, 255, 0.2), rgba(32, 201, 151, 0.1));
  border: 1px solid rgba(185, 213, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 14px 28px rgba(5, 10, 22, 0.28);
  overflow: visible;
  max-width: 100%;
  margin-top: auto;
  margin-bottom: auto;
}

.order-result-card-enter {
  animation: order-card-enter 280ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes order-card-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
    filter: saturate(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
}

.order-premium-glow {
  position: absolute;
  inset: -30% auto auto -10%;
  width: 60%;
  height: 55%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(123, 217, 255, 0.22), transparent 68%);
  filter: blur(2px);
  z-index: 0;
}

.order-result-card > * {
  position: relative;
  z-index: 1;
}

.order-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.order-hero {
  border-radius: 0.95rem;
  padding: 0.35rem 0.35rem 0.15rem;
}

.order-hero.has-cover {
  background-image: linear-gradient(90deg, rgba(10, 16, 32, 0.82) 0%, rgba(10, 16, 32, 0.58) 58%, rgba(10, 16, 32, 0.42) 100%),
    var(--order-cover-url);
  background-repeat: no-repeat;
  background-position: left top, right 10px center;
  background-size: auto, clamp(120px, 22vw, 220px) auto;
  border: 1px solid rgba(192, 214, 255, 0.22);
}

.order-badge {
  display: inline-block;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  background: rgba(32, 201, 151, 0.2);
  border: 1px solid rgba(110, 228, 201, 0.55);
  color: #9af2de;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.order-chip {
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: #dbebff;
  border: 1px solid rgba(173, 197, 255, 0.44);
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.25), rgba(124, 77, 255, 0.25));
}

.order-title-wrap {
  margin-bottom: 0.35rem;
}

.order-title-kicker {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b3caf5;
  margin-bottom: 0.22rem;
}

.order-title {
  margin-bottom: 0.45rem;
  font-size: clamp(1.45rem, 3.3vw, 1.95rem);
  font-weight: 800;
  line-height: 1.18;
  color: #f7fbff;
}

.order-lead {
  margin: 0 0 0.55rem;
  color: #d9e8ff;
  font-size: 0.9rem;
}

.order-layout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 0.6rem;
}

.order-body-scroll {
  min-height: 92px;
  flex: 0 1 auto;
  max-height: none;
  overflow: visible;
  padding-right: 0.12rem;
  padding-bottom: 0.45rem;
}

.order-media {
  min-width: 0;
  display: none;
}

.order-cover {
  width: 100%;
  height: clamp(90px, 15vh, 145px);
  object-fit: cover;
  border-radius: 1rem;
  border: 1px solid rgba(211, 229, 255, 0.36);
  background: rgba(8, 12, 26, 0.7);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.order-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.order-cover-emoji {
  font-size: 2.2rem;
}

.order-cover-text {
  font-size: 0.9rem;
  text-align: center;
  color: #cde0ff;
  padding: 0 0.5rem;
}

.order-story-card {
  border-radius: 0.9rem;
  border: 1px solid rgba(198, 218, 255, 0.3);
  background: linear-gradient(180deg, rgba(12, 18, 38, 0.7), rgba(12, 18, 38, 0.54));
  padding: 0.65rem 0.8rem;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.order-story-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #bfd3ff;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.order-description {
  color: #f3f8ff;
  line-height: 1.4;
  font-size: 0.94rem;
}

.order-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.order-footer {
  flex-shrink: 0;
  position: static;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(202, 220, 255, 0.18);
  background: linear-gradient(to top, rgba(7, 12, 24, 0.42), rgba(7, 12, 24, 0));
}

.order-actions .player-next-btn {
  min-width: 210px;
  padding: 0.68rem 1.2rem;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(204, 225, 255, 0.18) inset;
  background: linear-gradient(90deg, #6a96ff, #875dff);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.order-actions .player-next-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.33), 0 0 0 1px rgba(225, 238, 255, 0.24) inset;
}

.player-reroll-btn {
  border-radius: 999px;
}

.order-qr {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.75rem;
  border: 1px solid rgba(190, 214, 255, 0.28);
  border-radius: 0.85rem;
  background: rgba(11, 16, 33, 0.4);
  padding: 0.55rem 0.65rem;
  overflow-x: auto;
}

.order-qr-text {
  line-height: 1.3;
}

.order-qr-order-number {
  font-weight: 700;
  color: #e8f2ff;
  margin-bottom: 0.2rem;
}

.order-qr-image {
  width: 92px;
  height: 92px;
  border-radius: 0.5rem;
  border: 1px solid rgba(197, 220, 255, 0.35);
  background: #fff;
}

.reset-progress-wrap {
  width: 100%;
}

.reset-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.reset-progress-bar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #20c997, #5b8cff);
  transition: width 0.1s linear, background 0.25s ease;
}

.reset-progress-bar.danger {
  background: linear-gradient(90deg, #ff7b7b, #dc3545);
}

@media (max-width: 860px) {
  .order-layout {
    grid-template-columns: 1fr;
  }

  .order-cover {
    height: clamp(140px, 24vh, 180px);
  }

  .order-story-card {
    min-height: 0;
    overflow: hidden;
  }
}

@media (max-height: 900px) {
  .order-result-card {
    padding: 0.75rem;
  }

  .order-result-top {
    margin-bottom: 0.35rem;
  }

  .order-title {
    font-size: clamp(1.2rem, 2.8vw, 1.65rem);
    margin-bottom: 0.3rem;
  }

  .order-lead {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
  }

  .order-layout {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .order-cover {
    height: clamp(100px, 16vh, 150px);
  }

  .order-story-card {
    overflow: hidden;
    padding: 0.65rem 0.75rem;
  }

  .order-description {
    font-size: 0.93rem;
    line-height: 1.4;
  }

  .order-actions .player-next-btn {
    min-width: 180px;
    padding: 0.68rem 1.1rem;
  }

  .order-qr-image {
    width: 72px;
    height: 72px;
  }
}

@media (max-height: 760px) {
  .order-layout {
    grid-template-columns: 1fr;
  }

  .order-cover {
    height: 118px;
  }

  .order-body-scroll {
    min-height: 70px;
    max-height: none;
  }

  .order-story-card {
    min-height: 0;
    overflow: hidden;
  }

  .order-chip {
    display: none;
  }

  .order-footer {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
  }
}

.player-screen .text-muted {
  color: #c1cde9 !important;
}

body.operator-mode .player-dialog-card {
  max-width: 980px;
  height: 82vh;
  height: 82dvh;
  max-height: calc(100dvh - 2rem);
}

body.operator-mode .start-btn,
body.operator-mode .start-quick-btn {
  min-width: 260px;
  padding: 0.9rem 1.4rem;
  font-size: 1.12rem;
}

body.operator-mode .scenario-mode-btn {
  padding: 0.45rem 0.7rem;
  font-size: 0.92rem;
}

body.operator-mode .chat-bubble {
  font-size: 1.04rem;
}

body.operator-mode .player-input {
  font-size: 1.08rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.stats-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6ea8fe, #0d6efd);
}

.stats-bar-fill-accent {
  background: linear-gradient(90deg, #8ad2c5, #20c997);
}

body.mood-meter-page {
  margin: 0;
  overflow: hidden;
}

.mood-meter-root {
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 15% 15%, rgba(106, 150, 255, 0.22), transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(48, 214, 184, 0.14), transparent 34%), #070d1d;
}

.mood-meter-loading {
  height: 100%;
  display: grid;
  gap: 0.8rem;
  padding: 1.2rem;
  align-content: center;
}

.mood-meter-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d6e2ff;
  font-size: clamp(1.2rem, 3.2vw, 2.4rem);
  letter-spacing: 0.02em;
}

.mood-chart-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.mood-chart-svg {
  width: 100%;
  height: 100%;
}

.mood-chart-grid {
  stroke: rgba(196, 214, 255, 0.16);
  stroke-width: 1;
}

.mood-chart-axis {
  stroke: rgba(220, 233, 255, 0.42);
  stroke-width: 1.2;
}

.mood-chart-tick {
  fill: #cfdfff;
  font-size: 11px;
}

.mood-chart-legend {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(187, 207, 255, 0.35);
  background: rgba(13, 22, 48, 0.62);
  backdrop-filter: blur(6px);
}

.mood-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e7efff;
  font-size: 13px;
}

.mood-chart-legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.mood-cloud-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 1.4rem;
}

.mood-cloud-wrap.is-wide {
  padding: 1.2rem 2.4rem;
}

.mood-cloud-wrap.is-classic {
  padding: 1.2rem 1.2rem;
}

.mood-cloud-tag {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  color: #f2f6ff;
  line-height: 1;
  text-shadow: 0 3px 16px rgba(91, 140, 255, 0.38);
  letter-spacing: 0.012em;
  user-select: none;
  transition: opacity 1.6s linear;
}

.mood-cloud-tag.mood-cloud-tag-enter {
  animation: mood-cloud-enter 420ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes mood-cloud-enter {
  from {
    opacity: 0;
    filter: blur(2px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

.mood-cloud-center-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: clamp(180px, 24vw, 320px);
  min-height: clamp(88px, 14vh, 170px);
  max-width: 42vw;
  padding: clamp(0.7rem, 1.8vw, 1.15rem) clamp(1.1rem, 2.3vw, 1.7rem);
  border-radius: 18px;
  border: 1px solid rgba(160, 193, 255, 0.3);
  background: linear-gradient(160deg, rgba(20, 31, 63, 0.74), rgba(8, 17, 42, 0.62));
  box-shadow: 0 18px 54px rgba(8, 15, 36, 0.55), 0 0 0 1px rgba(195, 214, 255, 0.08) inset;
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.mood-cloud-center-logo.has-image {
  min-width: 0;
  min-height: 0;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  border-radius: 20px;
  overflow: hidden;
}

.mood-cloud-wrap.is-wide .mood-cloud-center-logo {
  min-width: clamp(210px, 26vw, 360px);
  min-height: clamp(92px, 15vh, 178px);
}

.mood-cloud-wrap.is-classic .mood-cloud-center-logo {
  min-width: clamp(170px, 22vw, 290px);
  min-height: clamp(80px, 12.5vh, 146px);
}

.mood-cloud-logo-img {
  display: block;
  max-width: min(38vw, 320px);
  max-height: min(22vh, 220px);
  object-fit: contain;
  filter: drop-shadow(0 5px 16px rgba(64, 132, 255, 0.4));
  border-radius: 20px;
}

.mood-cloud-logo-text {
  color: #f3f7ff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(1.2rem, 2.7vw, 2.2rem);
  text-shadow: 0 5px 20px rgba(82, 130, 255, 0.44);
}

@media (max-width: 1024px) {
  .mood-cloud-center-logo {
    min-width: clamp(150px, 34vw, 250px);
    min-height: clamp(70px, 14vh, 128px);
    border-radius: 14px;
  }

  .mood-cloud-center-logo.has-image {
    border-radius: 16px;
  }

  .mood-cloud-logo-text {
    font-size: clamp(1rem, 2.8vw, 1.5rem);
  }
}

.settings-tabs-nav {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  padding: 0.45rem;
  border: 1px solid rgba(188, 210, 255, 0.22);
  border-radius: 0.95rem;
  background: rgba(11, 16, 32, 0.7);
  backdrop-filter: blur(6px);
}

.settings-tabs-nav .nav-link {
  border-radius: 999px;
  border: 1px solid rgba(180, 205, 255, 0.22);
  color: #d9e6ff;
}

.settings-tabs-nav .nav-link.active {
  border-color: rgba(120, 167, 255, 0.7);
  background: linear-gradient(180deg, rgba(46, 107, 255, 0.52), rgba(39, 97, 233, 0.44));
  color: #fff;
  box-shadow: 0 8px 18px rgba(20, 77, 200, 0.35);
}

/* Лог игроков: контрастные заголовки аккордеона */
#orderLogAccordion .order-log-header-btn {
  background-color: #1e293b !important;
  color: #fff;
  border-color: rgba(148, 163, 184, 0.3);
}
#orderLogAccordion .order-log-header-btn:hover,
#orderLogAccordion .order-log-header-btn:focus {
  background-color: #334155 !important;
  color: #fff;
  border-color: rgba(148, 163, 184, 0.4);
}
#orderLogAccordion .order-log-header-btn:not(.collapsed) {
  background-color: #334155 !important;
  color: #fff;
  box-shadow: none;
}
#orderLogAccordion .order-log-header-btn::after {
  filter: brightness(0) invert(1);
}
#settingsTabsContent .card {
  border-radius: 1rem;
}

#settingsTabsContent .card-body > h2.h5 {
  margin-bottom: 1rem;
}

#settingsTabsContent .card-body > h3.h6 {
  margin-top: 0.8rem;
  margin-bottom: 0.65rem;
}

#settingsTabsContent .border.border-light-subtle.rounded.p-2 {
  border-radius: 0.8rem !important;
  background: rgba(255, 255, 255, 0.03);
}

.settings-card-item .card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.9rem;
}

.settings-drink-preview {
  height: 148px;
  border-bottom: 1px solid rgba(188, 210, 255, 0.22);
  background: linear-gradient(180deg, rgba(29, 44, 82, 0.6), rgba(16, 25, 49, 0.38));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.settings-drink-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-drink-preview-empty {
  color: #d4def8;
  font-size: 0.85rem;
  opacity: 0.86;
}

.form-label-sm {
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  color: #c5d6ff;
}

/* Модерация облака — фестивальный режим */
.moderation-words-list-wrap {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.25rem;
}
.moderation-words-list-wrap .moderation-live-item {
  flex-shrink: 0;
}
.moderation-details summary {
  cursor: pointer;
  list-style: none;
}
.moderation-details summary::-webkit-details-marker {
  display: none;
}
.moderation-add-to-screen-btn {
  min-width: 6rem;
}
