/* Wersja mobilna — spójna kolorystyka z tablicą główną (morze / błękit) */

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

:root {
  --board-text: #0a1e4a;
  --board-border: #3d444c;
  --frame-outer: #2a3038;
  --frame-inner: #6a727c;
  --section-header-bg: rgba(224, 242, 254, 0.88);
  --row-border: #4a5058;
  --mobile-max: 28rem;
  --mobile-emblem: clamp(3.25rem, 14vw, 4.5rem);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body.mobile-board {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: #9aa0a8;
  color: var(--board-text);
}

.mobile-shell {
  width: 100%;
  max-width: var(--mobile-max);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: linear-gradient(165deg, #d4d7dc 0%, #b8bcc4 35%, #c8ccd4 70%, #a8adb6 100%);
  border-left: 4px solid var(--frame-outer);
  border-right: 4px solid var(--frame-outer);
  box-shadow: 0 0 32px rgba(42, 48, 56, 0.22);
}

@media (max-width: 28rem) {
  .mobile-shell {
    border-left: none;
    border-right: none;
    box-shadow: none;
  }
}

/* Tło „morze” — uproszczona wersja tablicy głównej */
.mobile-sea {
  position: relative;
  z-index: 0;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mobile-sea--wave::before,
.mobile-sea--wave::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.mobile-sea--wave::before {
  background: linear-gradient(
    118deg,
    #dbeafe 0%,
    #e0f2fe 12%,
    #bae6fd 24%,
    #f0f9ff 38%,
    #93c5fd 50%,
    #e0f7fa 62%,
    #eff6ff 76%,
    #7dd3fc 88%,
    #dbeafe 100%
  );
  background-size: 320% 320%;
  animation: mobile-sea-flow 14s ease-in-out infinite alternate;
  filter: saturate(1.05);
}

.mobile-sea--wave::after {
  opacity: 0.3;
  background:
    radial-gradient(ellipse 92% 58% at 6% 16%, rgba(56, 189, 248, 0.28) 0%, transparent 50%),
    radial-gradient(ellipse 88% 62% at 96% 88%, rgba(14, 165, 233, 0.24) 0%, transparent 47%),
    radial-gradient(ellipse 68% 48% at 48% 38%, rgba(191, 219, 254, 0.3) 0%, transparent 54%);
  animation: mobile-sea-ripple 10s ease-in-out infinite alternate;
}

@keyframes mobile-sea-flow {
  0% {
    background-position: 8% 22%;
  }
  50% {
    background-position: 62% 38%;
  }
  100% {
    background-position: 32% 58%;
  }
}

@keyframes mobile-sea-ripple {
  0% {
    transform: translate(-1.5%, -1%) scale(1);
    opacity: 0.26;
  }
  100% {
    transform: translate(1.5%, 1.5%) scale(1.02);
    opacity: 0.34;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-sea--wave::before,
  .mobile-sea--wave::after {
    animation: none;
  }
}

.mobile-header,
.mobile-search,
.mobile-results {
  position: relative;
  z-index: 1;
}

.mobile-header {
  padding: 1.25rem 1rem 1rem;
  color: var(--board-text);
}

.mobile-header__brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--mobile-emblem);
  margin-bottom: 0.85rem;
}

.mobile-header__emblem {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--mobile-emblem);
  height: var(--mobile-emblem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-header__emblem--herb {
  left: 0;
  width: var(--mobile-emblem);
  height: auto;
  max-height: var(--mobile-emblem);
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(10, 30, 74, 0.12));
}

.mobile-header__emblem--bip {
  right: 0;
  text-decoration: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(10, 30, 74, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mobile-header__emblem--bip:active {
  transform: translateY(-50%) scale(0.97);
}

.mobile-header__emblem--bip:focus-visible {
  outline: 2px solid var(--board-text);
  outline-offset: 2px;
}

.mobile-header__emblem--bip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mobile-header__titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.12rem;
  width: 100%;
  max-width: 100%;
  padding: 0 calc(var(--mobile-emblem) + 0.4rem);
  text-align: center;
  box-sizing: border-box;
}

.mobile-header__org-line {
  margin: 0;
  font-size: clamp(1rem, 4.2vw, 1.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.mobile-header__title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.mobile-header__hint {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--board-border);
}

.mobile-search {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}

.mobile-search__input {
  flex: 1;
  min-height: 3rem;
  padding: 0 1rem;
  font-size: 1rem;
  color: var(--board-text);
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid var(--board-border);
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(10, 30, 74, 0.08);
}

.mobile-search__input::placeholder {
  color: #6a727c;
}

.mobile-search__input:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
  border-color: var(--board-text);
}

.mobile-search__btn {
  min-height: 3rem;
  padding: 0 1.1rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #d4223a 0%, #b91c1c 100%);
  border: 2px solid #991b1b;
  border-radius: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.25);
}

.mobile-results {
  flex: 1;
  padding: 0 1rem calc(1.25rem + env(safe-area-inset-bottom));
}

.mobile-results__hint,
.mobile-results__empty {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--board-border);
}

.mobile-results__count {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--board-text);
}

.mobile-results__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mobile-result {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 0.5rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 2px 8px rgba(10, 30, 74, 0.1);
  border: 2px solid var(--row-border);
  border-left: 4px solid var(--board-text);
}

.mobile-result__name {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--board-text);
}

.mobile-result__rooms {
  margin-top: 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #c41e3a;
}

.mobile-result__location {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--board-border);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
