:root {
  --bg: #070711;
  --panel: rgba(12, 14, 20, 0.78);
  --panel2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.12);
  --text: rgba(245, 245, 255, 0.92);
  --muted: rgba(245, 245, 255, 0.65);
  --accent: #ffd27d;
  --accent2: #e0a84b;
  --server: #8b0605;
  --request: #ab7410;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
  --radius: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text) !important;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif !important;
  position: relative;
  background:
    linear-gradient(108deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.42) 42%, rgba(0, 0, 0, 0.18) 74%),
    url("../assets/images/desktopbackground.png");
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-position: center center !important;
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background 220ms ease;
}

body.mode-home,
body.mode-step {
  background:
    linear-gradient(108deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.42) 42%, rgba(0, 0, 0, 0.18) 74%),
    url("../assets/images/desktopbackground.png");
  background-size: cover;
  background-position: center center;
}

body.mode-results {
  background:
    radial-gradient(circle at 10% 0%, rgba(86, 91, 110, 0.24) 0%, transparent 45%),
    linear-gradient(180deg, #2a2d32 0%, #1f2227 48%, #171a1e 100%);
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 22px 56px;
}

#myra-app {
  width: 100%;
  margin: 0 auto;
}

body.mode-home #myra-app,
body.mode-step #myra-app {
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
}

body.mode-results #myra-app {
  max-width: 1040px;
  margin-top: 20px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow);
}

.screen {
  display: none;
}

.screen.active,
.screen[style*="display:block"],
.screen[style*="display: block"] {
  display: block;
  animation: myraFadeUp 280ms ease both;
}

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

h1,
h2,
h3 {
  letter-spacing: -0.01em;
  margin: 0;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.home-copy {
  width: min(1100px, 100%);
  padding-right: clamp(80px, 20vw, 280px);
  padding-top: 10px;
}

.brand-lockup {
  margin-bottom: 14px;
}

.brand-main {
  font-size: clamp(3rem, 11vw, 6rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: #fff;
}

.brand-sub {
  margin-top: 2px;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1;
  color: #fff;
}

.brand-tagline {
  margin: 0 0 20px;
  max-width: 980px;
  font-size: clamp(1.1rem, 2.1vw, 2.3rem);
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.2;
}

.brand-tagline strong {
  color: #fff;
}

.mobile-linebreak {
  display: none;
}

.home-title {
  margin: 0 0 6px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  color: #fff;
}

.home-subtitle {
  margin: 0 0 20px;
  max-width: 900px;
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.35;
}

.home-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  max-width: 350px;
}

.btn-mode {
  width: min(350px, 100%);
  min-height: 92px;
  border-radius: 26px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 500;
  letter-spacing: 0;
}

.btn-server {
  background: rgba(88, 3, 3, 0.9);
}

.btn-request {
  background: rgba(126, 86, 5, 0.9);
}

.btn-server:hover {
  background: rgba(114, 10, 10, 0.95);
}

.btn-request:hover {
  background: rgba(151, 104, 8, 0.95);
}

.flow-panel {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(13, 15, 23, 0.9), rgba(11, 13, 20, 0.78));
  box-shadow: var(--shadow);
}

.flow-panel h2 {
  margin: 0 0 12px;
}

.flow-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.status-line {
  margin-top: 12px;
  color: rgba(245, 245, 255, 0.74);
  min-height: 1.2em;
}

.status-line:empty {
  margin-top: 0;
  min-height: 0;
}

select {
  width: 100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  outline: none;
}

input[type="range"] {
  width: 100%;
}

button,
.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
  text-decoration: none;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #1a0c06;
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ffe1a8, #f1b257);
}

/* Guided mode form styling */
#screen-step {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

#screen-step .flow-panel {
  width: 100%;
  padding: 30px 30px 28px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(16, 18, 26, 0.92), rgba(12, 14, 22, 0.82));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.48);
  overflow-x: hidden;
}

#screen-step #stepTitle {
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  line-height: 1.05;
  color: #fff;
  margin: 0 0 18px;
}

#screen-step #stepBody > div,
#screen-step #stepBody > .myra-transcript {
  margin-top: 12px;
}

#screen-step label {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.9);
  margin: 14px 0 8px;
}

#screen-step select,
#screen-step input[type="text"],
#screen-step .myra-transcript-input {
  width: 100%;
  min-height: 56px;
  font-size: 1.04rem;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.36);
  color: rgba(245, 245, 255, 0.94);
}

#screen-step input[type="range"] {
  height: 24px;
  margin: 8px 0 8px;
  accent-color: #b1760a;
}

#screen-step .pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.92);
}

#screen-step .pill input {
  width: 18px;
  height: 18px;
  accent-color: #a56e0a;
}

