:root {
  --ink: #2a4458;
  --muted: #5c7386;
  --coral: #e07a5f;
  --coral-dark: #c8654f;
  --coral-deep: #a85545;
  --cream: #fff9f5;
  --yellow: #f5dc6e;
  --teal: #6ec4c9;
  --sky: #b8d9eb;
  --green: var(--coral);
  --green-dark: var(--coral-dark);
  --lime: var(--yellow);
  --paper: #edf6fb;
  --line: #c8dce8;
  --danger: #c0392b;
  --accent-rgb: 224, 122, 95;
  --bs-success: var(--coral);
  --bs-success-rgb: 224, 122, 95;
  --bs-link-color: var(--coral);
  --bs-link-hover-color: var(--coral-dark);
  --shadow-soft: 0 1px 2px rgba(42, 68, 88, .06), 0 10px 28px rgba(42, 68, 88, .08);
  --radius: .9rem;
}

html { min-height: 100%; }
body {
  min-height: 100vh;
  color: var(--ink);
  letter-spacing: 0;
  background:
    radial-gradient(980px 520px at 8% -8%, rgba(110, 196, 201, .28), transparent 58%),
    radial-gradient(820px 480px at 100% 0%, rgba(224, 122, 95, .1), transparent 52%),
    linear-gradient(180deg, #e8f4fa 0%, var(--paper) 42%, #d4e8f2 100%);
  background-attachment: fixed;
}
a { color: var(--bs-link-color); }
a:hover { color: var(--bs-link-hover-color); }
.app-container { max-width: 1040px; }
.brand-logo {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  vertical-align: -0.35em;
  margin-right: .15rem;
}
.navbar {
  background: rgba(237, 246, 251, .88) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: rgba(184, 217, 235, .65) !important;
}
.navbar-brand { color: var(--ink); letter-spacing: -.01em; }
.nav-link { color: #4a6275; }
.nav-link:hover { color: var(--green); }
.card {
  border-color: rgba(224, 122, 95, .14);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  background: rgba(255, 255, 255, .92);
}
.btn {
  border-radius: .7rem;
  font-weight: 600;
  letter-spacing: .01em;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.btn-success {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--coral);
  --bs-btn-border-color: var(--coral);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--coral-dark);
  --bs-btn-hover-border-color: var(--coral-dark);
  --bs-btn-focus-shadow-rgb: var(--accent-rgb);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--coral-deep);
  --bs-btn-active-border-color: var(--coral-deep);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--coral);
  --bs-btn-disabled-border-color: var(--coral);
  background-color: var(--coral);
  border-color: var(--coral);
  color: #fff;
  box-shadow: 0 6px 16px rgba(224, 122, 95, .24);
}
.btn-success:hover,
.btn-success:focus-visible {
  background-color: var(--coral-dark);
  border-color: var(--coral-dark);
  color: #fff;
  box-shadow: 0 8px 20px rgba(224, 122, 95, .32);
  transform: translateY(-1px);
}
.btn-outline-success {
  --bs-btn-color: var(--coral);
  --bs-btn-border-color: var(--coral);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--coral);
  --bs-btn-hover-border-color: var(--coral);
  --bs-btn-focus-shadow-rgb: var(--accent-rgb);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--coral-dark);
  --bs-btn-active-border-color: var(--coral-dark);
  --bs-btn-disabled-color: var(--coral);
  --bs-btn-disabled-border-color: var(--coral);
  color: var(--coral);
  border-color: var(--coral);
  background: rgba(255, 255, 255, .78);
}
.btn-outline-success:hover,
.btn-outline-success:focus-visible {
  background-color: var(--coral);
  border-color: var(--coral);
  color: #fff;
  box-shadow: 0 4px 14px rgba(224, 122, 95, .16);
  transform: translateY(-1px);
}
.site-footer {
  background: rgba(237, 246, 251, .92);
  border-top-color: rgba(184, 217, 235, .65) !important;
}
.game-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 24px; }
.home-actions { gap: .7rem !important; }
.home-actions .btn,
#startForm .btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: .7rem;
  padding-top: .85rem;
  padding-bottom: .85rem;
}
.home-actions .btn .bi,
#startForm .btn .bi {
  flex: 0 0 1.25rem;
  margin: 0;
  text-align: center;
  opacity: .9;
}
#startForm .btn-success,
.home-actions .btn-play {
  font-size: 1.2rem;
  font-weight: 700;
  padding-top: 1.05rem;
  padding-bottom: 1.05rem;
}
.home-carousel { position: relative; border-color: rgba(110, 196, 201, .25); overflow: hidden; }
.home-tagline {
  color: var(--ink);
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  font-weight: 750;
  letter-spacing: -.01em;
  text-shadow:
    -1px -1px 0 rgba(255,255,255,.92),
    0 -1px 0 rgba(255,255,255,.92),
    1px -1px 0 rgba(255,255,255,.92),
    -1px 0 0 rgba(255,255,255,.92),
    1px 0 0 rgba(255,255,255,.92),
    -1px 1px 0 rgba(255,255,255,.92),
    0 1px 0 rgba(255,255,255,.92),
    1px 1px 0 rgba(255,255,255,.92),
    0 8px 24px rgba(0, 0, 0, .18);
}
.home-carousel .home-tagline {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 5;
  margin: 0;
  padding: 0;
  background: none;
  border-radius: 0;
  text-align: center;
  box-shadow: none;
}
.home-tagline-plain { margin-bottom: 1rem; }
.home-carousel-img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.home-carousel-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62));
  color: #fff;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
