/* ============================================================
   INDIEWRIGHT — DESKTOP LAYOUT (desktop.html only)
   Target: optimized for 1440px, usable down to ~1100px.
   ============================================================ */

body { min-width: 1000px; }

.stage.hidden { display: none; }

/* ---------- Splash ---------- */
.splash-desktop {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(213,174,104,0.10), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(100,57,75,0.16), transparent 50%),
    linear-gradient(180deg, #0F1115 0%, #12141B 55%, #0F1115 100%);
}
.splash-desktop .splash-mark { width: 88px; height: 88px; border-radius: 26px; background: linear-gradient(155deg, var(--gold-strong), var(--plum) 130%); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-gold); margin-bottom: 28px; animation: mark-in 900ms var(--ease) both; }
.splash-desktop .splash-mark svg { width: 40px; height: 40px; stroke: #16110A; }
.splash-desktop .splash-name { font-family: var(--font-serif); font-size: 42px; animation: fade-up 900ms 120ms var(--ease) both; }
.splash-desktop .splash-tagline { margin-top: 14px; color: var(--text-secondary); font-size: 17px; max-width: 420px; animation: fade-up 900ms 240ms var(--ease) both; }
.splash-desktop .btn { margin-top: 34px; min-width: 220px; animation: fade-up 900ms 360ms var(--ease) both; }
@keyframes mark-in { from { opacity: 0; transform: translateY(10px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Auth split layout ---------- */
.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 46%) 1fr;
}
@media (max-width: 1099px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
.auth-visual {
  position: relative;
  background:
    radial-gradient(circle at 30% 20%, rgba(213,174,104,0.16), transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(100,57,75,0.4), transparent 55%),
    linear-gradient(165deg, #14161D 0%, #1A1420 60%, #0F1115 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 52px;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.auth-visual::after {
  content: "";
  position: absolute; inset: -20%;
  background: radial-gradient(circle at 50% 50%, transparent 0 40%, rgba(15,17,21,0.5) 70%);
  pointer-events: none;
}
.auth-visual-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-visual-brand .mark-sm { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(155deg, var(--gold-strong), var(--plum) 130%); display: flex; align-items: center; justify-content: center; }
.auth-visual-brand .mark-sm svg { width: 20px; height: 20px; stroke: #16110A; }
.auth-visual-brand span { font-family: var(--font-serif); font-size: 20px; }
.auth-visual-quote { position: relative; z-index: 1; max-width: 420px; }
.auth-visual-quote .display-lg { font-family: var(--font-serif); font-size: 34px; line-height: 1.25; }
.auth-visual-quote p { margin-top: 16px; }
.auth-visual-foot { position: relative; z-index: 1; display: flex; gap: 28px; }
.auth-visual-stat b { display: block; font-family: var(--font-serif); font-size: 22px; color: var(--gold); }
.auth-visual-stat span { font-size: 12px; color: var(--text-tertiary); }

.auth-form-col { display: flex; align-items: center; justify-content: center; padding: 60px 40px; overflow-y: auto; }
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-form-wrap .auth-header h1 { font-size: 30px; }
.auth-form-wrap .authway-row { display: flex; flex-direction: column; gap: 10px; }
.auth-form-wrap .authway-btn { justify-content: flex-start; padding-left: 18px; position: relative; }
.auth-form-wrap .authway-btn .badge { position: absolute; right: 14px; }
.auth-tabs { display: flex; background: var(--surface); border-radius: var(--r-full); padding: 4px; margin-bottom: 26px; }
.auth-tab { flex: 1; text-align: center; padding: 10px 0; border-radius: var(--r-full); background: none; border: none; color: var(--text-tertiary); font-weight: 600; font-size: 13.5px; transition: all var(--fast) var(--ease); }
.auth-tab.is-active { background: var(--gold); color: #1A1408; }
.auth-panel.hidden { display: none; }
.auth-form-wrap form .flex.gap-sm { gap: 14px; }

/* ---------- Role selection (desktop) ---------- */
.role-desktop-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 40px; }
.role-desktop-inner { max-width: 900px; width: 100%; text-align: center; }
.role-desktop-inner h1 { font-size: 32px; margin-top: 10px; }
.role-grid-desktop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 36px; text-align: left; }
.role-grid-desktop .role-card { flex-direction: column; align-items: flex-start; padding: 26px; min-height: 190px; }
.role-grid-desktop .role-card-icon { margin-bottom: 14px; }
.role-grid-desktop .role-card-check { position: absolute; top: 20px; right: 20px; }
.role-grid-desktop .role-card { position: relative; }
.role-grid-desktop .role-card-title { font-size: 17px; }
.role-grid-desktop .role-card-desc { font-size: 13.5px; }
.role-footer-desktop { margin-top: 36px; display: flex; justify-content: center; }
.role-footer-desktop .btn { min-width: 240px; }

/* ---------- App shell (desktop) ---------- */
.app-shell-desktop { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 18px; cursor: pointer; }
.sidebar-brand .mark-sm { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(155deg, var(--gold-strong), var(--plum) 130%); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-brand .mark-sm svg { width: 16px; height: 16px; stroke: #16110A; }
.sidebar-brand span { font-family: var(--font-serif); font-size: 18px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav .nav-item {
  flex-direction: row; justify-content: flex-start; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 600; color: var(--text-secondary);
  position: relative;
}
.sidebar-nav .nav-item:hover { background: rgba(248,247,244,0.04); color: var(--text-primary); }
.sidebar-nav .nav-item.is-active { background: var(--gold-soft); color: var(--gold); }
.sidebar-nav .nav-item.is-active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  background: var(--gold); border-radius: 0 var(--r-full) var(--r-full) 0;
}
.sidebar-nav .nav-item.hidden { display: none; }
.sidebar-section-label { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-tertiary); padding: 14px 12px 6px; }

.sidebar-footer { padding: 14px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); cursor: pointer; }
.sidebar-user:hover { background: rgba(248,247,244,0.04); }
.sidebar-user-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-handle { font-size: 11.5px; color: var(--text-tertiary); }

/* ---------- Main column ---------- */
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.top-header {
  height: 72px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 36px;
  border-bottom: 1px solid var(--border);
  background: rgba(15,17,21,0.86);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.top-search { position: relative; width: 320px; }
.top-search .input { padding-left: 40px; background: var(--card); }
.top-search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); }
.top-header-actions { display: flex; align-items: center; gap: 12px; }

.app-content { flex: 1; min-height: 0; overflow-y: auto; padding: 36px 40px 80px; }
.content-container { max-width: 1180px; margin: 0 auto; }
.app-content [data-view] { animation: fade-up 260ms var(--ease) both; }

.placeholder-screen { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 90px 12px 40px; }
.placeholder-badge { width: 72px; height: 72px; border-radius: 20px; background: var(--card); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--gold); margin-bottom: 22px; }

.home-welcome h1 { font-size: 34px; margin-top: 6px; }
.home-welcome { padding: 4px 0 8px; max-width: 640px; }

/* Profile view (desktop) rendered as a card layout */
.profile-desktop-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; margin-top: 8px; }
@media (max-width: 1099px) { .profile-desktop-grid { grid-template-columns: 1fr; } }

/* ---------- Book rows / grids (desktop) ---------- */
.home-feed { margin-top: 6px; }
.book-row {
  display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none;
  padding: 2px 0 6px;
}
.book-row::-webkit-scrollbar { display: none; }
.book-row[data-variant="standard"] .book-card { width: 172px; }
.book-row[data-variant="continue"] .book-card { width: 280px; }

.explore-header { margin-bottom: 8px; max-width: 720px; }
.explore-header .section-head { margin-bottom: 6px; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 22px 18px; }

/* ---------- Search dropdown (desktop top-header) ---------- */
.search-dropdown-wrap { position: relative; }
.search-dropdown-panel {
  position: absolute; top: calc(100% + 10px); left: 0; width: 420px; max-height: 60vh;
  overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 8px 14px;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
  z-index: 40;
}
.search-dropdown-panel.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.search-dropdown-panel .search-empty { padding: 30px 12px; }

/* ---------- Design system screen (desktop paddings) ---------- */
.ds-screen { position: fixed; inset: 0; background: var(--bg); z-index: 500; display: flex; flex-direction: column; }
.ds-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 44px; border-bottom: 1px solid var(--border); }
.ds-body { flex: 1; overflow-y: auto; padding: 30px 44px 80px; max-width: 1100px; margin: 0 auto; width: 100%; }
.ds-section { margin-bottom: 44px; }
.ds-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); margin-bottom: 16px; }
.ds-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ds-swatch-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.ds-swatch-item { border-radius: var(--r-md); padding: 14px; border: 1px solid var(--border); }
.ds-swatch-chip { height: 46px; border-radius: var(--r-sm); margin-bottom: 8px; }