#screen-step .myra-flavor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.38);
}

#screen-step .myra-flavor-option {
  min-height: 52px;
  margin: 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

#screen-step .myra-flavor-option span {
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.2;
}

#screen-step .myra-flavor-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(212, 166, 74, 0.8);
  background: #040404;
  display: grid;
  place-content: center;
  margin: 0;
}

#screen-step .myra-flavor-option input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform 110ms ease;
  box-shadow: inset 1em 1em #d4a64a;
  clip-path: polygon(14% 44%, 0 63%, 44% 100%, 100% 26%, 80% 10%, 43% 62%);
}

#screen-step .myra-flavor-option input[type="checkbox"]:checked::before {
  transform: scale(1);
}

#screen-step .flow-actions {
  margin-top: 22px;
  gap: 12px;
}

#screen-step .flow-actions .btn {
  min-height: 54px;
  min-width: 150px;
  border-radius: 16px;
  font-size: 1rem;
}

#screen-step #stepStatus {
  margin-top: 14px;
  font-size: 0.95rem;
}

@media (max-width: 1080px) {
  body.mode-home,
  body.mode-step {
    background:
      linear-gradient(126deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.46) 58%, rgba(0, 0, 0, 0.2) 100%),
      url("../assets/images/tabletbackground.png");
    background-size: cover;
    background-position: right center;
  }

  .wrap {
    padding: 34px 18px 52px;
  }

  body.mode-home #myra-app {
    align-items: flex-start;
  }

  body.mode-step #myra-app {
    align-items: center;
  }

  .home-copy {
    padding-right: 42%;
    padding-top: 42px;
    min-height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
  }

  .brand-lockup {
    margin-bottom: 22px;
    margin-top: 0;
  }

  .brand-main {
    font-size: clamp(6.3rem, 23.1vw, 12.6rem);
  }

  .mobile-linebreak {
    display: inline;
  }

  .home-title {
    display: none;
  }

  .home-actions {
    width: min(400px, 100%);
    max-width: 400px;
    align-self: center;
    align-items: stretch;
    margin-top: auto;
    gap: 22px;
    order: 3;
  }

  .home-subtitle {
    width: min(400px, 100%);
    margin: 20px auto 0;
    text-align: center;
    order: 4;
  }

  .brand-tagline {
    order: 2;
    margin: auto 0;
  }

  #homeStatus {
    width: min(400px, 100%);
    margin: 10px auto 0;
    text-align: center;
    order: 5;
  }

  #screen-step {
    width: 100%;
    max-width: 860px;
  }

  #screen-step .flow-panel {
    padding: 26px 22px 24px;
  }

  #screen-step #stepTitle {
    font-size: clamp(1.75rem, 4.4vw, 2.3rem);
    margin-bottom: 16px;
  }

  #screen-step .flow-actions .btn {
    min-height: 52px;
    min-width: 140px;
  }

  #screen-step .myra-flavor-grid {
    max-height: 280px;
  }
}

@media (max-width: 760px) {
  body.mode-home,
  body.mode-step {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.68) 0%, rgba(0, 0, 0, 0.48) 50%, rgba(0, 0, 0, 0.42) 100%),
      url("../assets/images/mobilebackground.png");
    background-size: cover;
    background-position: right top;
  }

  .wrap {
    padding: 20px 10px 34px;
  }

  body.mode-home #myra-app {
    min-height: calc(100vh - 56px);
    align-items: flex-start;
  }

  body.mode-step #myra-app {
    min-height: calc(100vh - 56px);
    align-items: center;
  }

  .home-copy {
    width: 100%;
    padding-right: 34%;
    padding-top: 34px;
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
  }

  .brand-tagline {
    order: 2;
    margin: auto 0;
  }

  .brand-lockup {
    margin-top: 0;
  }

  .brand-main {
    font-size: clamp(5.88rem, 25.2vw, 11.55rem);
  }

  .mobile-linebreak {
    display: inline;
  }

  .home-title {
    display: none;
  }

  .home-actions {
    width: min(360px, 100%);
    max-width: 360px;
    align-self: center;
    align-items: stretch;
    margin-top: auto;
    gap: 22px;
    order: 3;
  }

  .home-subtitle {
    width: min(360px, 100%);
    margin: 20px auto 0;
    text-align: center;
    order: 4;
  }

  #homeStatus {
    width: min(360px, 100%);
    margin: 10px auto 0;
    text-align: center;
    order: 5;
  }

  .btn-mode {
    min-height: 84px;
    border-radius: 22px;
  }

  #screen-step {
    width: 100%;
  }

  .flow-panel {
    padding: 18px 14px;
  }

  #screen-step .flow-panel {
    padding: 20px 14px 18px;
    border-radius: 18px;
  }

  #screen-step #stepTitle {
    font-size: clamp(1.45rem, 6.8vw, 2rem);
    margin-bottom: 12px;
  }

  #screen-step label {
    margin: 12px 0 6px;
    font-size: 0.96rem;
  }

  #screen-step select,
  #screen-step input[type="text"],
  #screen-step .myra-transcript-input {
    min-height: 52px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 1rem;
  }

  #screen-step .flow-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
    gap: 10px;
  }

  #screen-step .flow-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    font-size: 0.98rem;
  }

  #btnCancel {
    grid-column: 1 / -1;
  }

  #screen-step .myra-flavor-grid {
    grid-template-columns: 1fr;
    max-height: 220px;
    padding: 8px;
  }
}

