/* ============================================================
   American Legion Post 10 — Hospitality Room — Patriotic Theme
   ============================================================ */

:root {
  --navy:        #1a237e;
  --navy-mid:    #131d78;
  --navy-dark:   #090e4c;
  --navy-deeper: #04082a;
  --red:         #c62828;
  --gold:        #f9a825;
  --gold-muted:  #c8860b;
  --white:       #ffffff;
  --dim:         rgba(255, 255, 255, 0.72);
  --dimmer:      rgba(255, 255, 255, 0.44);
  --divider:     rgba(255, 255, 255, 0.1);
  --shadow:      0 6px 28px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background-color: var(--navy-deeper);
  background-image:
    radial-gradient(ellipse 140% 55% at 50% -2%, rgba(26,35,126,0.8) 0%, transparent 68%);
  color: var(--white);
  font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
}

/* Faint tiled star texture — decorative */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='70' height='70' viewBox='0 0 70 70' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='35,8 39,22 54,22 42,32 46,46 35,38 24,46 28,32 16,22 31,22' fill='rgba(249%2C168%2C37%2C0.025)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

main, header { position: relative; z-index: 1; }

/* ---- Header ---- */

header {
  background: linear-gradient(180deg, #1e2b9c 0%, #1a237e 100%);
  border-bottom: 3px solid var(--red);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  position: relative;
  z-index: 2;
}

header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, var(--gold) 70%, transparent 100%);
  opacity: 0.55;
}

.al-emblem {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 6px rgba(0,0,0,0.65));
}

.header-text { flex: 1; min-width: 0; }

.header-title {
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.1;
}

.header-room {
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 3px;
}

.header-stars {
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.22em;
  opacity: 0.6;
  flex-shrink: 0;
}

@media (max-width: 680px) {
  .header-stars { display: none; }
  .header-title { font-size: 1.02rem; }
}

/* ---- Cards ---- */

.card {
  background: linear-gradient(150deg, #1e2baa 0%, #1a237e 40%, #13195c 100%);
  border-radius: 8px;
  border: 1px solid rgba(249, 168, 37, 0.18);
  border-top: 3px solid var(--red);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.04);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-divider {
  height: 2px;
  background: linear-gradient(90deg, var(--red) 0%, rgba(198,40,40,0.25) 60%, transparent 100%);
  margin: 10px 0 14px;
  border-radius: 1px;
  flex-shrink: 0;
}

/* ---- Section headers ---- */

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding-bottom: 9px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(249, 168, 37, 0.28);
  flex-shrink: 0;
}

.section-header::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--red);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ---- TV Layout ≥ 1024px ---- */

@media (min-width: 1024px) {
  /* Only the display board is locked to the viewport; admin must scroll. */
  body:not(.admin-body) { overflow: hidden; }

  .main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    padding: 12px;
    height: calc(100vh - 63px);
  }

  .phone-only { display: none !important; }
  .card { padding: 18px 24px; }
  .section-header { font-size: 0.76rem; }
}

/* ---- Phone Layout < 1024px ---- */

@media (max-width: 1023px) {
  .main-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }
  .phone-only {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 12px 20px;
  }
}

/* ---- 50/50 Pot ---- */

#pot-hours-card #pot-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
}

#pot-hours-card #pot-section .section-header {
  justify-content: center;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 4px;
  letter-spacing: 0.22em;
  opacity: 0.75;
}
#pot-hours-card #pot-section .section-header::before { display: none; }

.pot-amount {
  font-size: clamp(54px, 7.5vw, 130px);
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  text-shadow:
    0 0 50px rgba(249, 168, 37, 0.45),
    0 0 100px rgba(249, 168, 37, 0.15),
    0 3px 12px rgba(0, 0, 0, 0.65);
  padding: 4px 0;
}

@media (max-width: 1023px) { .pot-amount { font-size: 68px; } }

.pot-winner {
  margin-top: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  text-align: center;
}
.pot-winner-label {
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-right: 6px;
}

/* ---- Hours + Taps ---- */

.hours-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--divider);
  gap: 8px;
}

.hours-label {
  color: var(--dimmer);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.hours-time { font-weight: 600; font-size: 0.95rem; }

.taps-line {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(198, 40, 40, 0.2);
  border-left: 4px solid var(--red);
  border-radius: 0 5px 5px 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.taps-word {
  color: var(--gold);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.taps-detail {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 600;
}

@media (min-width: 1024px) {
  .taps-word { font-size: 2rem; }
  .taps-detail { font-size: 1.2rem; }
}

/* ---- Yesterday's Winners ---- */

#winners-card #winners-content {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.yw-label {
  color: var(--gold);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 4px;
}

.yw-fiftyfifty {
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 12px;
}

.yw-name {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.15;
}
@media (min-width: 1024px) { .yw-name { font-size: 1.9rem; } }

.yw-raffle-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--divider);
}
.yw-raffle-row:last-child { border-bottom: none; }

.yw-num {
  flex-shrink: 0;
  color: var(--gold);
  font-weight: 800;
  font-size: 0.85rem;
  min-width: 30px;
}
.yw-item { flex: 1; font-weight: 600; font-size: 0.95rem; }
.yw-winner { color: var(--dim); font-size: 0.9rem; text-align: right; }
.yw-empty { color: var(--dimmer); font-style: italic; font-size: 0.88rem; padding: 6px 0; }

