:root {
  --bg-dark: #252321;
  --text-primary: rgba(255, 255, 255, 0.94);
  --text-secondary: rgba(255, 255, 255, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.15);
  --accent-gold: #d6af7a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html, body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", sans-serif;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}

/* Единый фон на весь экран (включая область под нижним меню) */
.app-shell {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-dark);
  background-image: url('/fencing_bg.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 62px;
}

/* Главный экран */
.home-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-header {
  padding: calc(14px + env(safe-area-inset-top)) 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-title {
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 4.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-bottom-blocks {
  margin-top: auto;
  padding-bottom: 6px;
}

/* 2x2 Grid */
.grid-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 24px 26px;
}

.grid-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}

.grid-card:active {
  opacity: 0.6;
}

.grid-card:nth-child(1),
.grid-card:nth-child(3) {
  border-right: 0.5px solid var(--border-subtle);
}

.grid-card:nth-child(1),
.grid-card:nth-child(2) {
  border-bottom: 0.5px solid var(--border-subtle);
}

.grid-card svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.85;
}

.card-title {
  font-size: 15px;
  font-weight: 400;
  margin-bottom: 2px;
}

.card-sub {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-secondary);
}

/* Upcoming Events */
.events-section {
  padding: 0 24px 4px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.see-all {
  font-size: 12px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  cursor: pointer;
}

.event-row {
  display: flex;
  align-items: center;
  padding: 8px 0 14px;
  border-bottom: 0.5px solid var(--border-subtle);
  cursor: pointer;
}

.event-row:active {
  opacity: 0.65;
}

.event-date {
  width: 44px;
  text-align: center;
  padding-right: 12px;
  border-right: 0.5px solid var(--border-subtle);
}

.event-date .day-name,
.event-date .month {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-secondary);
}

.event-date .day-num {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.15;
}

.event-info {
  flex: 1;
  padding-left: 16px;
}

.event-name {
  font-size: 16px;
  margin-bottom: 5px;
}

.event-time {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Subpages (с легким затемнением фона для читаемости текста) */
.subpage {
  padding: calc(20px + env(safe-area-inset-top)) 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, rgba(28, 26, 24, 0.82) 0%, rgba(37, 35, 33, 0.92) 40%, rgba(37, 35, 33, 0.65) 100%);
}

.back-btn {
  background: none;
  border: none;
  color: var(--accent-gold);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 24px;
  align-self: flex-start;
  padding: 4px 0;
}

.subpage-title {
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.subpage-desc {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.placeholder-box {
  border: 0.5px solid var(--border-subtle);
  padding: 20px;
  font-size: 13px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Статичное нижнее меню: БЕЗ фона/полосы, прозрачное, опущено максимально вниз */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: transparent;
  border: none;
  box-shadow: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-top: 4px;
  padding-bottom: 10px;
  z-index: 100;
}

.nav-item {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 300;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item .active-indicator {
  width: 42px;
  height: 1.5px;
  background-color: transparent;
  margin-top: 2px;
  transition: background-color 0.2s;
}

.nav-item.active {
  color: var(--accent-gold);
}

.nav-item.active .active-indicator {
  background-color: var(--accent-gold);
}