/* Results cards */
#results .wine,
.beer-card,
.card {
  background: rgba(10, 10, 18, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
  padding: 16px 16px !important;
  margin-bottom: 14px;
}

#results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.myra-result-card {
  background: rgba(10, 10, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

.myra-result-header {
  padding: 18px 18px 10px;
  background: radial-gradient(circle at 25% 0%, rgba(255, 210, 125, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.myra-result-title {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.myra-result-subtitle {
  margin: 6px 0 0;
  color: rgba(245, 245, 255, 0.7);
  font-size: 0.95rem;
}

.myra-badges {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.myra-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(245, 245, 255, 0.82);
  font-size: 0.9rem;
}

.myra-result-body {
  padding: 16px 18px 18px;
}

.myra-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 14px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.myra-kv li {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 12px;
  color: rgba(245, 245, 255, 0.82);
}

.myra-kv strong {
  display: block;
  color: rgba(245, 245, 255, 0.65);
  font-size: 0.85rem;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.myra-result-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.myra-link {
  text-decoration: none;
}

.myra-result-title .myra-link {
  color: #d4a64a;
}

.myra-result-title .myra-link:hover {
  color: #e3ba64;
}

/* Confidence badge */
.myra-badge-confidence {
  background: rgba(255, 210, 125, 0.10);
  border-color: rgba(255, 210, 125, 0.25);
  color: rgba(255, 235, 200, 0.92);
}

/* Transcript (speech recognition) */
.myra-transcript {
  margin: 14px 0 0;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.28);
}

.myra-transcript-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.myra-transcript-label {
  color: rgba(245, 245, 255, 0.7);
  font-weight: 750;
  letter-spacing: 0.02em;
  font-size: 0.85rem;
  padding-top: 3px;
}

.myra-transcript-text {
  color: rgba(245, 245, 255, 0.85);
  line-height: 1.5;
  word-break: break-word;
}

.myra-transcript-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.myra-transcript-editrow {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.myra-transcript-input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(245, 245, 255, 0.92);
  outline: none;
}

.myra-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

@media (max-width: 740px) {
  .myra-compare {
    grid-template-columns: 1fr;
  }
}

.myra-explain {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 740px) {
  .myra-explain {
    grid-template-columns: 1fr;
  }
}

.myra-explain-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 12px;
}

.myra-explain-title {
  margin: 0 0 6px;
  color: rgba(245, 245, 255, 0.72);
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 0.85rem;
}

.myra-explain-list {
  margin: 0;
  padding-left: 18px;
  color: rgba(245, 245, 255, 0.82);
}

.myra-explain-list li {
  margin: 6px 0;
}

button:focus-visible,
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(255, 210, 125, 0.95);
  outline-offset: 2px;
}

/* Store box (call + map + directions) */
.myra-store {
  margin-top: 14px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  background: rgba(10, 8, 22, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

.myra-store-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.myra-store-phone {
  color: rgba(245, 245, 255, 0.8);
  margin: 0 0 10px;
}

.myra-store-link {
  color: rgba(255, 230, 160, 0.95);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 230, 160, 0.35);
}

.myra-store-link:hover {
  border-bottom-color: rgba(255, 230, 160, 0.8);
}

.myra-store-help {
  color: rgba(245, 245, 255, 0.72);
  margin: 0 0 10px;
}

.myra-store-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.myra-store-maprow {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.myra-store-map {
  width: 100%;
  height: 220px;
  border: 0;
  display: block;
  filter: saturate(0.95) contrast(1.05);
}

.myra-link.btn,
.myra-link.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.myra-media {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: start;
}

.myra-media img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 520px) {
  .myra-media {
    grid-template-columns: 1fr;
  }
  .myra-media img {
    width: 100%;
    height: 220px;
  }
}

/* De-emphasize legacy backgrounds/effects on wine/beer pages */
#winewater,
#beerwater,
canvas#room-canvas {
  display: none !important;
}
