/* PREMIUM ALL-ACCESS (js/premium.js, 2026-09-14): the free tier's menu, the
   offer screen, the badge on the player card and the admin's tier demo pill.
   Loads after stage.css and gauntlet-mode.css, so its rules win by order. */

/* ------------------------------------------------------------ the free menu
   "the only buttons will be Play, Settings, My Stats and Log in/out" — every
   other door, widget and column is hidden by VISIBILITY only: nothing is
   moved or rebuilt, so every handler bound at boot stays bound, and a member
   signing in gets the whole menu back with one class toggle. */
body.tier-free #menu .menu-under,
body.tier-free #menu #gamemode-btn,
body.tier-free #menu #mypieces-btn,
body.tier-free #menu #mp-btn,
body.tier-free #menu #shop-btn,
body.tier-free #menu #team-btn,
body.tier-free #menu #curator-btn,
body.tier-free #menu #daily-chest,
body.tier-free #menu #plan-card,
body.tier-free #menu #plan-btn,
body.tier-free #menu #next-programme,
body.tier-free #menu #live-widget,
body.tier-free #menu #voice-widget,
body.tier-free #menu #tourney-widget,
body.tier-free #menu #menu-mail-btn,
body.tier-free #menu #lesson-btn,
body.tier-free #menu .menu-set,
body.tier-free #menu #vienna-chat,
body.tier-free #menu .hint { display: none !important; }
body.tier-free #menu #admin-btn,
body.tier-free #menu #admin-note { display: none !important; }
/* the Stage grid's right-hand column has nothing left in it */
html[data-menu="stage"] body.tier-free #menu .menu-side { display: none !important; }

/* ------------------------------------------ the free menu is ONE COLUMN
   The Stage menu's bottom strip is a PIANO KEYBED — seven white keys, one
   octave, five black keys between them — and it only reads as a keyboard
   while all seven doors are there. A free user has two, so it came out as a
   half-built fragment of a piano with the rest of the octave missing (Lionel,
   from a screenshot: "they shouldn't see the bottom piano tab that's
   incomplete. their buttons should all be under PLAY in a typical 1 column
   layout"). So for the free tier the strip stops being a keybed and becomes
   what it actually is: the menu's buttons, one under another, directly under
   PLAY. Nothing moves in the DOM — the keys row is simply re-dressed and
   re-pointed at the middle column — so every handler stays bound and a
   member's menu is untouched. */
/* The two-column form is the WIDE one only: stage.css collapses this grid to
   one column under 1080px, and an override outside that query re-imposes two
   columns on a phone — 300px of card plus what is left is a 32px ribbon of
   buttons (measured at 390px before this was scoped, by shot-free-menu.js).
   The phone needs no rule at all: one column is already what it does. */
@media (min-width: 1081px) {
  html[data-menu="stage"] body.tier-free #menu .menu-cols {
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-areas: "left mid" "left play" "left gap" "left keys" "foot foot";
  }
  /* ...and with no pianist card yet, one column for the whole menu */
  html[data-menu="stage"] body.tier-free #menu .menu-cols:not(:has(.menu-leftcol > :not(.hidden))) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "mid" "play" "gap" "keys" "foot";
  }
}
/* A SIGNED-IN FREE USER WITH NO PIANIST YET (a brand-new account, and what
   the free preview shows): the card is hidden, so the 300px column holds
   nothing but LOG OUT and would stand there as an empty gutter beside the
   menu. The column takes a ROW of its own under the buttons instead.
   Deliberately NOT `display: contents` on the wrapper: that promotes every
   child to a grid item, and the ones with no area of their own — the 🎼
   recital banner, which is shown to the free tier on purpose — are then
   auto-placed into an implicit cell of their own width. The wrapper stays
   one item and goes on laying its own children out. */
