/* The board and the result are css/lib/petalsong-board.css; this is the panel and the screens
   around them. */
/* Keep this ground apart from the pale sage of games/mahjong. */
.game-root[data-game="mahjong-petalsong"] {
  padding: clamp(12px, 2.4vw, 24px);
  background: radial-gradient(130% 110% at 50% 0%, #2c5145 0%, #1d372f 55%, #142822 100%);
  border-color: rgba(255, 255, 255, .08);
}
/* The panel is one fixed height and its three screens take turns filling it. */
/* #game-root centres its child, and everything in here is positioned, so the width is stated. */
.pt { width: 100%; height: clamp(480px, calc(100svh - 116px), 780px); }
html.fills-window .game-root[data-game="mahjong-petalsong"] .pt { height: 100%; }
@media (max-width: 640px) {
  .game-root[data-game="mahjong-petalsong"] { padding: 0; border: 0; border-radius: 0; margin-inline: -8px; }
  .pt { height: max(440px, calc(100svh - 68px)); }
}
.pt-note { color: #e8b86a; font-size: .84rem; }
.pt-fs { white-space: nowrap; }

/* The theme list, under the logo. */
.pt-home { padding: 14px 14px 0; }
.pt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; margin-bottom: 28px; }
.pt-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pt-logo-tile {
  display: grid; place-items: center; flex: none; width: 40px; height: 52px; border-radius: 7px;
  background: linear-gradient(155deg, #fffefa, #f2e8d0); box-shadow: 4px 5px 0 #a88c5a, 6px 10px 14px rgba(0, 0, 0, .35);
  transform: rotate(-6deg);
}
.pt-logo-tile img { width: 80%; }
.pt-logo-word { display: flex; flex-direction: column; min-width: 0; color: #f6ecd2; font: 700 2rem/1 Georgia, serif; letter-spacing: .01em; }
.pt-logo-word small { margin-bottom: 4px; color: #b9c9b4; font: 600 .72rem system-ui, sans-serif; letter-spacing: .32em; text-transform: uppercase; }
.pt-tabs { display: flex; gap: 8px; flex: none; margin-bottom: 12px; }
.pt-tab { padding: 7px 16px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: none; color: #c4d0bf; font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; }
.pt-tab:hover { color: #f6ecd2; }
.pt-tab[aria-selected="true"] { border-color: #f6ecd2; background: #f6ecd2; color: #1d372f; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-content: start; flex: 1; min-height: 0; padding-bottom: 14px; overflow-y: auto; }
.pt-empty { grid-column: 1 / -1; margin: 30px 0 0; color: #c4d0bf; font: italic 1.05rem Georgia, serif; text-align: center; }
.pt-card { position: relative; }
.pt-card-open {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 14px; width: 100%; height: 100%; padding: 10px;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; background: rgba(255, 255, 255, .06);
  color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s;
}
.pt-card-open:hover { background: rgba(255, 255, 255, .1); border-color: rgba(246, 236, 210, .45); }
.pt-card-title { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; min-width: 0; padding-right: 36px; }
.pt-card-title strong { min-width: 0; overflow: hidden; font: 700 1.2rem Georgia, serif; color: #f6ecd2; text-overflow: ellipsis; white-space: nowrap; }
.pt-card.pt-wip .pt-card-open {
  border: 1px dashed rgba(232, 184, 106, .75);
  background: repeating-linear-gradient(135deg, rgba(232, 184, 106, .08) 0 10px, rgba(255, 255, 255, .04) 10px 20px);
}
.pt-wip-tag { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 2px 9px 2px 7px; border-radius: 999px; background: #e8b86a; color: #2a2112; font: 800 .72rem system-ui, sans-serif; }
.pt-wip-tag .pt-icon { width: 12px; height: 12px; }
.pt-slot { cursor: default; }
.pt-slot .pt-card-title { padding-right: 0; }
.pt-slot-frame {
  display: grid; place-items: center; width: 132px; height: 92px; border: 1px dashed rgba(232, 184, 106, .55); border-radius: 10px;
  color: rgba(232, 184, 106, .85);
}
.pt-slot-frame .pt-icon { width: 30px; height: 30px; }
.pt-card-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pt-card-blurb { display: -webkit-box; overflow: hidden; color: #c4d0bf; font-size: .8rem; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.pt-card-meta { display: flex; align-items: center; gap: 4px; color: #e8b86a; font-size: .8rem; font-weight: 700; }
.pt-card-meta .pt-icon { width: 1em; height: 1em; }
.pt-card-full { color: #efd29e; }
.pt-fav {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .18); color: #c4d0bf; font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.pt-card .pt-fav { position: absolute; top: 6px; right: 6px; }
.pt-fav:hover { color: #f6ecd2; }
.pt-fav.on, .pt-fav-pill.on .pt-icon { color: #f28aa8; }

/* A theme: what it is, the rating and the share, then its levels. */
.pt-theme-body { flex: 1; min-height: 0; padding: 14px 14px 18px; overflow-y: auto; }
.pt-about { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.pt-theme-h { margin: 0; color: #f6ecd2; font: 700 1.9rem/1.15 Georgia, serif; }
.pt-blurb { margin: 0; color: #c4d0bf; font: italic 1rem/1.5 Georgia, serif; }
.pt-rate, .pt-share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pt-rate-label { color: #c4d0bf; font-size: .86rem; font-weight: 700; }
.pt-stars { display: inline-flex; }
.pt-star { display: inline-flex; padding: 0 2px; border: 0; background: none; color: rgba(246, 236, 210, .28); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.pt-star .pt-icon { width: 1em; height: 1em; }
.pt-star:hover, .pt-star.on { color: #e8b86a; }
.pt-rate-avg { color: #c4d0bf; font-size: .84rem; }
.pt-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.pt-stop {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 8px 8px 10px;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; background: rgba(255, 255, 255, .05);
  color: inherit; font: inherit; cursor: pointer; transition: background .15s, border-color .15s;
}
.pt-stop:hover { background: rgba(255, 255, 255, .1); border-color: rgba(246, 236, 210, .4); }
.pt-stop strong { font: 700 .98rem Georgia, serif; color: #f6ecd2; text-align: center; }
.pt-meta { color: #b9c9b4; font-size: .76rem; }
/* .pt turns selection off for the board; these words can be selected. */
.pt .pt-theme-h, .pt .pt-blurb, .pt .pt-stop strong { user-select: text; -webkit-user-select: text; }
.pt-num {
  position: absolute; top: 12px; left: 12px; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #efe6cf; font-size: .75rem; font-weight: 800;
}
.pt-num .pt-icon { width: 14px; height: 14px; }
.pt-stop.pt-locked { cursor: default; opacity: .7; }
.pt-stop.pt-locked:hover { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .1); }
.pt-lock-frame { display: grid; place-items: center; width: 150px; height: 100px; border-radius: 10px; background: rgba(0, 0, 0, .18); color: rgba(246, 236, 210, .45); }
.pt-lock-frame .pt-icon { width: 28px; height: 28px; }
.pt-done .pt-num { background: #f6ecd2; color: #1d372f; }
.pt-next { border-color: #e8b86a; box-shadow: 0 0 0 2px rgba(232, 184, 106, .35); }
.pt-next .pt-num { background: #e8b86a; color: #2a2112; }

/* Mode 4 — true full screen, over the page, the fallback class and the Fullscreen API alike. */
body.pt-locked { overflow: hidden; }
/* As specific as the fills-window height rule above, and after it, so it wins that tie. */
html .game-root[data-game="mahjong-petalsong"] .pt.pt-full {
  position: fixed; inset: 0; z-index: 200; width: auto; height: auto; padding: 10px 12px;
  background: radial-gradient(130% 110% at 50% 0%, #2c5145 0%, #1d372f 55%, #142822 100%);
}
.pt.pt-full > .pt-screen { inset: 10px 12px; }
