/* v18.7: desktop workspaces and a pearl-trimmed ribbon masthead. */
@media (min-width:1024px) {
  :root {
    --desktop-header-height:60px;
    --desktop-panel-top:76px;
    --desktop-border:#eed7e2;
    --desktop-shadow:0 4px 16px #b8688c0c;
  }
  html { scroll-padding-top:76px; }
  .app-wrap,
  body.is-voices-tab .app-wrap { width:100%; max-width:1440px; padding:0 24px 28px; }
  .masthead,
  body.is-voices-tab .masthead {
    position:sticky; top:0; z-index:31; height:var(--desktop-header-height);
    isolation:isolate;
    background:
      radial-gradient(circle at 6px 0,transparent 3px,#fff 3.5px,#fff 5px,#ebbed0 5.5px,transparent 6px) left bottom/12px 7px repeat-x,
      radial-gradient(ellipse at center,#fffafd 12%,#fffafd00 64%),
      linear-gradient(90deg,#f9d7e7 0%,#fff1f8 18%,#fff5fb 50%,#fff1f8 82%,#f9d7e7 100%) #fff5fb;
    box-shadow:inset 0 1px #fff,inset 0 -1px #eab9ce,0 3px 10px #b86a9012;
  }
  /* Absolute ornaments reserve 220px for the bow and never change the sticky row height. */
  .masthead::before,
  .masthead::after {
    content:''; position:absolute; top:3px; bottom:8px; z-index:0;
    width:calc(50% - 110px); pointer-events:none;
    background:url('/assets/desktop-masthead-ornaments.svg') center/contain no-repeat;
  }
  .masthead::before { left:0; }
  .masthead::after { right:0; transform:scaleX(-1); }
  .masthead img,
  body.is-voices-tab .masthead img {
    position:relative; z-index:1; flex-shrink:0;
    width:180px; height:60px; max-width:none; transform:none;
  }
  .tabs.tabs-four::before {
    content:'心恋きゅん\A 生誕祭 2026'; white-space:pre-line;
    display:block; margin:0 8px 10px; padding:0 4px 18px;
    border-bottom:1px solid #eedde6; color:#a33e6d;
    font-size:15px; font-weight:700; line-height:1.75; letter-spacing:.025em;
  }
  .tabs-four .tab { min-height:48px; border-radius:10px; font-size:13px; }
  .tabs-four .tab .icon { width:20px; height:20px; }
  .footer { margin:24px 0 0; padding-top:16px; border-top:1px solid #efdae5; font-size:11px; }
  #homePage,
  #voicesPage { padding-top:16px; }

  /* Home: the visual and profile form one column; upcoming events have their own side panel. */
  #homePage {
    display:grid; grid-template-columns:minmax(0,1fr) clamp(280px,25vw,360px);
    grid-template-areas:'hero schedule' 'profile schedule';
    gap:18px 20px; align-items:start;
  }
  #homePage .home-grid { display:contents; }
  #homePage .home-hero {
    grid-area:hero; height:450px; min-width:0; margin:0;
    border:1px solid var(--desktop-border); border-radius:18px;
    background:linear-gradient(140deg,#fffafd 15%,#ffeaf5 100%); box-shadow:var(--desktop-shadow);
  }
  #homePage .home-title { left:12px; top:20px; width:205px; color:#cc4f86; filter:none; }
  #homePage .home-title > .icon { width:37px; height:28px; margin-bottom:2px; }
  #homePage .home-title h1 { font-size:64px; line-height:.92; text-shadow:0 2px #fff; }
  #homePage .home-title .name-line { gap:5px; }
  #homePage .home-title .name-line .icon { font-size:27px; }
  #homePage .countdown { left:6px; bottom:4px; width:220px; }
  #homePage .countdown-content { inset:32% 18% auto; }
  #homePage .countdown-label { font-size:15px; line-height:1.3; }
  #homePage .countdown-number { font-size:15px; gap:3px; margin-top:3px; }
  #homePage .countdown-number > span { font-size:44px; }
  #homePage .countdown-number small { font-size:14px; }
  #homePage .countdown-number.digits-3 > span { font-size:29px; }
  #homePage .countdown-number.digits-4 > span { font-size:23px; }
  #homePage .countdown-number.digits-5 > span { font-size:18px; }
  #homePage .countdown-number.celebration { font-size:17px; margin:6px -4px 0; }
  #homePage .countdown-number.celebration > span { font:inherit; line-height:1.4; }
  #homePage .countdown-note { font-size:9px; line-height:1.5; margin:5px -4px 0; }
  #homePage .lace-card {
    min-width:0; border:1px solid var(--desktop-border); border-radius:16px;
    background:#fffafd; box-shadow:var(--desktop-shadow);
  }
  #homePage .lace-card::before { display:none; }
  #homePage .profile-card {
    grid-area:profile; position:static; display:grid; grid-template-columns:minmax(0,1fr) auto;
    gap:12px 10px; align-items:center; padding:16px 18px;
  }
  #homePage .profile-card .card-bow { display:none; }
  #homePage .profile-name { grid-column:1; grid-row:1; justify-content:flex-start; font-size:20px; gap:6px; margin:0; }
  #homePage .profile-info { grid-column:1/-1; grid-row:2; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; border:0; }
  #homePage .profile-row { min-width:0; gap:7px; padding:0; border:0; }
  #homePage .profile-row > .icon { font-size:18px; }
  #homePage .profile-row span:not(.icon) { font-size:10px; }
  #homePage .profile-row strong { font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
  #homePage .profile-link { grid-column:2; grid-row:1; min-height:32px; margin:0; padding:5px 9px; border-radius:9px; font-size:11px; gap:4px; }
  #homePage .live-card {
    grid-area:schedule; position:sticky; top:var(--desktop-panel-top);
    display:flex; flex-direction:column; max-height:calc(100dvh - 96px); padding:18px;
  }
  #homePage .live-heading { flex:0 0 auto; justify-content:flex-start; margin:0 0 14px; font-size:20px; gap:7px; }
  #homePage .schedule-list { min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; gap:8px; padding:1px 3px 3px 1px; }
  #homePage .live-item { grid-template-columns:64px minmax(0,1fr); gap:4px 8px; padding:10px; border-radius:10px; box-shadow:none; }
  #homePage .live-date { font-size:10px; padding:4px 1px; }
  #homePage .live-event-title { font-size:13px; line-height:1.6; }
  #homePage .live-sub { font-size:11px; margin-top:4px; }
  #homePage .live-time { font-size:10px; }
  #homePage .live-links { gap:5px; }
  #homePage .live-links a { min-height:28px; padding:3px 8px; border-radius:7px; font-size:10px; }
  #homePage .source-note { flex:0 0 auto; margin-top:12px; padding-top:10px; text-align:left; font-size:11px; }
  #homePage .source-note a { justify-content:flex-start; }
  #homePage .source-note > span { font-size:9px; }

  /* Community: align the heading like a desktop list while preserving the five-column overview. */
  #voicesListScreen.voices-panel { border:1px solid var(--desktop-border); border-radius:16px; box-shadow:var(--desktop-shadow); }
  #voicesListScreen.voices-panel::after { display:none; }
  #voicesListScreen .voices-list-header { border-radius:15px 15px 0 0; box-shadow:0 3px 8px #b8688c0c; }
  #voicesListScreen .voices-heading { justify-content:space-between; text-align:left; padding:3px 4px 7px; margin-bottom:6px; }
  #voicesListScreen .voices-heading h1 { justify-content:flex-start; }
  #voicesListScreen .voices-heading p { max-width:none; font-size:12px; font-weight:500; line-height:1.5; }
  #voicesListScreen .voices-portrait-frame { margin-right:6px; }
  #voicesListScreen .voices-sticky-actions { border-radius:11px; box-shadow:none; }
  #voicesListScreen .voice-filter,
  #voicesListScreen .voices-comment-action .voices-primary { border-radius:8px; }
  #voicesListScreen #voicesPageSize,
  #voicesListScreen #voicesSort { border-radius:8px; }
  #voicesListScreen .voice-card { border-color:#ecd0de; background:#fff; box-shadow:0 2px 5px #b8688c0a; }
  #voicesListScreen .voice-card::before { opacity:.35; }
  #voicesListScreen .voices-pagination button { min-height:36px; padding:7px 12px; border-width:1px; border-radius:9px; font-size:12px; }
  #voicesPage .voices-form-panel,
  #voicesPage .voices-thanks { margin-top:0; border:1px solid var(--desktop-border); border-radius:16px; box-shadow:var(--desktop-shadow); }
  #voicesPage .voices-form-panel { max-width:720px; padding:24px; }
  #voicesPage .voices-form-bow { display:none; }
  #voicesPage .voices-form-heading { margin:16px 0 20px; }
  #voicesPage .voices-back { min-height:36px; border-radius:9px; padding:7px 10px; box-shadow:none; }
  #voicesPage .voices-form-body { border-radius:12px; }
  #voicesPage .voices-field input,
  #voicesPage .voices-field select,
  #voicesPage .voices-field textarea { border-radius:9px; font-size:14px; }
  #voicesPage .voice-option { min-height:44px; padding:9px 12px; border-radius:10px; font-size:14px; }
  #voicesPage .voices-submit-wrap .voices-primary { min-height:44px; padding:10px 24px; border-radius:10px; font-size:16px; box-shadow:none; }
}