/* ---------- Book Detail (desktop two-column hero) ---------- */
.detail-topbar { padding: 18px 32px; }
.detail-hero { padding: 36px 40px 8px; }
.detail-hero-info, .detail-section { max-width: 760px; }
@media (min-width: 900px) {
  .detail-hero { display: flex; gap: 40px; align-items: flex-start; max-width: 1040px; margin: 0 auto; }
  .detail-hero-cover { max-width: 260px; margin: 0; flex-shrink: 0; }
  .detail-hero-info { max-width: 620px; margin: 0; }
}
.detail-section { margin-left: auto; margin-right: auto; }
@media (min-width: 900px) { .detail-section { padding-left: 40px; padding-right: 40px; } }

/* ---------- Story Player (desktop stage + side panel) ---------- */
.player-desktop-grid { display: flex; height: 100%; min-height: 0; }
.player-stage-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.player-stage-col .player-visual-stage { min-height: 0; }
.player-side-panel { width: 360px; flex-shrink: 0; border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; }
.player-side-panel .tabs { padding: 0 18px; flex-shrink: 0; }
.player-side-body { flex: 1; overflow-y: auto; padding: 16px 18px 24px; }
.player-bottom-controls { max-width: 640px; margin: 0 auto; width: 100%; }

/* ---------- Mini player (desktop, fixed above main column) ---------- */
.app-content { padding-bottom: 108px; }
.mini-player {
  position: fixed; left: 250px; right: 0; bottom: 0; z-index: 60;
  border-radius: 0; border-width: 1px 0 0; margin: 0; padding: 12px 32px;
  max-width: none;
}
.mini-player-info { max-width: 320px; }

/* Toast stack position (desktop) */
.toast-stack { top: 20px; right: 24px; left: auto; }

/* Google draws its own sign-in button into this mount (see
   mountGoogleButtons). It is an iframe of a fixed width, so it is centred
   rather than stretched — forcing it wider only leaves a gap inside. */
.gsi-mount { display: flex; justify-content: center; width: 100%; }
.gsi-mount > div { max-width: 100%; }