@media (min-width: 1081px) {
  html[data-menu="stage"] body.tier-free #menu .menu-cols:not(:has(#player-card:not(.hidden))) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "mid" "play" "gap" "keys" "out" "foot";
  }
  html[data-menu="stage"] body.tier-free #menu .menu-cols:not(:has(#player-card:not(.hidden))) .menu-leftcol {
    grid-area: out; width: 100%; gap: 10px;
  }
  html[data-menu="stage"] body.tier-free #menu .menu-cols:not(:has(#player-card:not(.hidden))) #menu-signout { width: 100%; margin: 0; }
  html[data-menu="stage"] body.tier-free #menu .menu-cols:not(:has(#player-card:not(.hidden))) .menu-leftcol > .live-widget { width: 100%; }
}
/* the keybed undressed: a plain column, no octave, no "Menu" label */
html[data-menu="stage"] body.tier-free #menu .menu-stack {
  display: flex; flex-direction: column; gap: 10px; padding-top: 0; margin: 10px 0 0;
}
html[data-menu="stage"] body.tier-free #menu .menu-stack::before { content: none; }
html[data-menu="stage"] body.tier-free #menu .menu-stack .bk { display: none; }
/* the doors' own look, which is the one the tier's other buttons wear */
html[data-menu="stage"] body.tier-free #menu .menu-stack .mode-btn {
  position: relative; height: 52px; width: 100%; margin: 0; padding: 0 14px;
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; background: var(--st-glass); border: 1px solid var(--st-line); color: var(--st-white);
  font-family: var(--st-cond); font-weight: 700; font-size: 18px; letter-spacing: .12em;
  text-transform: uppercase; backdrop-filter: blur(6px); box-shadow: none;
  transition: border-color .12s, color .12s, background .12s;
}
html[data-menu="stage"] body.tier-free #menu .menu-stack .mode-btn:hover:not(:disabled) {
  transform: none; background: var(--st-glass2); border-color: var(--st-cyan); color: var(--st-cyan);
  box-shadow: none;
}
html[data-menu="stage"] body.tier-free #menu .menu-stack .mode-btn:active { transform: translateY(1px); box-shadow: none; }
/* stage.css trims the KEYS for a phone — 92px tall, 9.5px type, wrapped — and
   these are not keys any more */
@media (max-width: 1080px) {
  html[data-menu="stage"] body.tier-free #menu .menu-stack .mode-btn {
    height: 52px; font-size: 16px; letter-spacing: .1em; padding: 0 12px;
    white-space: nowrap; line-height: 1; text-align: center; word-break: normal;
  }
}
/* the badge sits in the row rather than in a key's top corner */
html[data-menu="stage"] body.tier-free #menu .menu-stack .menu-badge { position: static; }

/* the pitch on the free menu: one gold card under PLAY */
#premium-card { display: block; width: 100%; box-sizing: border-box; margin: 10px auto 0; padding: 12px 16px;
  border-radius: 12px; border: 1px solid rgba(255, 214, 102, .55); cursor: pointer; text-align: left;
  background: linear-gradient(135deg, rgba(255, 214, 102, .16), rgba(255, 170, 40, .08)); color: #ffe9a8;
  font: inherit; box-shadow: 0 0 0 0 rgba(255, 214, 102, 0); transition: box-shadow .2s, border-color .2s; }
#premium-card:hover { border-color: #ffd666; box-shadow: 0 0 18px rgba(255, 214, 102, .25); }
#premium-card b { display: block; font-size: 15px; letter-spacing: .04em; color: #ffd666; }
#premium-card small { display: block; margin-top: 3px; font-size: 12.5px; color: rgba(255, 233, 168, .85); line-height: 1.35; }
#premium-card .pm-deal { color: #fff; font-weight: 700; }
html[data-menu="stage"] #menu #premium-card { grid-area: gap; margin: 0; }
html[data-menu="stage"] #menu #premium-card b { font-family: var(--st-cond); font-size: 18px; letter-spacing: .06em; }
body:not(.tier-free) #premium-card { display: none !important; }

/* the badge on the player card */
#pc-premium { display: none; margin-top: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  color: #ffd666; text-transform: uppercase; text-align: center; cursor: pointer; }
#pc-premium.on { display: block; }
html[data-menu="stage"] #menu #pc-premium { font-family: var(--st-cond); font-size: 13px; letter-spacing: .12em; }

/* MY STATS: the free tier's name for 📊 PROGRESS (labels only, main.js applyTier) */

/* the admin's tier demo: one pill, always in reach, with the way out on it */
#tier-demo-pill { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 80;
  display: flex; gap: 10px; align-items: center; padding: 6px 12px; border-radius: 999px;
  background: rgba(120, 40, 160, .92); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 4px 16px rgba(0, 0, 0, .4); }
#tier-demo-pill button { font: inherit; background: rgba(255, 255, 255, .15); color: #fff; border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px; padding: 3px 9px; cursor: pointer; }
#tier-demo-pill button:hover { background: rgba(255, 255, 255, .3); }

/* ------------------------------------------------------------ the offer */
#premium-screen { z-index: 60; background: rgba(4, 5, 10, .82); backdrop-filter: blur(4px); padding: 16px; }
.pm-card { position: relative; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box;
  padding: 26px 28px 22px; border-radius: 18px; color: #f4efe4;
  background: radial-gradient(ellipse at 50% 0%, #2a2140 0%, #14121f 55%, #0b0a12 100%);
  border: 1px solid rgba(255, 214, 102, .45); box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04) inset; }