/* Desktop game: the playfield and player controls share a workspace; ranking stays beside it. */
@media (min-width:1024px) {
  #gamePage {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(236px,280px);
    align-items:start;
    gap:20px;
    padding:12px 0 24px;
  }
  #gamePage .game-card,
  #gamePage .ranking-card {
    width:100%; min-width:0; max-width:none; margin:0;
    border:1px solid #ecd7e2; border-radius:16px;
    background:#fffafd; box-shadow:0 3px 12px #9b4b6d0b;
  }
  #gamePage .game-card::before,
  #gamePage .ranking-card::before { display:none; }
  #gamePage .game-card {
    display:grid;
    grid-template-columns:minmax(160px,1fr) minmax(200px,360px);
    grid-template-rows:min-content min-content min-content 1fr;
    align-items:start; align-content:start;
    gap:12px 18px; padding:18px;
  }
  #gamePage .game-intro { grid-column:1; grid-row:1; min-width:0; text-align:left; }
  #gamePage .game-intro .section-bow { display:none; }
  #gamePage .game-title-lead { margin:0 0 2px; font-size:13px; line-height:1.5; }
  #gamePage .game-hdr { margin:0 0 10px; font-size:clamp(21px,1.85vw,27px); line-height:1.35; }
  #gamePage .game-note { margin:0 0 10px; font-size:12px; line-height:1.6; }
  #gamePage .game-rules {
    flex-direction:column; align-items:flex-start; justify-content:flex-start;
    max-width:none; margin:0 0 10px; gap:4px; font-size:11px; line-height:1.5;
  }
  #gamePage .game-difficulty-hint { margin:0; font-size:11px; line-height:1.6; text-align:left; }
  #gamePage #gameSetup { grid-column:1; grid-row:2; }
  #gamePage .game-setup {
    width:100%; min-width:0; max-width:none; margin:0;
    padding:12px; border-radius:12px; text-align:left; background:#fff3f8;
  }
  #gamePage .game-name-label { font-size:12px; margin-bottom:6px; }
  #gamePage #playerName { min-height:40px; padding:8px; font-size:13px; border-radius:8px; }
  #gamePage .game-setup-hint { margin:6px 0 8px; font-size:10px; line-height:1.6; }
  #gamePage .game-setup-error { font-size:11px; line-height:1.6; }
  #gamePage .game-button {
    min-height:40px; padding:8px 7px; gap:6px;
    border-width:1px; border-color:#e75192; border-radius:9px;
    box-shadow:none; font-size:13px; line-height:1.4;
  }
  #gamePage .game-start-button { width:100%; margin-top:0; }
  #gamePage #gameStats {
    grid-column:1; grid-row:2; width:100%; max-width:none; min-width:0;
    margin:0; gap:5px; font-size:10px;
  }
  #gamePage .game-stats>span { min-width:0; padding:7px 3px; border-radius:9px; gap:2px; }
  #gamePage .game-stats strong { font-size:22px; }
  #gamePage #gameCanvas {
    grid-column:2; grid-row:1 / 5; align-self:start;
    width:100%; max-width:360px; height:auto; margin:0; justify-self:center;
    border:3px solid #fff; border-radius:12px; box-shadow:0 0 0 1px #edbfd5;
  }
  #gamePage #gameControls,
  #gamePage #gameTouchPad {
    grid-column:1; grid-row:3; width:100%; max-width:none; min-width:0; margin:0;
  }
  #gamePage #gameControls { gap:8px; }
  #gamePage .control-btn {
    min-width:0; min-height:40px; padding:6px; gap:4px;
    border-radius:9px; font-size:12px;
  }
  #gamePage .control-btn .icon { width:16px; height:16px; }
  #gamePage #gameTouchPad { padding:10px 6px; font-size:11px; line-height:1.5; border-radius:10px; }
  #gamePage #gameStatus { grid-column:1; grid-row:4; margin:0; min-height:0; font-size:11px; line-height:1.6; text-align:left; }
  #gamePage #gameResult {
    grid-column:1; grid-row:3 / 5; width:100%; min-width:0; max-width:none;
    padding:12px; margin:0; border-radius:12px;
  }
  #gamePage .game-result-kicker { font-size:10px; }
  #gamePage .game-result-main { margin:5px 0; font-size:14px; }
  #gamePage .game-result-main>span { font-size:28px; }
  #gamePage .game-result-status { margin:6px 0 10px; font-size:11px; line-height:1.6; }
  #gamePage .game-replay-button { width:100%; }
  #gamePage .game-change-name { min-height:34px; margin-top:2px; padding:6px; font-size:11px; }

  #gamePage .ranking-card {
    position:sticky; top:76px; padding:16px;
    max-height:calc(100vh - 96px); max-height:calc(100dvh - 96px);
    overflow:auto; overscroll-behavior:contain;
  }
  #gamePage .ranking-title { justify-content:flex-start; font-size:20px; margin:0 0 4px; gap:7px; }
  #gamePage .ranking-status { text-align:left; font-size:11px; line-height:1.6; margin:0 0 10px; }
  #gamePage .ranking-table { font-size:12px; line-height:1.5; }
  #gamePage .ranking-table th,
  #gamePage .ranking-table td { padding:7px 5px; }
  #gamePage .ranking-table th { font-size:10px; background:#fff2f8; }
  #gamePage .ranking-table th:first-child,
  #gamePage .ranking-table td:first-child { width:36px; }
  #gamePage .ranking-table th:last-child,
  #gamePage .ranking-table td:last-child { width:60px; }
  #gamePage .ranking-local { margin:12px 0 0; font-size:10px; line-height:1.6; text-align:left; }
  #gamePage #retryRanking { width:100%; }
}

