/* Gobo: its own marks and panels, on top of the card table's kit (card-table/ui/kit.css). */

/* The powers' colours in the page: the hues of the table's own (moments.js COLORS, which stay as validated), toned to
   enamel so that they sit with the ivory, the gold and the card inks rather than a phone game's palette. */
:root {
  --c-seven: #e08447; --c-nine: #5db6dc; --c-jack: #a58fe2; --c-queen: #e06a9c; --c-ace: #8fcd6a;
}

/* the mark of the player who said Gobo */
.plate.gobo .tag, .me.gobo { border-color: #ff9a3d; box-shadow: 0 0 22px rgba(255, 140, 50, 0.5); }
.plate .flag { display: none; font-family: var(--serif); font-style: italic; font-weight: bold; color: #ffb061; font-size: 12px; }
.plate.gobo .flag, .me.gobo .flag { display: inline; }
.me .flag { display: none; font-family: var(--serif); font-style: italic; font-weight: bold; color: #ffb061; font-size: 12px; }

/* the bonus and the penalty on a total (their inks, what lies round them and their corners follow the kit's mark
   tokens where an interface look sets them, card-table/ui/kit.css; Gobo's own otherwise) */
/* (package 3.9.0) beside the total, out of its width: the total is centred on its place, and a strike that widened it
   moved the number while it showed */
.total .delta { position: absolute; left: calc(100% + 6px); bottom: 0.1em; font-size: 22px; padding: 0 8px; border-radius: var(--mark-r, 8px); animation: strike 0.42s cubic-bezier(0.3, 1.8, 0.4, 1) both; }
.total .delta.minus { color: var(--good-ink, #1a1405); background: var(--good, linear-gradient(#ffe9a3, #e0b24a)); box-shadow: var(--good-glow, 0 0 26px rgba(255, 220, 120, 0.9)); }
.total .delta.plus { color: var(--bad-ink, #ffd9d4); background: var(--bad, #6a211c); box-shadow: var(--bad-glow, 0 0 14px rgba(0, 0, 0, 0.6)); }
@keyframes strike { from { opacity: 0; transform: scale(2.6) translateY(-14px); } 60% { opacity: 1; } }
/* the strike folds into the total it changed: only the new total stays */
.total .delta.folded { opacity: 0; transform: translateX(-12px) scale(0.6); transition: opacity 0.25s ease-in, transform 0.25s ease-in; }

.chip {
  flex: none; padding: 5px 12px; border-radius: 999px;
  background: rgba(46, 22, 4, 0.9); border: 1px solid #ff9a3d; color: #ffe2c2; font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 0 16px rgba(255, 140, 50, 0.3); animation: pop2 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes pop2 { from { opacity: 0; transform: scale(0.7); } }
.chip b { font-family: var(--serif); font-style: italic; color: #ffb061; font-size: 15px; margin-inline-end: 6px; }
.chip .pips { display: inline-flex; gap: 4px; margin-inline-start: 8px; vertical-align: middle; }
.chip .pips i { width: 8px; height: 8px; border-radius: 50%; background: #ffb061; display: block; }
.chip .pips i.gone { background: rgba(255, 176, 97, 0.22); }

/* (package 3.6.0) keep or discard is said by the prompt itself, at its size: the old quiet line under it is gone */
#hold { display: none !important; }
#prompt .pw { color: var(--pc); font-weight: 700; }

body.carrying #power, body.carrying #coach { opacity: 0.12; pointer-events: none; transition: opacity 0.15s; }

/* a power that can be used */
#power {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); width: min(430px, 94vw);
  display: flex; align-items: center; gap: 13px; padding: 10px 12px 10px 10px; border-radius: 16px;
  background: var(--panel-strong); border: 1px solid color-mix(in srgb, var(--pc) 60%, var(--line));
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: powerIn 0.3s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
/* a bot's power is only told: nothing to press, so a tap goes through to the table under it */
#power.watch { width: auto; max-width: 90vw; padding-inline-end: 18px; opacity: 0.96; pointer-events: none; }
#power.watch .power-mark { width: 34px; height: 44px; font-size: 21px; }
#power.watch .power-text:empty { display: none; }
/* the power explanations off: the person's power only its mark and its name beside Skip */
#power.terse { width: auto; max-width: 94vw; }
#power.terse .power-mark { width: 34px; height: 44px; font-size: 21px; }
#power.terse .power-text, #power.terse .power-pick { display: none; }
#power.terse .power-title { white-space: nowrap; }
@keyframes powerIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } }
/* the power's mark: its rank on an enamel tile; it beats twice when it comes, then rests */
.power-mark {
  flex: none; width: 44px; height: 58px; border-radius: 7px; display: grid; place-items: center;
  font-family: var(--serif); font-weight: bold; font-size: 27px; color: #14100a;
  background: var(--pc); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 3px 10px rgba(0, 0, 0, 0.4); animation: pulse 0.9s ease-in-out 2;
}
@keyframes pulse { 50% { filter: brightness(1.18); transform: scale(1.04); } }
.power-body { flex: 1; min-width: 0; }
.power-title { font-family: var(--serif); font-weight: bold; font-size: 18px; color: var(--ivory); }
.power-text { font-size: 15px; line-height: 1.3; color: var(--ivory-2); }
.power-pick { font-size: var(--t-small); color: var(--ivory-2); margin-top: 3px; }
.power-pick:empty { display: none; }

/* Gobo cannot be taken back: pressed once, it asks, in its colour. (3.9.0) It is one of the most important buttons: filled
   and gold as the primary button, and it breathes a glow for as long as it can be called (it shows only then) */
.btn.gobo {
  font-family: var(--serif); font-style: italic; font-size: 17px; font-weight: bold;
  background: var(--primary); color: var(--primary-ink); border-color: var(--primary-edge);
  box-shadow: inset 0 1px 0 rgba(255, 250, 230, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
  animation: gobocall 1.8s ease-in-out infinite;
}
.btn.gobo:hover { filter: brightness(1.08); }
@keyframes gobocall { 50% { box-shadow: inset 0 1px 0 rgba(255, 250, 230, 0.55), 0 0 0 3px rgba(255, 226, 150, 0.45), 0 4px 30px rgba(240, 205, 110, 0.85); } }
body.calm .btn.gobo { animation: none; }
.btn.gobo.armed { animation: armed 0.5s ease-in-out 4 alternate; font-style: normal; font-family: var(--sans); font-size: 14px; color: #2a1200; background: radial-gradient(circle at 50% 20%, #ffd08a, #f08a2c); border-color: #ffd9a6; }
.btn.gobo.armed b { font-family: var(--serif); font-style: italic; font-size: 17px; }
.declare { flex: none; min-width: 0; }
.declare:empty, .declare:has(> .hidden:only-child) { display: none; }

/* the start screen, how to play */
.minilay { display: inline-grid; gap: 2px; vertical-align: middle; margin-inline-end: 7px; flex: none; }
.minilay i { display: block; width: 7px; height: 10px; border-radius: 1.5px; background: currentColor; opacity: 0.85; }
.minilay.grid { grid-template-columns: repeat(2, 7px); }
.minilay.row { grid-template-columns: repeat(4, 7px); }
.howto .values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.howto .values div { padding: 7px 4px; border-radius: 10px; background: rgba(244, 236, 216, 0.06); text-align: center; font-size: var(--t-small); color: var(--ivory-2); }
.howto .values b { display: block; font-family: var(--serif); font-size: 18px; color: var(--ivory); font-variant-numeric: lining-nums; }
.howto .values .redk b { color: var(--red-ink); }
/* the five powers in two columns, each its tile and one line */
.howto .pws { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 6px 0; }
.howto .pw { display: grid; grid-template-columns: 30px 1fr; gap: 6px 10px; align-items: center; margin: 0; }
.howto .pw i { font-style: normal; font-family: var(--serif); font-weight: bold; width: 28px; height: 36px; display: grid; place-items: center; border-radius: 5px; color: #14100a; background: var(--pc); font-size: 16px; }
.howto .pw span { font-size: var(--t-pw, 14px); line-height: 1.3; }
.howto ul { margin: 4px 0; }
.howto h3 { margin-top: 13px; }

/* the scores between rounds, the winner */
.scores { width: min(520px, 100%); }
.scores .sub { color: var(--ivory); font-size: var(--t-body); margin: -4px 0 12px; line-height: 1.4; }
/* (the chip of who said Gobo follows the kit's mark tokens as the strike on a total does) */
.srow .who small { font-weight: 700; font-size: 12.5px; margin-inline-start: 8px; padding: 1px 8px; border-radius: var(--mark-r, 999px); box-shadow: var(--mark-edge, none); }
.srow .who small.won { background: var(--good, linear-gradient(#ffe9a3, #e0b24a)); color: var(--good-ink, #1a1405); }
.srow .who small.lost { background: var(--bad, #6a211c); color: var(--bad-ink, #ffd9d4); }
/* (the gauge follows an interface look's --track and --bar where it sets them; the default's colours otherwise) */
.limit { margin: 14px 0 0; height: 5px; border-radius: 3px; background: var(--track, rgba(244, 236, 216, 0.1)); overflow: hidden; }
.limit i { display: block; height: 100%; border-radius: 3px; background: var(--bar, linear-gradient(90deg, #c79b3f, #f3d98f)); transition: width 0.9s ease; }
.limitnote { font-size: 14px; color: var(--ivory-2); margin: 6px 0 16px; }
.limitnote b { color: var(--ivory); }
.scores .row, .winner .row { display: flex; justify-content: center; gap: 10px; }
.scores .row .btn:not(.primary) { font-size: 14px; }

.winner { text-align: center; width: min(430px, 100%); background: var(--panel-solid); }
/* the winner's panel stands on the side away from the winner's seat, which is lit */
@media (min-width: 900px) {
  .screen.away-left { justify-items: end; padding-inline-end: 6vw; }
  .screen.away-right { justify-items: start; padding-inline-start: 6vw; }
}
.screen.away-bottom { align-items: start; padding-top: 60px; }
.screen.away-top { align-items: end; padding-bottom: 76px; }
.winner .crown { font-size: 15px; color: var(--ivory-2); }
/* (the title of a win follows the kit's --win-ink and --win-shade where an interface look sets them, as the marks do;
   a look that letters every panel title its own way lets it through by --panel-title and --panel-shade) */
.winner h2 {
  font-size: clamp(34px, 9vw, 52px); font-style: italic; margin: 2px 0 14px;
  color: var(--win-ink, var(--gold)); text-shadow: var(--win-shade, 0 0 24px rgba(255, 215, 120, 0.35));
  --panel-title: var(--win-ink); --panel-shade: var(--win-shade);
}
.winner .rows { margin-bottom: 16px; text-align: start; }
.winner .row { align-items: center; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  .power-mark { animation: none; }
}

/* (package 3.8.0) a phone: the person's power panel a slim strip (its mark, its name, Skip): the prompt says what to
   choose, and the panel stays clear of the cards it asks for */
@media (max-width: 480px), (max-height: 700px) {
  #power:not(.watch) { padding: 6px 8px 6px 6px; gap: 10px; width: auto; max-width: 94vw; }
  #power:not(.watch) .power-mark { width: 30px; height: 40px; font-size: 19px; }
  #power:not(.watch) .power-text, #power:not(.watch) .power-pick { display: none; }
  #power:not(.watch) .power-title { font-size: 16px; white-space: nowrap; }
}
@media (max-width: 400px) {
  /* the last lap's chip keeps the top bar's buttons in the window: its pips go, the turns left stay */
  .chip .pips { display: none; }
  /* the scores on a narrow phone (and with the larger text): who said Gobo under the name, the buttons wrap */
  .srow .who { white-space: normal; line-height: 1.15; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
  .srow .who { overflow: visible; min-width: 0; }
  .srow, .shead { grid-template-columns: 22px minmax(0, 1fr) 48px 56px; }
  .srow .who small { margin-inline-start: 0; white-space: nowrap; padding: 1px 5px; font-size: 12px; }
  .scores .row .btn { padding: 9px 15px; }
  .scores .sub { margin-bottom: 8px; }
  .scores .limitnote { margin-bottom: 10px; }
}
.scores .row, .winner .row { flex-wrap: wrap; }
#lastlap { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  .total .delta { font-size: 17px; }
  .chip { font-size: 12.5px; padding: 4px 9px; }
  .chip .word { display: none; }
  .howto .pws { gap: 6px 10px; }
  .howto .pw span { font-size: var(--t-pw-phone, 13px); }
}
@media (prefers-reduced-motion: reduce) { .btn.gobo { animation: none; } }

/* How to play, written from the table's settings: the goal and what each card counts at the top, then the rules in the
   tutorial's order, in two columns where there is room (a section never split), each rule its name first */
.panel.howto:has(.rules-page) { width: min(980px, 100%); }
/* (as Président's) its buttons on a solid band with room above them, the text fading as it scrolls under */
.panel.howto:has(.rules-page) .close { padding-bottom: 22px; margin-bottom: -22px; margin-top: 26px; background: var(--panel-solid); }
.panel.howto:has(.rules-page) .close::before { content: ""; position: absolute; inset-inline: 0; bottom: 100%; height: 26px; background: linear-gradient(transparent, var(--panel-solid)); pointer-events: none; }
.rules-page { container-type: inline-size; }
.rules-page h2 { margin-bottom: 6px; }
.rules-page .rp-intro { margin: 0 0 4px; font-size: 15px; line-height: 1.45; color: rgba(244, 236, 216, 0.9); }
/* what each card is worth: each group of cards as wide as its fanned cards, its worth centred under it */
.rp-values { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 26px; margin: 2px 0 4px; }
.rp-vgroup { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rules-page .rp-vcards { container-type: normal; --w: 50px; width: auto; padding: 0; }
.rules-page .rp-vcards .hc + .hc { margin-inline-start: calc(var(--w) * -0.5); }
.rp-vlabel { font-size: 13.5px; color: var(--ivory, #f4ecd8); white-space: nowrap; }
.rp-cols { margin-top: 4px; }
.rules-page .rp-vcap { margin: 8px 0 4px; font-size: 15px; color: rgba(244, 236, 216, 0.9); }
@container (min-width: 620px) { .rp-cols { columns: 2; column-gap: 34px; } }
.rp-sec { padding-top: 2px; break-inside: avoid; }
.rp-sec h3 { break-after: avoid; margin: 8px 0 3px; }
.rp-sec ul { list-style: none; margin: 0; padding: 0; }
.rules-page .rp-rule { break-inside: avoid; margin: 0 0 4px; }
.rules-page .rp-rule p { margin: 0; font-size: 14.5px; line-height: 1.42; color: rgba(244, 236, 216, 0.86); }
.rules-page .rp-rule p b:first-child { color: var(--ivory); }
/* Settings › Rules: the tutorial offered again, a small button at the start of its row (rarely needed) */
.setting .btn.learn-again { justify-self: start; align-self: start; width: auto; min-width: 0; padding: 6px 16px; font-size: 13.5px; }
@container (max-width: 420px) { .rp-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; } .rp-vgroup:first-child { grid-column: 1 / -1; } .rules-page .rp-vcards { --w: 34px; } .rp-vlabel { text-align: center; } }
/* Settings stand at the side of the table, 44% of the window wide: their six tabs on one line, spread over it, the
   words and their room following the window's width (never the panel's: a panel made a size container would take the
   kit's narrow-window rules for every row inside it); on a phone held upright one low row across the sheet, which
   scrolls sideways where the words do not fit, so that the page under it keeps the sheet's height */
.screen.tpl .tpl-panel.options .tpl-tabs { flex-wrap: nowrap; }
.screen.tpl .tpl-panel.options .tpl-tabs button { padding: 7px clamp(4px, 0.7vw, 11px); font-size: clamp(10.5px, 1.19vw, 17px); white-space: nowrap; }
@media (orientation: landscape) {
  .screen.tpl .tpl-panel.options .tpl-head .tpl-tabs { justify-self: stretch; }
  .screen.tpl .tpl-panel.options .tpl-tabs button { flex: 1 1 auto; }
}
@media (orientation: landscape) and (max-width: 960px) { .screen.tpl .tpl-panel.options .tpl-tabs { gap: 0; padding-inline: 2px; } .screen.tpl .tpl-panel.options .tpl-tabs button { padding-inline: 4px; } }
@media (orientation: portrait) and (max-width: 480px) {
  .screen.tpl .tpl-panel.options .tpl-tabs { display: flex; flex-wrap: nowrap; justify-self: stretch; overflow-x: auto; scrollbar-width: none; }
  .screen.tpl .tpl-panel.options .tpl-tabs button { flex: 1 0 auto; font-size: 14px; padding: 7px 7px; }
}
