/* Arkadhallen – only what is special to the hall (the shared box is css/game-stage.css). */

/* Phones held upright: a taller box, so the machines' fields get room (like Atomobrik) */
@media (max-aspect-ratio: 1 / 1) {
  .stage {
    --aspect: 3 / 4;
  }
}

#game {
  outline: none;                 /* the canvas takes keyboard focus; no blue ring on the first click */
  -webkit-tap-highlight-color: transparent;
}

/* ---------- The hall: a grid of cabinets that always fits the box ----------
   Not zoomed like the other screens: arkadhall.js (fitHall) sets --u (16 px at 960 x 540, following the box),
   --cols / --rows (the grid shares the box's height, so it never scrolls) and --name (the cabinets' names). */

.arc-hall {
  --u: 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: calc(var(--u) * 0.5);
  /* (at the bottom room for the sound button in the corner: it must not cover the last cabinet's name) */
  padding: calc(var(--u) * 0.55 + var(--safe-top)) calc(var(--u) * 1.1 + var(--safe-right))
    calc(3.4rem + var(--safe-bottom)) calc(var(--u) * 1.1 + var(--safe-left));
  overflow: hidden;
  background: linear-gradient(to bottom, rgba(14, 10, 36, 0.55), rgba(14, 10, 36, 0.15) 45%, rgba(14, 10, 36, 0.35));
}

.ui-grows .arc-hall > * {
  zoom: 1;                       /* sized by --u instead (see above) */
}

.arc-hall-head {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 0.9);
  min-height: 2.8rem;            /* the fullscreen button's height: it sits in this row's corner */
  padding-right: 3rem;           /* ... so the row ends before it */
}

.stage .arc-hall .arc-sign {
  margin: 0;
  font-size: calc(var(--u) * 1.9);
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffd6f0;
  text-shadow: 0 0 4px var(--magenta), 0 0 12px var(--magenta), 0 0 26px rgba(255, 63, 180, 0.7);
  animation: arc-sign 7s infinite;
}

/* An old neon sign: now and then a tube flickers */
@keyframes arc-sign {
  0%, 62%, 66%, 68%, 100% { opacity: 1; }
  64%, 67% { opacity: 0.55; }
}

.arc-hall-text {
  flex: 1;
  margin: 0;
  font-size: calc(var(--u) * 1);
  font-weight: 700;
  color: var(--text-muted);
}

/* A narrow box (phones held upright): the sign and the button on one line, no little text */
@media (max-width: 560px) {
  .arc-hall-text {
    display: none;
  }

  .arc-hall-head {
    justify-content: space-between;
  }
}

.arc-hall .arc-random {
  margin: 0;
  padding: calc(var(--u) * 0.35) calc(var(--u) * 1.1);
  font-size: calc(var(--u) * 0.85);
}

.arc-cabinets {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 3), minmax(0, 1fr));
  gap: calc(var(--u) * 0.6);
}

/* One cabinet: a screen with the machine's picture, its name and the record (or "Ny!") */
.arc-cabinet {
  --c: var(--cyan);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  padding: calc(var(--u) * 0.3);
  font: inherit;
  text-align: center;
  color: var(--text);
  background: rgba(14, 10, 36, 0.82);
  border: 2px solid var(--c);
  box-shadow: 0 0 calc(var(--u) * 0.5) -2px var(--c);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}

.arc-cabinet-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  background: radial-gradient(circle at 50% 40%, #1b1150, #07051a 75%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* The picture fills the screen and keeps its shape (the SVG's own "meet"), whatever shape the screen has */
.arc-cabinet-screen .arc-icon {
  position: absolute;
  inset: 6%;
}

.arc-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.35));
}

