/**
 * Size It: Higher or Lower - Single-Screen Viewport Stylesheet
 * Engineered for zero-scroll 100dvh play on both mobile and desktop.
 */

/* Viewport Root Layout */
html, body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.hol-viewport {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hol-editorial-wrap {
  max-width: 720px;
  width: 100%;
  margin: 36px auto 48px;
  padding: 0 16px;
  box-sizing: border-box;
}

.hol-editorial-wrap .editorial-content {
  margin-top: 0;
}

/* Compact Header */
.hol-header {
  height: 52px;
  min-height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
  flex-shrink: 0;
  gap: 12px;
  box-sizing: border-box;
}

.hol-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Brand Logo (matches site styles) */
.hol-header .brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.hol-header .brand-icon {
  width: 28px;
  height: 28px;
  display: block;
}

.hol-header .brand-text {
  display: flex;
  flex-direction: column;
}

.hol-header .brand-title {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.hol-header .brand-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

/* Header Score HUD */
.hol-hud-score {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-raise-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  flex-shrink: 0;
}

.hol-hud-stat {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}

.hol-hud-stat strong {
  font-size: 16px;
  font-weight: 900;
  color: var(--siu-board);
  line-height: 1;
}

.hol-hud-stat.best strong {
  color: var(--text);
}

.hol-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Sub-HUD for narrow screens (under 500px) */
.hol-sub-hud {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 3px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface-raise-2);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.hol-sub-hud strong {
  font-size: 14px;
  font-weight: 900;
  color: var(--siu-board);
}

.hol-sub-hud .best strong {
  color: var(--text);
}

@media (max-width: 680px) {
  .hol-header {
    height: 48px;
    min-height: 48px;
    padding: 0 8px;
    gap: 6px;
  }
  .hol-header-left {
    gap: 6px;
  }
  .hol-header .brand-logo {
    gap: 6px;
  }
  .hol-header .brand-icon {
    width: 24px;
    height: 24px;
  }
  .hol-header .brand-title {
    font-size: 14px;
  }
  .hol-header .brand-badge {
    display: none;
  }
  .hol-header-right {
    gap: 4px;
  }
  .hol-header .hol-hud-score {
    display: none;
  }
  .hol-sub-hud {
    display: flex;
    padding: 3px 8px;
    gap: 16px;
    font-size: 11px;
  }
}

/* Main Game Viewport (fills 100% remaining height, no scroll) */
.hol-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding: 8px 12px 10px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Arena Grid / Flex */
.hol-arena {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 12px;
  position: relative;
}

/* Card Styling */
.hol-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.hol-card-header {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hol-card-badge-wrap {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

.hol-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-raise-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hol-axis-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(31, 79, 142, 0.12);
  border: 1px solid rgba(31, 79, 142, 0.32);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  color: var(--siu-board);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html.dark .hol-axis-badge {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.35);
  color: #93c5fd;
}

.hol-axis-badge.hol-axis-highlight {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.48);
  color: #d97706;
}

html.dark .hol-axis-badge.hol-axis-highlight {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fbbf24;
}

.hol-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 2px 0;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hol-card-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Silhouette Display & Architectural Dimension Guides */
.hol-card-silhouette {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
  background: var(--surface-raise-2);
  border-radius: var(--radius-md);
  padding: 12px 14px 24px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.hol-silhouette-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center center;
}

.hol-card-silhouette svg {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
}

/* Architectural Dimension Guide Bar inside Silhouette Box */
.hol-dim-guide {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}

.hol-dim-guide-h {
  bottom: 5px;
  left: 12px;
  right: 12px;
  flex-direction: row;
  gap: 6px;
}

.hol-dim-guide-v {
  bottom: 5px;
  left: 12px;
  right: 12px;
  flex-direction: row;
  gap: 6px;
}

.hol-dim-line {
  flex: 1;
  height: 1px;
  background: var(--line-strong, rgba(148, 163, 184, 0.35));
  position: relative;
}

.hol-dim-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.hol-scale-pill {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text);
  z-index: 4;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.hol-card.is-larger-card .hol-scale-pill {
  background: #16895e;
  border-color: #16895e;
  color: #fff;
}

/* Measurement Reveal Box */
.hol-measure-box {
  width: 100%;
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-raise);
  border: 1px solid var(--line);
  box-sizing: border-box;
}

.hol-measure-val {
  font-size: 21px;
  font-weight: 900;
  color: var(--siu-board);
  line-height: 1.15;
}

.hol-measure-desc {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-top: 2px;
  line-height: 1.25;
}

.hol-scale-bar {
  width: 100%;
  height: 5px;
  background: var(--surface-raise-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.hol-scale-fill {
  height: 100%;
  width: 0%;
  background: var(--siu-board);
  border-radius: 999px;
  transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.hol-card.is-larger-card .hol-scale-fill {
  background: #16895e;
}

/* Action Buttons (Higher / Lower) */
.hol-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  flex-shrink: 0;
  margin-top: 8px;
}

.hol-btn-guess {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.15s ease;
  user-select: none;
}

.hol-btn-main {
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1.15;
}

.hol-btn-sub {
  font-size: 10.5px;
  font-weight: 700;
  opacity: 0.9;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.hol-btn-guess:active:not(:disabled) {
  transform: scale(0.97);
}

.hol-btn-higher {
  background: #16895e;
  color: #fff;
}
.hol-btn-higher:hover:not(:disabled) {
  background: #12724e;
}

.hol-btn-lower {
  background: var(--accent);
  color: #fff;
}
.hol-btn-lower:hover:not(:disabled) {
  background: var(--accent-hover);
}

.hol-btn-guess:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.hol-btn-guess.is-correct-choice:disabled {
  opacity: 1;
  border-color: #fff;
  box-shadow: 0 0 0 2px #16895e;
}

.hol-btn-guess.is-wrong-choice:disabled {
  opacity: 0.85;
  text-decoration: line-through;
}

/* Center VS Badge */
.hol-vs-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.hol-vs-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(200, 50, 37, 0.35);
  border: 3px solid var(--surface);
}

/* In-Flow Result Dock (Never blocks cards or measurements) */
.hol-result-dock {
  width: 100%;
  max-width: 900px;
  margin: 8px auto 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  flex-shrink: 0;
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.hol-result-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hol-result-title {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.hol-result-fact {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
  margin-top: 3px;
  white-space: normal;
}

.hol-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hol-btn-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-raise-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.hol-btn-share:hover {
  background: var(--surface-raise);
  border-color: var(--siu-board);
}

.hol-btn-share:active {
  transform: scale(0.97);
}

.hol-btn-next {
  background: var(--siu-board);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.12s ease;
}

.hol-btn-next:hover {
  background: #183f73;
}

.hol-btn-next:active {
  transform: scale(0.97);
}

/* =========================================================================
   MOBILE PORTRAIT OPTIMIZATION (< 720px)
   Vertical 2-row layout fitting 100% within one screen with zero scroll.
   ========================================================================= */
@media (max-width: 720px) {
  .hol-main {
    padding: 6px 8px 8px;
  }

  .hol-arena {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .hol-card {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius-md);
  }

  .hol-card-title {
    font-size: 16px;
  }

  .hol-card-sub {
    font-size: 11px;
  }

  .hol-card-silhouette {
    margin: 4px 0;
    padding: 6px 8px 20px;
  }

  .hol-dim-guide-h,
  .hol-dim-guide-v {
    bottom: 3px;
    left: 8px;
    right: 8px;
  }

  .hol-dim-tag {
    font-size: 9px;
    padding: 1px 5px;
  }

  .hol-measure-box {
    padding: 5px 10px;
  }

  .hol-measure-val {
    font-size: 17px;
  }

  .hol-measure-desc {
    font-size: 10px;
  }

  /* Center VS divider floats subtly between cards */
  .hol-vs-badge {
    height: 0;
    position: relative;
    overflow: visible;
  }

  .hol-vs-circle {
    position: absolute;
    width: 32px;
    height: 32px;
    font-size: 12px;
    border-width: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .hol-actions {
    margin-top: 5px;
    margin-bottom: 0;
    gap: 6px;
  }

  .hol-btn-guess {
    padding: 6px 8px;
    font-size: 12px;
  }

  .hol-btn-main {
    font-size: 12px;
  }

  .hol-btn-sub {
    font-size: 9.5px;
  }

  .hol-result-dock {
    margin-top: 6px;
    padding: 8px 12px;
    gap: 8px;
    border-radius: var(--radius-md);
  }

  .hol-result-title {
    font-size: 13px;
  }

  .hol-result-fact {
    font-size: 11px;
    line-height: 1.35;
  }

  .hol-btn-next {
    padding: 8px 14px;
    font-size: 13px;
  }
}
