/* ============================================================
   RRC 이벤트 — app.css
   네이비 + 화이트 (dot은 금색)
   ============================================================ */

:root {
  --bg:       #0a1428;
  --bg2:      #0f1a35;
  --surface:  #142042;
  --surface2: #1a2752;
  --line:     rgba(255,255,255,.08);
  --line2:    rgba(255,255,255,.15);

  --tx:       #ffffff;
  --tx2:      #a4b0c5;
  --tx3:      #5a6582;

  --r:  16px;
  --r2: 12px;
}

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

body {
  background: var(--bg);
  color: var(--tx);
  font-family: 'Pretendard', -apple-system, sans-serif;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#root {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fade { animation: fadeIn .32s ease both; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ============================================================
   상단바
   ============================================================ */
.topbar {
  width: 100%;
  max-width: 480px;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(10,20,40,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 8px; }
.brand b { font-size: 15px; font-weight: 800; letter-spacing: .06em; }
.brand .sub { font-size: 9px; color: var(--tx2); letter-spacing: .1em; line-height: 1; }

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ffd700;
  box-shadow: 0 0 10px rgba(255,215,0,.6);
}

.back-link {
  font-size: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

/* ============================================================
   메인
   ============================================================ */
.main {
  width: 100%;
  max-width: 480px;
  padding: 16px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================================
   이벤트 카드
   ============================================================ */
.event-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  background: var(--surface);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: all .12s;
  position: relative;
  overflow: hidden;
}

.event-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 30%, rgba(255,255,255,.05) 0%, transparent 60%);
  pointer-events: none;
}

.event-card:active { transform: scale(.98); }
.event-card:hover {
  border-color: #fff;
  background: var(--surface2);
}

.event-icon {
  font-size: 36px;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.06);
  border-radius: 12px;
}

.event-info {
  flex: 1;
  min-width: 0;
}

.event-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 4px;
}

.event-desc {
  font-size: 12px;
  color: var(--tx2);
  line-height: 1.4;
}

.event-arrow {
  font-size: 22px;
  color: var(--tx3);
  flex-shrink: 0;
}

.event-date {
  font-size: 10px;
  color: #ffd700;
  font-family: 'DM Mono', monospace;
  margin-top: 6px;
  letter-spacing: .04em;
}

.event-card[data-in-period="false"] {
  opacity: .55;
}

.event-card[data-in-period="false"]:hover {
  opacity: .7;
}

/* 기간 외 모달 */
.event-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}

.event-modal.on { opacity: 1; pointer-events: auto; }

.event-modal-body {
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 20px;
  padding: 32px 24px 24px;
  text-align: center;
  transform: scale(.92);
  transition: transform .22s;
}

.event-modal.on .event-modal-body { transform: scale(1); }

.event-modal-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

.event-modal-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.event-modal-desc {
  font-size: 13px;
  color: var(--tx2);
  margin-bottom: 20px;
  line-height: 1.6;
}

.event-modal-close {
  width: 100%;
  padding: 12px;
  background: #fff;
  border: none;
  border-radius: 10px;
  color: #0a1428;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ============================================================
   어드민
   ============================================================ */
.admin {
  width: 100%;
  max-width: 480px;
  padding: 24px 16px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #fff;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.row:last-child { margin-bottom: 0; }
.row label { font-size: 12px; font-weight: 600; color: var(--tx2); }

.si {
  background: var(--surface2);
  border: 1.5px solid var(--line2);
  border-radius: 10px;
  color: var(--tx);
  font-family: 'Pretendard', sans-serif;
  font-size: 13px;
  padding: 9px 11px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .18s;
}

.si:focus { border-color: #fff; }

.sb {
  background: var(--surface2);
  border: 1px solid var(--line2);
  border-radius: 10px;
  color: var(--tx);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.sb:hover { background: #243762; }
.sb.danger { color: #ff8a73; border-color: rgba(255,138,115,.3); }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--r2);
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .12s;
}

.btn:active { transform: scale(.97); opacity: .85; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn-acc { background: #fff; color: #0a1428; }
.btn-ghost { background: var(--surface2); color: var(--tx); border: 1px solid var(--line2); }

.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--line2);
  border-radius: 10px;
  margin-bottom: 8px;
}

.event-row:last-child { margin-bottom: 0; }
.event-row.hidden-event { opacity: .5; }

.event-row-info { flex: 1; min-width: 0; }
.event-row-name { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.event-row-desc { font-size: 11px; color: var(--tx2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.event-row-actions { display: flex; gap: 4px; flex-shrink: 0; }

.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--tx2);
  font-size: 13px;
  line-height: 1.7;
}

.foot {
  margin-top: 20px;
  text-align: center;
}

.adminlink {
  font-size: 10px;
  color: var(--tx3);
  text-decoration: none;
  letter-spacing: .12em;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color .15s;
}

.adminlink:hover { color: var(--tx2); }

#toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--line2);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  z-index: 99;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  white-space: nowrap;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .main, .admin { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
}

/* ============================================================
   PC 반응형 (768px 이상)
   ============================================================ */
@media (min-width: 768px) {
  .topbar {
    max-width: 720px !important;
    padding: 20px 32px !important;
  }

  .brand b { font-size: 17px; }
  .brand .sub { font-size: 10px; }

  .back-link { font-size: 14px; }

  .main {
    max-width: 720px !important;
    padding: 32px !important;
    gap: 16px !important;
  }

  .event-card {
    padding: 24px 28px !important;
    gap: 20px !important;
    border-radius: 18px !important;
  }

  .event-icon {
    font-size: 48px !important;
    width: 72px !important;
    height: 72px !important;
    border-radius: 16px !important;
  }

  .event-name { font-size: 20px !important; }
  .event-desc { font-size: 14px !important; }
  .event-date { font-size: 12px !important; margin-top: 8px !important; }

  .event-arrow { font-size: 28px !important; }

  /* 기간 외 모달 */
  .event-modal-body {
    max-width: 400px !important;
    padding: 40px 32px 28px !important;
  }

  .event-modal-icon { font-size: 52px !important; }
  .event-modal-title { font-size: 19px !important; }
  .event-modal-desc { font-size: 14px !important; }
}