.arc-cabinet-name {
  margin-top: calc(var(--u) * 0.2);
  font-size: var(--name, 1rem);
  font-weight: 900;
  font-style: italic;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--c);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arc-cabinet-foot {
  font-size: calc(var(--name, 1rem) * 0.72);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arc-cabinet.is-new .arc-cabinet-foot {
  color: var(--yellow);
}

.arc-cabinet:hover,
.arc-cabinet:focus-visible {
  outline: none;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 calc(var(--u) * 1.1) 0 var(--c);
  z-index: 1;
}

.arc-cabinet:focus-visible {
  border-color: var(--yellow);
}

.arc-cabinet:hover .arc-icon svg,
.arc-cabinet:focus-visible .arc-icon svg {
  animation: arc-bob 0.6s ease-in-out infinite alternate;
}

@keyframes arc-bob {
  from { transform: translateY(2%) scale(1); }
  to { transform: translateY(-3%) scale(1.06); }
}

/* ---------- A machine's start card ---------- */

/* The machine plays by itself behind the card (arkadhall.js startDemo): a veil it shows through – dark enough that the
   text stays easy to read (owner, 2026-10-15: 0.66 was "plåttrigt") */
.stage .arc-intro {
  background: rgba(14, 10, 36, 0.84);
}

.stage .arc-intro > * {
  text-shadow: 0 1px 3px rgba(7, 5, 26, 0.9);
}

.arc-intro-icon {
  --c: var(--cyan);
  width: 6.5rem;
  height: 6.5rem;
  padding: 0.5rem;
  margin-bottom: 0.4rem;
  background: radial-gradient(circle at 50% 40%, #1b1150, #07051a 75%);
  border: 2px solid var(--c);
  box-shadow: 0 0 16px -2px var(--c);
}

.arc-intro-icon .arc-icon {
  display: block;
  width: 100%;
  height: 100%;
}

.stage .arc-intro h2,
.stage .arc-result h2,
.stage .arc-paused h2 {
  margin-bottom: 0.3rem;
  font-size: 2.6rem;
  line-height: 1.1;
}

.stage .overlay .arc-goal {
  max-width: 30rem;
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
}

.stage .overlay .arc-controls {
  max-width: 34rem;
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.arc-controls kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0 0.35em;
  font: inherit;
  font-weight: 800;
  color: var(--cyan);
  border: 1px solid rgba(94, 240, 255, 0.55);
  border-bottom-width: 3px;
}

.stage .overlay .arc-best {
  min-height: 1.4em;
  margin: 0 0 0.8rem;
  font-weight: 800;
  font-style: italic;
  color: var(--yellow);
}

.stage .overlay .arc-best.is-record {
  color: var(--magenta);
  text-shadow: 0 0 10px rgba(255, 63, 180, 0.7);
}

.arc-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 0.9rem;
}

.arc-buttons .button {
  margin: 0;
}

/* ---------- After a round: the score and the three questions ---------- */

/* The round's last picture shows through – as dark a veil as the start card's, so the text stays easy to read */
.stage .arc-result {
  background: rgba(14, 10, 36, 0.84);
}

.stage .overlay .arc-result-score {
  margin: 0;
  font-size: 2rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1.2;
  color: var(--yellow);
  text-shadow: 0 0 12px rgba(255, 233, 77, 0.5);
}

/* The card keeps its size while the questions change, so the buttons under it never jump */
.arc-ask {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 21rem;
  min-height: 8.9rem;
  margin: 0.1rem 0 0.9rem;
  padding: 0.5rem 1rem 0.45rem;
  background: rgba(7, 5, 26, 0.85);
  border: 1px dashed rgba(94, 240, 255, 0.45);
}

.stage .overlay .arc-ask-question {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.arc-ask-answers {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
}

.arc-answer {
  --a: var(--cyan);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  width: 5.4rem;
  padding: 0.4rem 0.3rem 0.3rem;
  font: inherit;
  font-weight: 800;
  font-style: italic;
  color: var(--a);
  background: rgba(14, 10, 36, 0.85);
  border: 2px solid var(--a);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, background-color 0.1s;
}

.arc-answer-1 {
  --a: var(--yellow);
}

.arc-answer-2 {
  --a: var(--magenta);
}

.arc-answer-icon svg {
  display: block;
  width: 2.1rem;
  height: 2.1rem;
}

.arc-answer:hover,
.arc-answer:focus-visible {
  outline: none;
  transform: translateY(-2px);
  background: rgba(40, 30, 90, 0.95);
  box-shadow: 0 0 12px var(--a);
}

.arc-ask-dots {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.arc-ask-dots i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: rgba(159, 176, 214, 0.3);
}

.arc-ask-dots i.is-done {
  background: var(--cyan);
}

.arc-ask-dots i.is-now {
  background: var(--yellow);
}

.stage .overlay .arc-ask-thanks {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cyan);
}

.stage .overlay .arc-ask-note {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- The thumbs on a machine (ask.js createThumbs): dim until chosen, up cyan, down magenta ---------- */

.arc-thumbs {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

.arc-intro-thumbs .arc-thumbs {
  margin-top: 0.7rem;
}

.arc-ask .arc-thumbs {
  margin-top: 0.45rem;
}

.arc-thumb {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  color: var(--cyan);
  background: rgba(14, 10, 36, 0.95);   /* (nearly) solid: the demo behind must not show through */
  border: 2px solid rgba(159, 176, 214, 0.3);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.12s, border-color 0.12s;
}

.arc-thumb-down {
  color: var(--magenta);
}

/* Dim until chosen – only the thumb itself, never the button's background */
.arc-thumb svg {
  width: 1.7rem;
  height: 1.7rem;
  opacity: 0.6;
  transition: opacity 0.12s;
}

.arc-thumb:hover,
.arc-thumb:focus-visible {
  outline: none;
  transform: translateY(-2px);
}

.arc-thumb:hover svg,
.arc-thumb:focus-visible svg,
.arc-thumb.is-chosen svg {
  opacity: 1;
}

.arc-thumb:focus-visible {
  border-color: var(--yellow);
}

.arc-thumb.is-chosen {
  border-color: currentColor;
  box-shadow: 0 0 12px -2px currentColor;
}

.arc-thumb.is-chosen svg {
  filter: drop-shadow(0 0 3px currentColor);
}

/* Small boxes (phones): the answers a little tighter */
@media (max-width: 480px) {
  .arc-ask {
    min-width: 0;
    padding: 0.4rem 0.6rem;
  }

  .arc-answer {
    width: 4.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arc-sign,
  .arc-cabinet:hover .arc-icon svg,
  .arc-cabinet:focus-visible .arc-icon svg {
    animation: none;
  }
}

/* "Tillbaka till hallen" during a round, beside the pause button – the school games' back button (css/skolspel.css
   .skol-to-menu), but ALWAYS UNFOLDED so it is easy to see (owner, 2026-10-15). The first tap turns it yellow (class
   is-open, js/game-ui.js setupBackToMenu), the second leaves. Not at the bottom left like theirs: the touch buttons
   are there. A narrow box shows only the arrow (the score needs the room). */
.arc-back {
  position: absolute;
  z-index: 2;
  top: calc(0.6rem + var(--safe-top));
  left: calc(3.6rem + var(--safe-left));
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.6rem;
  padding: 0.3rem 0.65rem 0.3rem 0.55rem;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: rgba(14, 10, 36, 0.8);
  border: 2px solid rgba(94, 240, 255, 0.6);
  opacity: 0.85;
  cursor: pointer;
}

.arc-back[hidden] {
  display: none;
}

.arc-back-icon svg {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
}

.arc-back-text {
  white-space: nowrap;
  font-style: italic;
  font-weight: 900;
}

.arc-back:hover,
.arc-back:focus-visible,
.arc-back.is-open {
  opacity: 1;
  box-shadow: 0 0 10px var(--cyan);
}

.arc-back.is-open {
  color: #0e0a24;
  background: var(--yellow);
  border-color: var(--yellow);
}

@media (max-width: 640px) {
  .arc-back:not(.is-open) .arc-back-text {
    display: none;
  }
}