.home-carousel-details,
.home-carousel-dog,
.dog-photo-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.25;
}
.home-carousel-dog,
.dog-photo-name {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 700;
  line-height: 1.15;
}
.home-carousel-dog::before,
.dog-photo-name::before { content: "\0022"; }
.home-carousel-dog::after,
.dog-photo-name::after { content: "\0022"; }
.home-carousel-credit {
  margin-left: auto;
  flex-shrink: 0;
  max-width: 65%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.home-carousel-credit .bi { margin-right: .15em; }
.home-carousel-breed {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2.4rem;
  z-index: 4;
  margin: 0;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
  opacity: 0;
  transform: translateY(10px);
}
.home-carousel-breed.is-revealed {
  animation: homeCarouselBreedReveal .45s ease .75s forwards;
}
.carousel-item:not(:has(.home-carousel-meta)) .home-carousel-breed { bottom: 12px; }
@keyframes homeCarouselBreedReveal {
  to { opacity: 1; transform: translateY(0); }
}
.game-status {
  min-height: 44px;
  border-bottom-color: rgba(110, 196, 201, .35) !important;
  background: linear-gradient(180deg, #f4fafd 0%, #e3f2f8 100%) !important;
}
.navbar .fullscreen-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.navbar .fullscreen-btn .bi { font-size: .95rem; line-height: 1; }
.game-status-item { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.game-status-item > strong { font-size: .95rem; font-weight: 700; letter-spacing: -.01em; }
.game-errors { flex-shrink: 0; }
.game-fullscreen { flex-shrink: 0; margin-left: auto; }
.game-fullscreen .btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}
.game-fullscreen .btn .bi { font-size: .95rem; line-height: 1; }
.dog-photo-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: linear-gradient(145deg, #dceef6, #c8e3ef);
}
.dog-photo-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62));
  color: #fff;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
