/*
  layout-mobile.css
  Revamped mobile-first experience for Web Vibe World.
  Prioritizes readability, reachability, and finger-friendly controls.
*/

:root {
  --mobile-safe-top: calc(env(safe-area-inset-top, 0px) + 14px);
  --mobile-safe-bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  --mobile-card-width: min(96vw, 560px);
  --mobile-card-radius: 20px;
  --mobile-card-blur: blur(14px);
  --mobile-card-bg: rgba(6, 18, 30, 0.82);
  --mobile-card-border: rgba(255, 255, 255, 0.16);
  --mobile-card-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  --mobile-panel-height: min(90vh, 720px);
  --mobile-accent: #6cf;
  --mobile-warm: #ffc040;
}

body {
  position: relative;
  font-size: 17px;
  line-height: 1.6;
  color: #f0fbff;
  letter-spacing: 0.01em;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 28% 18%, rgba(41, 152, 255, 0.25), transparent 55%),
    linear-gradient(180deg, rgba(2, 10, 18, 0.85), rgba(2, 10, 18, 0.2) 45%, transparent);
  z-index: 1;
  pointer-events: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

button {
  touch-action: manipulation;
}

.app-brand,
#discoverPanel,
.add-page-panel,
.feedback-panel,
#hoverBox,
#pinnedHoverBox {
  background: var(--mobile-card-bg);
  border: 1px solid var(--mobile-card-border);
  border-radius: var(--mobile-card-radius);
  backdrop-filter: var(--mobile-card-blur);
  box-shadow: var(--mobile-card-shadow);
}

.app-brand {
  position: fixed;
  top: var(--mobile-safe-top);
  left: 50%;
  transform: translateX(-50%);
  width: min(75vw, 645px);
  max-width: min(75vw, 645px);
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  text-align: center;
  z-index: 80;
  pointer-events: none;
  user-select: none;
}

.brand-name {
  font-size: 1.12rem;
  letter-spacing: 0.2em;
}

.brand-tagline {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: none;
  opacity: 0.85;
}

#pointCount {
  position: static;
  width: 100%;
  margin: 0;
  padding-top: 12px;
  background: none;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
}

#discoverPanel {
  position: fixed;
  top: auto;
  bottom: calc(var(--mobile-safe-bottom) + 32px);
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  width: var(--mobile-card-width);
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 80;
}

.discover-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  font-size: 1.05rem;
}

.discover-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.discover-form .text-filter-wrapper {
  width: 100%;
  min-width: 0;
}

#textFilterInput {
  width: 100%;
  padding: 20px 60px 20px 24px;
  border-radius: 16px;
  border: 1px solid var(--mobile-card-border);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  font-size: 1.12rem;
}

#textFilterInput::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.text-filter-wrapper.has-value #textFilterInput {
  border-color: rgba(255, 196, 64, 0.5);
  background: rgba(255, 196, 64, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 196, 64, 0.25);
}

#textFilterClear {
  display: block;
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 24px;
  line-height: 1;
  padding: 4px;
  opacity: 0;
  pointer-events: none;
}

.text-filter-wrapper.has-value #textFilterClear {
  color: rgba(255, 196, 64, 0.95);
  opacity: 1;
  pointer-events: auto;
}

#textFilterButton {
  width: 100%;
  border-radius: 18px;
  padding: 20px;
  font-size: 1.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.45);
}

#textFilterButton:disabled {
  opacity: 0.65;
}

#hoverBox {
  display: none !important;
}

#pinnedHoverBox {
  position: absolute;
  width: min(98vw, 720px);
  max-width: min(98vw, 720px);
  max-height: calc(100vh - var(--mobile-safe-top) - var(--mobile-safe-bottom) - 48px);
  padding: 30px 36px 38px;
  font-size: 1.32rem;
  line-height: 1.7;
  border-radius: 32px;
  transform: translate(-50%, calc(-100% - 42px + var(--pinned-hover-offset, 0px)));
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.68),
    0 0 36px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 120;
}