.pm-eyebrow { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: #ffd666; font-weight: 700; }
.pm-card h1 { margin: 6px 0 4px; font-family: "EB Garamond", Palatino, Georgia, serif; font-size: 34px; line-height: 1.05; color: #fff; letter-spacing: .01em; }
.pm-why { margin: 8px 0 16px; font-size: 15px; line-height: 1.5; color: #e9e2d2; }
.pm-benefits { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.pm-benefits li { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: baseline; }
.pm-benefits .pm-ic { grid-row: span 2; font-size: 18px; line-height: 1.2; }
.pm-benefits b { font-size: 14px; color: #fff; }
.pm-benefits i { font-style: normal; font-size: 12px; color: rgba(244, 239, 228, .68); line-height: 1.3; }
.pm-price { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; margin: 6px 0 14px; padding: 14px;
  border-radius: 12px; background: rgba(255, 214, 102, .08); border: 1px dashed rgba(255, 214, 102, .35); }
.pm-price .pm-list { color: rgba(244, 239, 228, .55); font-size: 14px; }
.pm-price .pm-now { font-size: 26px; color: #ffd666; font-weight: 800; letter-spacing: .01em; line-height: 1.15; }
.pm-price .pm-then { font-size: 13px; color: rgba(244, 239, 228, .78); }
#pm-go { width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 15px 14px; border-radius: 12px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #ffe08a, #f5b829); color: #2a1a00; font: 800 17px/1.2 inherit; letter-spacing: .02em;
  box-shadow: 0 4px 0 0 #a87500, 0 10px 30px rgba(255, 190, 60, .25); transition: transform .08s, box-shadow .08s; }
#pm-go:hover:not(:disabled) { transform: translateY(1px); box-shadow: 0 3px 0 0 #a87500, 0 10px 30px rgba(255, 190, 60, .25); }
#pm-go:disabled { opacity: .6; cursor: default; }
.pm-row { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.pm-row .small-btn { margin: 0; }
.pm-more { color: #ffd666; font-size: 13px; text-decoration: underline; }
.pm-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45;
  background: rgba(255, 120, 120, .12); border: 1px solid rgba(255, 120, 120, .4); color: #ffd9d9; }
.pm-guest { margin: 8px 0 0; font-size: 12.5px; color: rgba(244, 239, 228, .7); text-align: center; line-height: 1.45; }
.pm-guest button { font: inherit; background: none; border: 0; color: #ffd666; text-decoration: underline; cursor: pointer; padding: 0; }
.pm-native { margin: 8px 0 0; font-size: 13px; color: #e9e2d2; text-align: center; line-height: 1.45; }
@media (max-width: 560px) {
  .pm-card { padding: 20px 16px 16px; }
  .pm-benefits { grid-template-columns: 1fr; }
  .pm-card h1 { font-size: 28px; }
}

/* ------------------------------------------------------------ the Gauntlet room */
.gx-runs { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  letter-spacing: .04em; color: #ffe9a8; background: rgba(255, 214, 102, .12); border: 1px solid rgba(255, 214, 102, .4); }
.gx-runs.out { color: #ffb4b4; background: rgba(255, 120, 120, .12); border-color: rgba(255, 120, 120, .45); }
.gx-runs button { font: inherit; background: none; border: 0; color: #ffd666; text-decoration: underline; cursor: pointer; padding: 0; }
/* the chat read-only for a free member: the input says so, and a click on it opens the offer */
.gx-form.locked input { opacity: .6; cursor: pointer; }
.gx-form.locked button[type="submit"] { display: none; }
.gx-chat-lock { display: none; padding: 6px 12px 8px; font-size: 12px; color: #a19b8e; border-top: 1px solid #2c3142; }
.gx-chat-lock button { font: inherit; background: none; border: 0; color: #ffd666; text-decoration: underline; cursor: pointer; padding: 0; }
.gx-chat.locked .gx-chat-lock { display: block; }
.gx-boss { margin: 10px 0 0; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 140, 90, .5);
  background: linear-gradient(135deg, rgba(255, 120, 60, .16), rgba(120, 30, 30, .18)); }
.gx-boss .gx-pt b { color: #ffc9a8; }
.gx-boss.done { border-color: rgba(125, 255, 178, .45); background: rgba(125, 255, 178, .08); }
.gx-boss.locked { opacity: .7; }
.gx-boss .gx-chip.play { background: rgba(255, 140, 90, .22); border-color: rgba(255, 140, 90, .6); color: #ffd9c4; }

/* Piano Attack and Piano Shooter: members use .menu-under; the free tier gets the stack's copies. */
#menu #attack-btn2, #menu #shooter-btn2 { display: none; }
body.tier-free #menu #attack-btn2, body.tier-free #menu #shooter-btn2 { display: block; }