.dog-photo-credit {
  margin-left: auto;
  flex-shrink: 0;
  max-width: 65%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.dog-photo-credit .bi { margin-right: .15em; }
.dog-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(42, 68, 88, .15) 0%, rgba(42, 68, 88, .5) 70%),
    rgba(42, 68, 88, .25);
  pointer-events: none;
  perspective: 900px;
  overflow: hidden;
}
.countdown-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(56vw, 220px);
  height: min(56vw, 220px);
  transform-style: preserve-3d;
}
.countdown-burst {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 196, 201, .35) 0%, rgba(110, 196, 201, 0) 68%);
  opacity: 0;
  transform: scale(.55);
  pointer-events: none;
}
.countdown-stage.is-beating .countdown-burst {
  animation: countdown-burst .58s ease-out both;
}
.countdown-text {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 1.1em;
  text-align: center;
  font-size: clamp(4.5rem, 22vw, 7.5rem);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, .35),
    0 8px 0 rgba(224, 122, 95, .35),
    0 18px 28px rgba(0, 0, 0, .45);
  transform-origin: center center;
  transform-style: preserve-3d;
  opacity: 0;
  backface-visibility: hidden;
}
.countdown-stage.is-beating .countdown-text {
  animation: countdown-flip .58s cubic-bezier(.18, 1.15, .32, 1) both;
}
.countdown-overlay.is-go .countdown-text {
  color: var(--lime);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, .25),
    0 8px 0 rgba(224, 122, 95, .45),
    0 18px 32px rgba(0, 0, 0, .5);
}
@keyframes countdown-flip {
  0% {
    opacity: 0;
    transform: rotateX(-92deg) scale(.28) translateZ(-120px);
    filter: blur(3px);
  }
  58% {
    opacity: 1;
    transform: rotateX(10deg) scale(1.14) translateZ(48px);
    filter: blur(0);
  }
  78% {
    transform: rotateX(-5deg) scale(.96) translateZ(8px);
  }
  100% {
    opacity: 1;
    transform: rotateX(0deg) scale(1) translateZ(0);
    filter: blur(0);
  }
}
@keyframes countdown-burst {
  0% { opacity: 0; transform: scale(.4); }
  35% { opacity: .9; }
  100% { opacity: 0; transform: scale(1.35); }
}
@media (prefers-reduced-motion: reduce) {
  .countdown-stage.is-beating .countdown-text,
  .countdown-stage.is-beating .countdown-burst { animation: none; }
  .countdown-text { opacity: 1; transform: none; filter: none; }
}
.player-name-field { position: relative; }
.player-name-field .form-control {
  padding-right: 2.75rem;
  border-radius: .7rem;
  border-color: var(--line);
}
.player-name-field .form-control:focus {
  border-color: rgba(224, 122, 95, .45);
  box-shadow: 0 0 0 .2rem rgba(224, 122, 95, .15);
}
.player-name-field .btn-close {
  position: absolute;
  top: 50%;
  right: .85rem;
  z-index: 2;
  transform: translateY(-50%);
}
#answers { gap: .65rem !important; }
.answer-btn {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  min-height: 3.15rem;
  padding: .85rem 1.05rem;
  border-width: 1.5px;
  border-color: #b8d4e4;
  background: #fff;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: .005em;
  box-shadow: 0 1px 2px rgba(42, 68, 88, .06);
}
.answer-letter {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: .45rem;
  background: rgba(224, 122, 95, .1);
  color: var(--green-dark);
  font-size: .95rem;
  font-weight: 750;
  line-height: 1;
}
.answer-label { min-width: 0; }
.answer-btn:hover:not(:disabled) .answer-letter,
.answer-btn:focus-visible .answer-letter {
  background: rgba(224, 122, 95, .18);
}
.answer-btn:hover:not(:disabled),
.answer-btn:focus-visible {
  background: #eef7fb;
  border-color: var(--green);
  color: var(--green-dark);
  box-shadow: 0 6px 16px rgba(224, 122, 95, .12);
  transform: translateY(-1px);
}
.answer-btn:active:not(:disabled) { transform: translateY(0); }
.answer-btn:disabled {
  opacity: .65;
  transform: none;
  box-shadow: none;
}
.stat-pill { background: #fff; border: 1px solid var(--line); border-radius: .65rem; padding: 8px 12px; min-width: 88px; }
.lives { display: flex; align-items: center; gap: 7px; min-height: 24px; white-space: nowrap; }
.error-dot {
  width: 14px;
  height: 14px;
  display: block;
  border-radius: 50%;
  border: 2px solid #d0c3b4;
  background: #fff;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.error-dot.active {
  border-color: var(--danger);
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .12);
}
.timer-row .progress {
  height: 8px;
  border-radius: 999px;
  background: #e8dfd4;
  overflow: hidden;
}
.timer-row .progress-bar {
  border-radius: inherit;
  transition: width .1s linear, background-color .2s ease;
}
.feedback-message {
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border-radius: .75rem;
  border-width: 1px;
  box-shadow: 0 2px 10px rgba(23, 32, 27, .05);
}
.feedback-title { font-weight: 700; letter-spacing: -.01em; }
.feedback-description { margin: 6px 0 0; font-size: .86rem; font-weight: 400; line-height: 1.4; }
.feedback-delay { height: 4px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: rgba(0,0,0,.1); }
.feedback-delay-bar { width: 100%; height: 100%; border-radius: inherit; background: currentColor; opacity: .55; }
.feedback-actions { display: flex; gap: 8px; margin-top: 10px; }
.feedback-actions .btn { flex: 1 1 0; border-radius: .6rem; }
.empty-visual { min-height: 320px; display: grid; place-items: center; background: #d4e8f2; color: var(--muted); }
.empty-visual i { font-size: 72px; }
.rank {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #e3f2f8;
  font-weight: 700;
  font-size: .85rem;
}
.rank.top {
  background: linear-gradient(160deg, var(--yellow), #fff3b0);
  color: var(--coral-dark);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
#gameOverPanel .display-4 {
  letter-spacing: -.03em;
  line-height: 1;
}
.stats-list .list-group-item {
  border-color: rgba(224, 122, 95, .08);
  padding-top: .7rem;
  padding-bottom: .7rem;
}
/* Välilehdet pysyvät yhdellä rivillä ja vierivät kapealla näytöllä. */
.stats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  border-bottom: 0;
}
.stats-tabs .nav-item { margin: 0; }
.stats-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  white-space: nowrap;
  padding: .4rem .7rem;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
}
.stats-tabs .nav-link:hover,
.stats-tabs .nav-link:focus {
  color: var(--green-dark);
  border-color: var(--green);
  background: #fff;
}
.stats-tabs .nav-link.active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.filter-chips .btn {
  padding: .36rem .7rem;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
}
.filter-chips .btn:hover,
.filter-chips .btn:focus {
  color: var(--green-dark);
  border-color: var(--green);
  background: #fff;
}
.filter-chips .btn-check:checked + .btn {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}
.filter-chips .btn-check:focus-visible + .btn {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
@media (max-width: 575.98px) {
  .stats-tabs .nav-link {
    padding: .36rem .58rem;
    font-size: .78rem;
  }
  .stats-tabs .nav-link .bi { font-size: .9em; }
  .filter-chips .btn {
    padding: .32rem .58rem;
    font-size: .78rem;
  }
}
.top-played-at {
  margin-top: .1rem;
  font-size: .72rem;
  line-height: 1.2;
}
.breed-picker { position: relative; }
.breed-suggestions { position: absolute; z-index: 1050; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(23,32,27,.16); }
.breed-option { padding: 9px 12px; }
.breed-option.active { color: #fff; background: var(--green); border-color: var(--green); }
.upload-preview-btn {
  position: relative;
  display: block;
  width: min(100%, 440px);
  padding: 0;
  border: 0;
  border-radius: var(--radius, 8px);
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-soft, none);
  text-align: left;
}
.upload-preview-btn:focus-visible {
  outline: 3px solid rgba(224, 122, 95, .35);
  outline-offset: 3px;
}
.upload-preview {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #d4e8f2;
  border: 1px solid var(--line);
  border-radius: var(--radius, 8px);
  display: block;
  transition: filter .2s ease, transform .2s ease;
}
.upload-preview-btn.is-empty .upload-preview {
  object-fit: contain;
  background: #f3ebe3;
}
.upload-preview-btn:hover .upload-preview,
.upload-preview-btn:focus-visible .upload-preview {
  filter: brightness(.92);
}
.upload-preview-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  max-width: calc(100% - 1.5rem);
  padding: .85rem 1.15rem;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(224, 122, 95, .28);
}
.upload-preview-hint .bi {
  flex: 0 0 auto;
  font-size: 1.35rem;
}
.upload-preview-btn:not(.is-empty) .upload-preview-hint { display: none; }
.upload-crop-panel {
  width: min(100%, 440px);
}
.upload-crop-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius, 8px);
  background: #111;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: var(--shadow-soft, none);
}
.upload-crop-viewport.is-dragging { cursor: grabbing; }
.upload-crop-viewport:focus-visible {
  outline: 3px solid rgba(224, 122, 95, .35);
  outline-offset: 3px;
}
.upload-crop-viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  box-shadow: inset 0 0 0 2px rgba(184, 217, 235, .85);
  pointer-events: none;
  border-radius: inherit;
}
.upload-crop-image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  display: block;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
}
.upload-crop-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .65rem;
  align-items: center;
  margin-top: .75rem;
}
.upload-crop-zoom-label {
  margin: 0;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 420px) {
  .upload-crop-controls {
    grid-template-columns: auto 1fr;
  }
  .upload-crop-controls .btn {
    grid-column: 1 / -1;
  }
}
.admin-thumb { width: 88px; height: 88px; object-fit: cover; border-radius: 6px; }
.stats-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: block;
}
.stats-thumb-btn {
  display: block;
  flex: 0 0 auto;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 6px;
}
.stats-thumb-btn:hover .stats-thumb,
.stats-photo-item.is-expanded .stats-thumb {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(224, 122, 95, .12);
}
.stats-thumb-empty { display: inline-grid; place-items: center; background: #efe6db; color: #a08e7c; }
.stats-photo-expanded {
  width: 100%;
  margin-top: .75rem;
}
.stats-photo-full {
  width: 100%;
  height: auto;
  max-height: min(80vh, 900px);
  object-fit: contain;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #d4e8f2;
}
.stats-photo-caption { line-height: 1.35; }
.min-width-0 { min-width: 0; }
.section-title { font-size: 1.15rem; font-weight: 750; letter-spacing: -.01em; }
.gallery-controls { padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.breed-list { display: flex; flex-direction: column; gap: 16px; }
.breed-thumb-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.breed-thumb-btn { display: block; flex: 0 0 auto; border: 0; padding: 0; background: none; cursor: pointer; }
.breed-thumb { width: 76px; height: 76px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.breed-thumb-btn:hover .breed-thumb { border-color: var(--green); box-shadow: 0 0 0 2px rgba(224, 122, 95, .12); }
.breed-photos.is-expanded .breed-thumb-grid { display: none; }
.breed-photo-expanded { width: 100%; }
.breed-photo-full { width: 100%; height: auto; max-height: min(80vh, 900px); object-fit: contain; display: block; border-radius: 8px; border: 1px solid var(--line); background: #d4e8f2; }
.breed-photo-caption { line-height: 1.35; }
.photo-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-card h2, .photo-card .small { overflow-wrap: anywhere; }
.photo-published { border-top: 1px solid var(--line); padding-top: 7px; }
.photo-admin-edit {
  --bs-btn-color: var(--muted);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--muted);
  --bs-btn-hover-border-color: var(--muted);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--muted);
  --bs-btn-active-border-color: var(--muted);
  padding: .18rem .5rem;
  font-size: .74rem;
  font-weight: 500;
}
#galleryResults { transition: opacity .15s ease; }
#galleryResults.is-loading { opacity: .45; pointer-events: none; }
#breedResults.is-loading { opacity: .45; pointer-events: none; }

body.game-active {
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100dvh;
  min-height: 100svh;
}
body.game-active .navbar,
body.game-active .game-heading,
body.game-active .game-grid aside,
body.game-active #homeCarouselWrap,
body.game-active #homeTagline,
body.game-active footer { display: none; }
body.game-active main {
  min-height: 100%;
}
body.game-active main > .app-container {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  max-width: 720px;
  min-height: 100%;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
body.game-active .game-grid {
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: calc(100svh - 12px);
}
body.game-active .game-grid > section {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
body.game-active #gamePanel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: calc(100svh - 12px);
}
body.game-active .game-status {
  flex: 0 0 auto;
  min-height: 34px;
  padding-top: .3rem;
  padding-bottom: .3rem;
}
body.game-active .game-status-item > strong { font-size: .88rem; }
body.game-active .dog-photo-wrap {
  flex: 0 1 auto;
  width: min(100%, calc(100svh - 17.75rem));
  max-width: 100%;
  max-height: calc(100svh - 17.75rem);
  aspect-ratio: 1;
  height: auto;
  margin-inline: auto;
  align-self: center;
}
body.game-active .game-controls {
  flex: 0 0 auto;
  padding: .55rem .75rem !important;
}
body.game-active .timer-row { margin-bottom: .45rem !important; }
body.game-active #answers { gap: .4rem !important; }
body.game-active .answer-btn {
  min-height: 2.45rem;
  padding: .55rem .8rem;
  font-size: 1.02rem;
  box-shadow: none;
}
body.game-active .give-up-wrap { margin-top: .4rem !important; }
html:fullscreen,
html:-webkit-full-screen {
  background: var(--paper);
}
html:fullscreen body,
html:-webkit-full-screen body {
  background: var(--paper);
}
html:fullscreen body.game-active .game-grid,
html:-webkit-full-screen body.game-active .game-grid {
  min-height: calc(100svh - 12px);
}
html:fullscreen body.game-active #gamePanel,
html:-webkit-full-screen body.game-active #gamePanel {
  min-height: calc(100svh - 12px);
  border-radius: 0;
}
body.game-active .feedback-message { margin-bottom: .4rem !important; }
body.page-home main > .app-container { padding-top: 1rem !important; }

@media (max-width: 767.98px) {
  main > .app-container { padding-top: 10px !important; padding-bottom: 10px !important; }
  .game-heading { margin-bottom: 10px !important; }
  .game-heading h1 { font-size: 1.2rem; margin-bottom: 0 !important; }
  .game-heading p, .game-heading > span { font-size: .75rem; }
  .game-grid { grid-template-columns: 1fr; gap: 16px; }
  .navbar-brand { font-size: 1.05rem; }
  .navbar-collapse { padding: 8px 0 4px; }
  .navbar-nav .nav-link { padding: 9px 4px; }
  .navbar .fullscreen-btn-label,
  .game-fullscreen .fullscreen-btn-label { display: none; }
  .navbar .fullscreen-btn,
  .game-fullscreen .btn {
    padding-left: .5rem;
    padding-right: .5rem;
  }
  .photo-grid { grid-template-columns: 1fr; gap: 10px; }
  .game-status { min-height: 44px; }
  .game-status-item { gap: .45rem; }
  .dog-photo-wrap { border-radius: 0; }
  body.game-active .dog-photo-wrap {
    width: min(100%, calc(100svh - 16.5rem));
    max-height: calc(100svh - 16.5rem);
  }
  body.game-active .game-controls { padding: .45rem .55rem !important; }
  body.game-active .answer-btn {
    min-height: 2.35rem;
    padding: .48rem .7rem;
    font-size: 1rem;
  }
  #gamePanel .mb-3 { margin-bottom: 8px !important; }
  #answers { gap: .55rem !important; }
  .answer-btn { min-height: 2.7rem; padding: .65rem .9rem; font-size: 1.02rem; }
  .timer-row { margin-bottom: 8px !important; }
  .feedback-message { min-height: 42px; padding: 8px 10px; font-size: .9rem; }
}
