/* Marble Shooter. The board's pixel size is set by the script from .cc-fit's measured box, so
   nothing here gives .cc-stage a size. */
.game-root[data-game="marble-shooter"] {
  padding: clamp(10px, 2.2vw, 18px);
  background: radial-gradient(120% 100% at 50% 0%, #2c2218 0%, #18120b 55%, #0b0805 100%);
  border-color: #050302;
  text-align: left;
}
.cc { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }

.cc-hud {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; max-width: 480px; color: #f1dfb6;
}
.cc .cc-name { font-weight: 800; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cc-name-in { animation: cc-name-in .9s ease-out; }
@keyframes cc-name-in { from { opacity: 0; transform: translateY(-4px); letter-spacing: .12em; } to { opacity: 1; transform: none; letter-spacing: 0; } }
/* Thirty tracks, in three runs of ten. */
.cc-dots { display: flex; align-items: center; gap: 2px; flex: none; }
.cc-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(241, 223, 182, .22); }
.cc-dots i:nth-child(10n + 1):not(:first-child) { margin-left: 5px; }
.cc-dots i.done { background: #e0a93a; }
.cc-dots i.now { width: 7px; height: 7px; background: #fff3c8; box-shadow: 0 0 0 2px rgba(255, 243, 200, .25); }

.cc-bar {
  width: 100%; max-width: 480px; height: 6px; border-radius: 3px; overflow: hidden;
  background: rgba(241, 223, 182, .16);
}
.cc-bar i {
  display: block; width: 0; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #e8b048, #c97a1c); transition: width .25s ease-out;
}

.cc-fit { display: grid; place-items: center; width: 100%; height: calc(100svh - 190px); min-height: 300px; }
.cc-stage {
  position: relative; overflow: hidden; border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .7), 0 0 0 1px rgba(226, 206, 160, .12);
  /* A vertical swipe on the board still scrolls the page; the bowl fires on a tap. */
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; cursor: crosshair;
}
.cc-canvas { display: block; width: 100%; height: 100%; }

/* Previous and next track: at the two ends of the bottom row, or beside the board's middle when
   the script finds room there (.cc-navside, positions in its custom properties). */
.cc-nav {
  display: grid; place-items: center; flex: none;
  width: 54px; height: 54px; padding: 0; border: 0; background: none; color: #fff;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform .12s;
}
.cc-nav .cc-icon { width: 40px; height: 40px; stroke-width: 4.2; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .9)); }
.cc-nav:hover:not(:disabled) { transform: scale(1.14); }
.cc-nav:disabled { opacity: .3; cursor: default; }
.cc-navside .cc-nav { position: absolute; z-index: 5; top: var(--cc-nav-top); }
.cc-navside .cc-prev { left: var(--cc-prev-x); }
.cc-navside .cc-next { left: var(--cc-next-x); }
.cc-navside .cc-controls { justify-content: center; }

/* A locked track, looked at ahead of time: the board as it will be, under a padlock. */
.cc-lockup {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none;
  background: rgba(8, 5, 2, .35);
}
.cc-lockup[hidden] { display: none; }
.cc-lockup .cc-icon {
  width: 25%; height: 25%; color: #f1dfb6; stroke-width: 1.8;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .85));
  animation: cc-lock-in .35s cubic-bezier(.3, 1.4, .5, 1);
}
@keyframes cc-lock-in { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }

/* Well done: a plain plaque in the middle of the cleared board, with one button to go on. */
.cc-done { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none; }
.cc-done[hidden] { display: none; }
.cc-done-card {
  pointer-events: auto; display: grid; justify-items: center; gap: 12px; max-width: 88%; padding: 16px 26px 18px;
  border-radius: 16px; text-align: center;
  background: linear-gradient(180deg, rgba(46, 35, 24, .96), rgba(24, 18, 11, .96));
  border: 1px solid rgba(226, 206, 160, .5);
  box-shadow: 0 0 0 3px rgba(10, 6, 3, .5), 0 14px 32px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 236, 190, .16);
  animation: cc-done-in .45s .7s cubic-bezier(.3, 1.25, .5, 1) both;
}
@keyframes cc-done-in { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
.cc-done-head { color: #ffe9a8; font-weight: 800; font-size: 1.55rem; letter-spacing: .02em; }
/* The main way on is green, whatever the game's palette. */
.cc-done-next {
  padding: 10px 22px; border: 1px solid #1d5a35; border-radius: 999px; font: inherit; font-size: .95rem; font-weight: 800;
  color: #f4fff4; text-shadow: 0 1px 0 rgba(0, 40, 16, .6); cursor: pointer;
  background: linear-gradient(180deg, #5fc283, #34a063 55%, #26804c);
  box-shadow: 0 2px 0 #14452a, 0 6px 14px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.cc-done-next:hover { filter: brightness(1.08); }
.cc-done-next:active { transform: translateY(1px); box-shadow: 0 1px 0 #14452a, 0 3px 8px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .35); }

/* The line's height is one line of text always: a caption that comes and goes must not move the
   board in the page-filling panel. */
.cc-cap {
  min-height: 1.6em; line-height: 1.6; margin: 0; text-align: center; font-size: .86rem; font-weight: 600;
  color: rgba(241, 223, 182, .9);
}

.cc-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.cc-ctl-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.cc-ctl {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid rgba(241, 223, 182, .28); border-radius: 9px; padding: 6px 12px;
  background: rgba(241, 223, 182, .1); color: #f1dfb6; font: inherit; font-size: .84rem;
  font-weight: 650; cursor: pointer; white-space: nowrap;
}
.cc-ctl:hover { background: rgba(241, 223, 182, .2); }
.cc-icon { width: 1.1em; height: 1.1em; flex: none; }
/* Two nested corners read as "expand" at any size; U+26F6 tofus on Windows and Android. */
.cc-fsicon {
  position: relative; display: inline-block; width: .85em; height: .72em;
  border: 2px solid currentColor; border-radius: 2px;
}
.cc-fsicon::before {
  content: ''; position: absolute; inset: 2px;
  border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; opacity: .45;
}

.cc-end { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 12px; overflow-y: auto; background: rgba(24, 12, 2, .5); }
.cc-end:empty { display: none; }
.cc-win-card {
  position: relative; width: min(100%, 380px); margin: auto; padding: 18px 20px 18px; border-radius: 18px; background: #fbf4e0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25); text-align: center; color: var(--c-text);
  animation: cc-pop .32s cubic-bezier(.3, 1.4, .5, 1);
}
@keyframes cc-pop { from { transform: scale(.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cc-win-card .result-card { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.cc-win-card .result-done { font-size: 1.45rem; margin: 0 0 2px; }
.cc-feel { margin: 12px 0 0; font-size: .92rem; font-weight: 700; }
.cc-moods { display: flex; justify-content: center; gap: 10px; margin: 6px 0 0; }
.cc-mood {
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-width: 76px;
  border: 1px solid var(--c-border); background: #fff; color: var(--c-text-soft);
  font: inherit; font-size: .8rem; font-weight: 600; padding: 6px 8px; border-radius: 12px; cursor: pointer;
}
.cc-mood .cc-icon { width: 30px; height: 30px; }
.cc-mood:hover { color: var(--c-text); }
.cc-mood.on { color: var(--c-primary-dark, var(--c-primary)); border-color: var(--c-primary); }
.cc-note { display: block; min-height: 1.3em; margin: 6px 0 0; font-size: .85rem; color: var(--c-text-soft); }
/* Favorite, Share and Replay journey carry the same weight, so they wear the same style. */
.cc-acts { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.cc-act {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--c-border); background: #fff; color: var(--c-text);
  font: inherit; font-size: .88rem; font-weight: 700; padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
.cc-act:hover { border-color: var(--c-primary); }
.cc-act.on { color: #d6456b; border-color: #efb3c3; }
.cc-win-close {
  position: absolute; top: 4px; right: 8px;
  border: 0; background: none; color: var(--c-text-soft);
  font: inherit; line-height: 1; padding: 6px; cursor: pointer; border-radius: 8px;
}
.cc-win-close .cc-icon { width: 1.1rem; height: 1.1rem; }
.cc-win-close:hover { background: var(--c-bg); color: var(--c-text); }
.cc-win-reopen {
  border: 1px solid var(--c-border); background: rgba(255, 255, 255, .94); color: var(--c-text);
  font: inherit; font-size: .85rem; font-weight: 700; padding: 8px 16px; border-radius: 999px;
  cursor: pointer; box-shadow: 0 4px 14px rgba(28, 32, 50, .18);
}
.cc-end:has(.cc-win-reopen:not([hidden])) { background: none; pointer-events: none; align-items: end; }
.cc-end:has(.cc-win-reopen:not([hidden])) .cc-win-reopen { pointer-events: auto; }

/* Mode 3 — phone. The panel sheds its card and reaches the gutter. */
@media (max-width: 640px) {
  .game-root[data-game="marble-shooter"] { border-radius: 0; margin-inline: -8px; padding: 8px 8px 12px; }
  .cc { gap: 6px; }
  /* The board is bound by the width on every phone, so the box takes the board's shape; a
     height budget alone leaves dead panel above and below it and pushes the controls down. */
  .cc-fit { height: auto; aspect-ratio: 1 / 1; max-height: calc(100svh - 200px); min-height: 0; }
  .cc-controls, .cc-ctl-group { gap: 6px; }
  .cc-done-card { gap: 8px; padding: 11px 18px 13px; }
  .cc-done-head { font-size: 1.25rem; }
  .cc-done-next { padding: 8px 16px; font-size: .86rem; }
  .cc-ctl { padding: 6px 9px; font-size: .8rem; }
  .cc-nav { width: 46px; height: 46px; }
  .cc-nav .cc-icon { width: 34px; height: 34px; }
}

/* Mode 1 — page-embedded above the phone: the whole card fits under the header. */
@media (min-width: 641px) {
  .cc-fit { height: min(760px, calc(100svh - 230px)); }
}

/* A phone on its side. */
@media (max-width: 900px) and (max-height: 480px) {
  .cc-cap { display: none; }
  /* max-height: none, or the phone rule's cap above wins under 641px wide. */
  .cc-fit { height: max(160px, calc(100svh - 120px)); max-height: none; min-height: 0; aspect-ratio: auto; }
}

/* Mode 2 — page-filling. The panel's size is game-layout.css's; all that is left here is how
   the box inside it divides, so nothing below may name a window measurement. */
html.fills-window .game-root[data-game="marble-shooter"] .cc { height: 100%; }
html.fills-window .game-root[data-game="marble-shooter"] .cc > :not(.cc-fit) { flex: none; }
html.fills-window .game-root[data-game="marble-shooter"] .cc-fit { flex: 1 1 0; height: auto; min-height: 0; }

/* Mode 4 — true full screen, over the page. */
body.cc-locked { overflow: hidden; }
.game-root .cc-full {
  position: fixed; inset: 0; z-index: 200; margin: 0; padding: 10px;
  background: radial-gradient(120% 100% at 50% 0%, #2c2218 0%, #18120b 55%, #060402 100%);
}
.game-root .cc-full .cc-fit { flex: 1 1 0; height: auto; max-height: none; min-height: 0; aspect-ratio: auto; }
.game-root .cc-full > :not(.cc-fit) { flex: none; }
.game-root .cc-full .cc-stage { touch-action: none; }