/* Desktop call sheets: song browser beside the reading workspace. */
@media (min-width:1024px) {
  #callsPage { padding:12px 0 24px; }
  #callsPage .calls-panel {
    display:grid;
    grid-template-columns:clamp(208px,18vw,248px) minmax(0,1fr);
    gap:18px 20px; align-items:start;
    max-width:none; margin:0; padding:22px;
    border:1px solid #eed7e2; border-radius:18px;
    background:#fffafd; box-shadow:0 4px 16px #b8688c0c;
  }
  #callsPage .calls-panel::before { display:none; }
  #callsPage .calls-panel > * { min-width:0; }
  #callsPage .calls-heading { grid-column:1/-1; grid-row:1; margin:0; text-align:left; }
  #callsPage .calls-bow { display:none; }
  #callsPage .calls-heading h1 { justify-content:flex-start; gap:9px; margin-bottom:4px; font-size:26px; }
  #callsPage .calls-heading p { font-size:12px; font-weight:500; }

  #callsPage .calls-picker {
    grid-column:1; grid-row:2 / span 3; align-self:start;
    position:sticky; top:76px; padding:13px;
    border:1px solid #f0dce6; border-radius:13px; background:#fff6fb;
  }
  #callsPage .calls-label { font-size:12px; margin-bottom:7px; }
  #callsPage .calls-search-row { gap:5px; }
  #callsPage .calls-search-row input { min-height:38px; padding:8px 9px; border-radius:9px; font-size:13px; }
  #callsPage .calls-search-row .calls-soft-button { min-height:38px; padding:7px 8px; border-radius:9px; font-size:12px; }
  #callsPage .calls-search-count { font-size:11px; margin:7px 1px; }
  #callsPage .calls-song-options {
    max-height:max(144px,calc(100dvh - 286px)); gap:5px; padding:2px 3px 3px 1px;
  }
  #callsPage .calls-song-choice { min-height:40px; gap:7px; padding:8px; border-radius:9px; font-size:12px; line-height:1.55; }
  #callsPage .calls-song-choice .icon { font-size:13px; }
  #callsPage .calls-song-choice[aria-pressed=true] { border-color:#e4a7c2; background:#f9e4ef; color:#9b2e62; }
  #callsPage .calls-no-results { padding:14px 9px; font-size:12px; }

  #callsPage .calls-selection {
    grid-column:2; grid-row:2; display:grid;
    grid-template-columns:minmax(0,1fr) minmax(224px,34%);
    gap:12px 16px; align-items:start; margin:0;
  }
  #callsPage .calls-selection h2 { grid-column:1/-1; grid-row:1; margin:0; text-align:left; font-size:23px; line-height:1.5; text-wrap:pretty; }
  #callsPage .calls-settings { grid-column:1; grid-row:2; min-width:0; margin:0; }
  #callsPage .calls-modes { padding:3px; gap:4px; border-radius:11px; }
  #callsPage .calls-modes button { min-width:0; min-height:36px; padding:7px 5px; border-radius:8px; font-size:12px; }
  #callsPage .calls-text-settings { justify-content:flex-start; flex-wrap:wrap; gap:3px 12px; margin:7px 0; }
  #callsPage .calls-text-settings label { min-height:32px; padding:4px 0; gap:5px; font-size:12px; }
  #callsPage .calls-text-settings input { width:16px; height:16px; }
  #callsPage .calls-copy-button { min-height:38px; padding:8px; gap:5px; border-radius:9px; font-size:12px; }
  #callsPage .calls-status { font-size:12px; }
  #callsPage .calls-manual-copy { padding:10px; border-radius:10px; }
  #callsPage .calls-manual-copy label { font-size:12px; }
  #callsPage .calls-manual-copy textarea { font-size:13px; }
  #callsPage #callsVideo { grid-column:2; grid-row:2; margin:0; }
  #callsPage .calls-video-card { padding:10px; border-radius:12px; box-shadow:none; }
  #callsPage .calls-video-heading { gap:4px 8px; margin-bottom:7px; }
  #callsPage .calls-video-heading h3 { font-size:12px; }
  #callsPage .calls-video-kind { padding:1px 7px; font-size:10px; }
  #callsPage .calls-video-stage { border-radius:8px; }
  #callsPage .calls-video-play { gap:5px; padding:8px; font-size:12px; }
  #callsPage .calls-video-play-icon { width:46px; height:36px; border-radius:10px; font-size:19px; }
  #callsPage .calls-video-title { margin-top:7px; font-size:11px; line-height:1.6; }
  #callsPage .calls-video-channel { font-size:10px; }
  #callsPage .calls-video-actions { gap:2px 8px; margin-top:3px; }
  #callsPage .calls-video-link,
  #callsPage .calls-video-stop { min-height:30px; padding:5px 0; font-size:11px; }
  #callsPage .calls-video-status,
  #callsPage .calls-video-pending { font-size:11px; }

  #callsPage #callsContent { grid-column:2; grid-row:3; min-width:0; }
  #callsPage #callsStorageStatus { grid-column:2; grid-row:4; margin:0; }
  #callsPage .calls-empty {
    grid-column:2; grid-row:2 / span 2; display:grid; place-content:center;
    min-height:300px; margin:0; padding:28px; border-radius:14px;
  }
  #callsPage .calls-empty > .icon { justify-self:center; font-size:30px; }
  #callsPage .calls-empty p { font-size:14px; }
  #callsPage .calls-part-chooser { gap:10px; padding:0; margin:0 0 12px; border:0; }
  #callsPage .calls-part-chooser > label { font-size:12px; }
  #callsPage .calls-part-chooser select { min-height:38px; padding:8px 28px 8px 10px; border-radius:9px; font-size:13px; }
  #callsPage .calls-single-heading { margin-bottom:10px; }
  #callsPage .calls-single-heading p { font-size:15px; }
  #callsPage .calls-single-heading > span { padding:3px 9px; font-size:11px; }
  #callsPage .calls-cards { gap:13px; }
  #callsPage .call-card { padding:17px 19px; border-width:1px; border-radius:13px; box-shadow:none; scroll-margin-top:16px; }
  #callsPage .call-timing { gap:6px; margin-bottom:8px; padding:3px 9px; font-size:11px; }
  #callsPage .call-timing-number { font-size:10px; }
  #callsPage .call-name { margin-bottom:9px; font-size:16px; line-height:1.55; }
  #callsPage .call-text { font-size:20px; line-height:1.8; letter-spacing:.01em; }
  #callsPage.calls-large .call-text { font-size:27px; line-height:1.8; }
  #callsPage .call-reading { margin-top:12px; padding-top:10px; font-size:14px; line-height:1.85; }
  #callsPage .call-note { margin-top:10px; font-size:12px; line-height:1.8; }
  #callsPage .call-pending { padding:11px 13px; border-radius:10px; font-size:13px; }
  #callsPage .call-variant { margin-top:12px; padding-top:10px; }
  #callsPage .call-variant select { min-height:38px; padding:7px 28px 7px 9px; border-radius:9px; font-size:13px; }
  #callsPage .call-source-hint { font-size:10px; }
  #callsPage .calls-part-nav { gap:10px; margin-top:13px; }
  #callsPage .calls-part-nav button { min-height:42px; padding:9px; border-width:1px; border-radius:11px; box-shadow:none; font-size:14px; }
  #callsPage .calls-references { margin-top:18px; padding-top:10px; font-size:11px; }
  #callsPage .calls-references summary { min-height:36px; padding-block:5px; font-size:12px; }
}
