/* ------------------------------------------------------------
 * layout.css
 * - 앱 기본 레이아웃/탭 구조/공통 패널 뼈대
 * ------------------------------------------------------------ */

.app-shell{
  width:min(100%, 460px);
  margin:0 auto;
  min-height:100vh;
  padding:10px 12px calc(96px + env(safe-area-inset-bottom));
}

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  padding:2px 0 12px;
  background:linear-gradient(180deg, rgba(251,251,249,0.98), rgba(251,251,249,0.84), rgba(251,251,249,0));
  backdrop-filter:blur(10px);
}

.topbar-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 40px;
  gap:8px;
  width:100%;
  align-items:center;
}

.status-chip{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:100%;
  min-height:40px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(208,216,210,0.9);
  background:rgba(255,255,255,0.94);
  box-shadow:var(--shadow-soft);
  color:var(--text);
  font-size:12px;
  font-weight:700;
  line-height:1.45;
  text-align:center;
}

.page{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.app-shell,
.page,
.tab-view,
.result-wrap,
.result-panel,
.board-frame,
.board-paper,
.panel-frame,
.panel-paper{
  min-width:0;
  max-width:100%;
}

.tab-view{display:none}
.tab-view.tab-active{
  display:block;
  animation:tabFade .2s ease-out;
}

@keyframes tabFade{
  from{opacity:0;transform:translateY(6px)}
  to{opacity:1;transform:translateY(0)}
}

.hero-board,
.result-panel,
.site-footnote{
  margin:0;
}

.result-wrap{
  margin-top:18px;
}

.topbar-settings-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border:1px solid rgba(208,216,210,0.9);
  border-radius:999px;
  background:rgba(255,255,255,0.94);
  color:var(--text-soft);
  box-shadow:var(--shadow-soft);
  font-size:17px;
  font-weight:900;
}

.result-panel--open .panel-frame{
  padding:0;
  border-radius:0;
  background:none;
  box-shadow:none;
}

.result-panel--open .panel-paper{
  padding:0;
  border-radius:0;
  background:none;
  overflow:visible;
}

.result-panel--feed{
  margin-inline:-2px;
}

.feed-header{
  margin-bottom:14px;
  padding-inline:4px;
}

.feed-header h2{
  font-size:24px;
  letter-spacing:-0.05em;
}

.board-frame,
.panel-frame{
  padding:2px;
  border-radius:var(--radius-2xl);
  background:linear-gradient(180deg, rgba(241,243,238,0.98), rgba(223,227,220,0.98));
  box-shadow:var(--shadow-card);
}

.board-paper,
.panel-paper{
  border-radius:calc(var(--radius-2xl) - 3px);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.94) 0, rgba(255,255,255,0) 18%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,249,246,0.98));
  padding:16px;
  overflow:hidden;
}

.result-wrap,
.info-boxes,
.storage-list,
.shared-lotto-list,
.online-history-list{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.bottom-tabbar{
  position:fixed;
  left:50%;
  bottom:max(10px, env(safe-area-inset-bottom));
  transform:translateX(-50%);
  z-index:30;
  width:min(calc(100% - 18px), 430px);
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:4px;
  padding:6px;
  border-radius:22px;
  border:1px solid rgba(208,216,210,0.88);
  background:rgba(255,255,255,0.94);
  box-shadow:var(--shadow-floating);
  backdrop-filter:blur(14px);
}

.tab-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-height:42px;
  border:0;
  border-radius:14px;
  background:transparent;
  color:var(--text-soft);
  font-size:11px;
  font-weight:700;
  letter-spacing:-0.02em;
  transition:transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.tab-btn:active{transform:translateY(1px) scale(.985)}
.tab-btn.active{
  background:linear-gradient(180deg, #34d0aa 0%, #20b892 100%);
  color:#ffffff;
  box-shadow:0 10px 18px rgba(31,180,143,0.22), inset 0 1px 0 rgba(255,255,255,0.24);
}

.tab-btn-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:16px;
  height:16px;
  flex:0 0 auto;
}

.tab-btn-icon svg{
  width:16px;
  height:16px;
  display:block;
}

.tab-btn-label{
  line-height:1;
}

.site-footnote{
  margin-top:6px;
  padding:10px 8px 2px;
  color:var(--text-soft);
  font-size:12px;
  line-height:1.7;
  text-align:center;
}
.boot-splash{
  position:fixed;
  inset:0;
  z-index:120;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:
    radial-gradient(circle at top left, rgba(42,193,160,0.12), rgba(42,193,160,0) 32%),
    linear-gradient(180deg, #fbfbf9 0%, #f3f5f1 100%);
  transition:opacity .28s ease, visibility .28s ease;
}
.boot-splash.is-hidden{
  opacity:0;
  visibility:hidden;
}
.boot-splash-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  text-align:center;
}
.boot-splash-logo{
  width:88px;
  height:88px;
  border-radius:24px;
  box-shadow:0 18px 36px rgba(20,28,26,0.1);
}
.boot-splash-title{
  color:var(--text-strong);
  font-size:24px;
  font-weight:700;
  letter-spacing:-0.04em;
}
.boot-splash-copy{
  color:var(--text-soft);
  font-size:13px;
  font-weight:500;
}
.app-toast{
  position:fixed;
  left:50%;
  bottom:calc(92px + env(safe-area-inset-bottom));
  z-index:110;
  max-width:min(calc(100% - 40px), 320px);
  padding:11px 16px;
  border-radius:999px;
  background:rgba(16,21,20,0.92);
  color:#ffffff;
  font-size:12px;
  line-height:1.45;
  font-weight:600;
  text-align:center;
  box-shadow:0 16px 32px rgba(20,28,26,0.2);
  transform:translateX(-50%) translateY(10px);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
}
.app-toast.is-visible{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}
.online-subview{display:none}
.online-subview.online-subview-active{display:block}

@media (max-width:380px){
  .app-shell{padding-left:10px;padding-right:10px}
  .board-paper,.panel-paper{padding:14px}
  .status-chip{font-size:11px;padding-inline:12px}
  .feed-header h2{font-size:22px}
  .bottom-tabbar{gap:3px;padding:5px}
  .tab-btn{min-height:40px;font-size:10px}
  .tab-btn-icon,
  .tab-btn-icon svg{width:15px;height:15px}
  .boot-splash-logo{width:76px;height:76px;border-radius:20px}
  .boot-splash-title{font-size:22px}
  .app-toast{bottom:calc(88px + env(safe-area-inset-bottom));font-size:11px}
}