#pinnedHoverBox .preview-media--pinned img {
  max-height: 320px;
}

#pinnedHoverBox strong {
  font-size: 1.6rem;
  margin-bottom: 14px;
}

#pinnedHoverBox p {
  font-size: 1.15rem;
  line-height: 1.7;
}

.add-page-button,
.feedback-toggle,
.info-panel-fab {
  position: fixed;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  z-index: 100;
}

.add-page-button-icon,
.feedback-toggle-icon,
.info-panel-fab-icon {
  font-size: 36px;
  line-height: 1;
}

.add-page-button-icon {
  font-size: 44px;
}

.add-page-button {
  top: calc(var(--mobile-safe-top));
  right: 16px;
  bottom: auto;
  left: auto;
}

.feedback-toggle {
  bottom: calc(var(--mobile-safe-bottom) + 24px);
  left: 16px;
  right: auto;
  top: auto;
}

.info-panel-fab {
  bottom: calc(var(--mobile-safe-bottom) + 24px);
  right: 16px;
  left: auto;
  top: auto;
}

.next-site-button {
  position: fixed;
  top: calc(var(--mobile-safe-top) + 138px);
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  width: var(--mobile-card-width);
  max-width: 520px;
  height: 66px;
  border-radius: 999px;
  font-size: 1.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.45);
  z-index: 92;
}

#infoPanel {
  position: fixed;
  top: auto;
  right: 0;
  left: 0;
  bottom: 0;
  width: 100vw;
  min-width: 0;
  max-width: none;
  height: var(--mobile-panel-height);
  max-height: calc(100vh - var(--mobile-safe-top) - 16px);
  padding: 34px 36px calc(var(--mobile-safe-bottom) + 40px);
  border-radius: 28px 28px 0 0;
  border-left: none;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 -32px 64px rgba(0, 0, 0, 0.7);
  background: rgba(2, 10, 18, 0.96);
  z-index: 93;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  font-size: 1.18rem;
  line-height: 1.7;
}

#infoPanel h2 {
  font-size: 1.85rem;
}

.info-panel-heading {
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

.info-panel-heading .share-card-button {
  width: 100%;
}

.info-panel-details {
  gap: 18px;
}

.add-page-panel,
.feedback-panel {
  position: fixed;
  top: calc(var(--mobile-safe-top) + 10px);
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 94vw);
  max-height: calc(100vh - var(--mobile-safe-top) - var(--mobile-safe-bottom) - 20px);
  padding: 26px 24px;
  border-radius: 26px;
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 120;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.add-page-panel {
  gap: 18px;
}

.add-page-panel-close,
.feedback-panel-close {
  top: 18px;
  right: 18px;
  font-size: 28px;
}

.add-page-panel-header,
.feedback-panel-header {
  padding-right: 48px;
}

.add-page-panel-title,
.feedback-panel-header h2 {
  font-size: 1.3rem;
}

.add-page-panel-copy,
.feedback-panel-header p {
  font-size: 0.95rem;
  line-height: 1.4;
}

.add-page-form,
.feedback-form {
  gap: 16px;
}

.add-page-field,
.feedback-field {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.add-page-field input,
.feedback-field input,
.feedback-field select,
.feedback-field textarea {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  padding: 16px 18px;
  color: inherit;
  font-size: 1.05rem;
}

.tag-input {
  padding: 10px;
  border-radius: 16px;
}

.tag-input input {
  font-size: 1.05rem;
}

.add-page-submit,
.feedback-submit {
  height: 60px;
  border-radius: 999px;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
}

.feedback-panel {
  bottom: auto;
}

.feedback-panel.is-open {
  display: flex;
}

#hoverBox {
  border-radius: 18px;
}

#pinnedHoverBox {
  border-radius: 18px;
}

#infoPanel.is-open {
  display: block;
}

.marker-single,
.marker-focused {
  width: 28px;
  height: 28px;
}

.marker-focused::after {
  inset: -14px;
}

.marker-cluster {
  min-width: 44px;
  min-height: 44px;
  font-size: 16px;
}
