/* Eğlence modu (plan 98). Every rule here needs either body[data-fun="on"] or an element fun-mode.js only
   renders while the mode is on (.arena-result__fun, the injected switch row uses the existing .switch-row),
   so a device with the mode off looks exactly as without this sheet. */

/* Indicator: a small gold dot on the Araçlar buttons while the mode is on (decorative; the label says it). */
body[data-fun="on"] #settingsButton::after,
body[data-fun="on"] .tab-bar [data-action="open-teacher-tools"]::after {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface);
  content: "";
  pointer-events: none;
}
/* On the phone tab bar the dot sits on the icon's top right corner. */
body[data-fun="on"] .tab-bar [data-action="open-teacher-tools"]::after { top: 6px; right: calc(50% - 20px); }

/* Result line: a panda speech bubble under the headline, its tail pointing back at the panda.
   A solid surface (no gradient) so the text contrast is the token pair it looks like. */
.arena-result__fun {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 10px 0 0 9px;
  padding: 6px 14px 7px;
  color: var(--ink);
  background: var(--gold-tint);
  border: 2px solid var(--gold);
  border-radius: 16px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
  animation: fun-bubble-in .4s .35s ease-out both;
}
.arena-result__fun::before {
  position: absolute;
  top: 50%;
  left: -8px;
  width: 12px;
  height: 12px;
  background: var(--gold-tint);
  border-bottom: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
  transform: translateY(-50%) rotate(45deg);
  content: "";
}
@keyframes fun-bubble-in { from { opacity: 0; } }

/* The 1366×768 board: the hero is already compact; the bubble stays one line and slightly smaller. */
@media (max-height: 820px) {
  .arena-result__fun { margin-top: 6px; padding-block: 4px 5px; font-size: 16px; }
  .arena-result__hero:has(.arena-result__fun) .arena-result__announcement { padding-top: 2px; }
  .arena-result__hero:has(.arena-result__fun) .arena-result__announcement h3::after { margin-top: 5px; }
}
@media (max-width: 680px) {
  .arena-result__fun { margin-top: 6px; padding: 4px 10px 5px; font-size: 15px; line-height: 1.25; }
}

/* Konular duel/team results: centred under the headline; the panda (session referee) sits elsewhere. */
.results-card .arena-result__fun { margin: 8px auto 4px; text-align: center; }
.results-card .arena-result__fun::before { display: none; }

/* High contrast and forced colours: solid outlines from the existing tokens or system colours. */
body.high-contrast .arena-result__fun,
body.high-contrast .arena-result__fun::before { background: var(--surface); border-color: var(--navy); }
body.high-contrast .arena-result__fun { color: var(--ink); }
@media (forced-colors: active) {
  .arena-result__fun, .arena-result__fun::before { color: CanvasText; background: Canvas; border-color: CanvasText; }
  body[data-fun="on"] :is(#settingsButton, .tab-bar [data-action="open-teacher-tools"])::after { background: Highlight; forced-color-adjust: none; }
}

/* Reduced motion: the bubble is simply there. */
body.reduced-motion .arena-result__fun { animation: none; }
@media (prefers-reduced-motion: reduce) {
  body:not(.motion-on) .arena-result__fun { animation: none; }
}