/* ---- Specialty Drinks ---- */

.drinks-freeform {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  column-gap: 22px;
}
@media (min-width: 1024px) {
  .drinks-freeform { column-count: 2; }
}

.drink-line {
  padding: 5px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 1rem;
  line-height: 1.35;
  break-inside: avoid;
}
.drink-empty { color: var(--dimmer); font-style: italic; }

/* ---- Menu ---- */

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.menu-day h3 {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(249, 168, 37, 0.28);
}

.menu-text {
  font-size: 0.9rem;
  white-space: pre-wrap;
  line-height: 1.55;
  color: var(--dim);
}

/* ---- Today's Raffle Items (phone) ---- */

.raffle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.raffle-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(249, 168, 37, 0.25);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  position: relative;
}
.raffle-card.won { border-color: var(--gold); box-shadow: 0 0 16px rgba(249,168,37,0.25); }

.raffle-num {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--red);
  color: var(--white);
  font-weight: 800;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
}

.raffle-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.raffle-nophoto {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 6px;
  color: var(--dimmer);
  font-size: 0.8rem;
  font-style: italic;
}

.raffle-name { margin-top: 8px; font-size: 0.92rem; font-weight: 600; }
.raffle-winner {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 700;
}

/* ---- Schedule / Itinerary (phone) ---- */

.schedule-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-shrink: 0; }

.tab-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(249, 168, 37, 0.4);
  color: var(--gold);
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.tab-btn.active {
  background: var(--gold);
  color: var(--navy-dark);
  border-color: var(--gold);
  font-weight: 800;
  box-shadow: 0 2px 12px rgba(249, 168, 37, 0.4);
}

.schedule-list { list-style: none; max-height: 420px; overflow-y: auto; }

.schedule-list li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
  align-items: flex-start;
}
.schedule-list li:last-child { border-bottom: none; }

.sched-time {
  flex-shrink: 0;
  width: 64px;
  text-align: right;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.sched-body { flex: 1; }
.sched-title { font-size: 0.88rem; font-weight: 600; line-height: 1.3; }
.sched-desc {
  margin-top: 3px;
  color: var(--dimmer);
  font-size: 0.76rem;
  font-style: italic;
  line-height: 1.4;
}
.schedule-empty { color: var(--dimmer); font-style: italic; font-size: 0.88rem; padding: 8px 0; }

/* ---- Facebook link (phone) ---- */

.fb-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(249,168,37,0.3);
  border-radius: 6px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}
.fb-link:active { opacity: 0.7; }

/* ---- Visitor counter footer (phone) ---- */

.visit-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 0 4px;
  color: var(--dimmer);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.visit-sep { opacity: 0.5; }

/* ============================================================
   Admin page
   ============================================================ */

.admin-body { height: auto; min-height: 100%; overflow-y: auto; }

.admin-container { max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }

.admin-section {
  background: linear-gradient(150deg, #1e2baa 0%, #1a237e 40%, #13195c 100%);
  border-radius: 8px;
  border: 1px solid rgba(249, 168, 37, 0.15);
  border-top: 3px solid var(--red);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.admin-section h2 {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(249, 168, 37, 0.22);
  padding-bottom: 10px;
}

.hint {
  color: var(--dimmer);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  color: var(--dimmer);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px 11px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: var(--white);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold-muted);
  box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.14);
}
.form-group input[type="time"] { max-width: 160px; }
.form-group input[type="number"] { max-width: 140px; }
.form-group textarea { min-height: 80px; resize: vertical; }

.form-inline { display: flex; gap: 16px; flex-wrap: wrap; }
.form-inline .form-group { flex: 1; min-width: 200px; }

.btn {
  padding: 9px 22px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:hover  { opacity: 0.88; }
.btn:active { opacity: 0.72; transform: scale(0.98); }

.btn-primary { background: var(--red);  color: var(--white); }
.btn-success { background: #2e7d32;     color: var(--white); }
.btn-danger  { background: #4a148c;     color: var(--white); font-size: 0.72rem; padding: 6px 12px; }

.save-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 20px;
  position: sticky;
  bottom: 0;
  background: rgba(9, 14, 76, 0.92);
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(249,168,37,0.2);
  backdrop-filter: blur(4px);
}
#status-message { font-size: 0.92rem; font-weight: 600; }

/* ---- Raffle item config rows ---- */

.raffle-cfg-head,
.raffle-cfg-row {
  display: grid;
  grid-template-columns: 64px 56px 50px 1fr 1fr 86px;
  gap: 8px;
  align-items: center;
}

.raffle-cfg-head {
  color: var(--dimmer);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 8px;
}

.raffle-cfg-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
}

.raffle-cfg-row input {
  width: 100%;
  padding: 7px 9px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  color: var(--white);
  font-size: 0.9rem;
  font-family: inherit;
}
.raffle-cfg-row input:focus { outline: none; border-color: var(--gold-muted); }

.rc-photo img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(249, 168, 37, 0.3);
  display: block;
}
.no-photo { color: var(--dimmer); font-size: 1.2rem; padding-left: 18px; }

@media (max-width: 720px) {
  .raffle-cfg-head { display: none; }
  .raffle-cfg-row {
    grid-template-columns: 56px 1fr 1fr;
    gap: 8px;
  }
  .rc-photo { grid-row: span 2; }
}

#login-error { color: #ef5350; font-size: 0.88rem; margin-left: 10px; }
