*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff4dd;
  color: #10434f;
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  gap: 1.5rem;
  padding: 2rem 1rem 3rem;
  width: 100%;
}

.top-bar {
  width: min(960px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand img {
  height: 60px;
}

.brand h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  display: flex;
  gap: 0.35rem;
}

.brand-primary {
  color: #10434f;
}

.brand-secondary {
  color: #e26b27;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links a {
  color: #10434f;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.2rem;
}

.nav-links a:hover,
.nav-links a:focus {
  border-bottom-color: #e26b27;
}

.nav-links a.active {
  border-bottom-color: #10434f;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(900px, 100%);
}

#board {
  width: min(420px, 92vw);
  contain: layout paint;
  transform: translateZ(0);
}


#board .board-b72b1 {
  transform: translateZ(0);
  backface-visibility: hidden;

  box-shadow: 0 16px 34px rgba(16, 67, 79, 0.16);
  border-radius: 8px;
  overflow: hidden;
}

#board .piece-417db {
  transform: translateZ(0);
  backface-visibility: hidden;
}

#board .square-55d63 {
  transition: background-color 100ms linear;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: min(700px, 100%);
}

.controls>* {
  max-width: 100%;
}

.controls label {
  font-weight: 600;
}

select,
button,
input[type='number'] {
  background: #10434f;
  color: #fff4dd;
  border: 2px solid #10434f;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-weight: 600;
  min-height: 44px;
  font-size: 1rem;
}

button:hover,
select:hover,
input[type='number']:hover,
button:focus,
select:focus,
input[type='number']:focus {
  background: #0c3944;
  outline: none;
}


.analysis-panel {
  width: min(700px, 100%);
  background: #ffffff;
  border: 2px solid rgba(16, 67, 79, 0.15);
  border-radius: 10px;
  padding: 1rem;
}

.analysis-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

#analysis-commentary {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 18rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.analysis-message {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  max-width: 92%;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 220ms ease;
}

.analysis-message.is-updating {
  opacity: 0;
  transform: translateY(4px);
}

.analysis-message--system {
  align-self: center;
  max-width: 100%;
  background: #eef3f5;
  color: #365560;
  border: 1px solid #d8e4e8;
}

.analysis-message--assistant,
.analysis-message--report {
  align-self: flex-start;
  background: #d9e7ff;
  color: #1f4660;
}

.analysis-actions {
  margin: 0.35rem 0 0.55rem;
}

#full-commentary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.primary-link {
  display: inline-block;
  margin-top: 1rem;
  background: #e26b27;
  color: #fff4dd;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
}

.primary-link:hover,
.primary-link:focus {
  background: #c75a1f;
}

.profile-wrapper {
  width: min(720px, 90vw);
}

.profile-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 12px 30px rgba(16, 67, 79, 0.12);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-card h2 {
  margin: 0;
  font-size: 2rem;
}

.profile-card p {
  margin: 0;
  line-height: 1.6;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-form fieldset {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 2px solid rgba(16, 67, 79, 0.15);
  border-radius: 10px;
}

.profile-form legend {
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0 0.25rem;
}

.profile-field-description {
  color: rgba(16, 67, 79, 0.8);
  font-size: 0.95rem;
}

.profile-form label {
  font-weight: 600;
}

.profile-form input,
.profile-form select,
.profile-form textarea {
  padding: 0.6rem 0.75rem;
  border: 2px solid rgba(16, 67, 79, 0.2);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  background: #f7fcfd;
  color: #10434f;
  min-height: 44px;
}

.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus {
  outline: 3px solid rgba(226, 107, 39, 0.35);
  border-color: #e26b27;
}

.profile-checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem 1rem;
  padding: 1rem;
  border-radius: 8px;
  border: 1px dashed rgba(16, 67, 79, 0.25);
  background: rgba(16, 67, 79, 0.04);
}

.profile-checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.profile-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.profile-toggle input {
  width: 20px;
  height: 20px;
}

.profile-toggle__label {
  font-weight: 600;
}

.profile-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.profile-save,
.profile-reset {
  border: none;
  cursor: pointer;
  border-radius: 6px;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-family: inherit;
}

.profile-save {
  background: #e26b27;
  color: #fff4dd;
}

.profile-save:hover,
.profile-save:focus {
  background: #c75a1f;
}

.profile-reset {
  background: transparent;
  border: 2px solid rgba(16, 67, 79, 0.2);
  color: #10434f;
}

.profile-reset:hover,
.profile-reset:focus {
  border-color: #10434f;
}

.profile-status {
  min-height: 1.2rem;
  font-weight: 600;
  color: #10434f;
}

.profile-summary {
  border-top: 1px solid rgba(16, 67, 79, 0.15);
  padding-top: 1rem;
}

.profile-summary h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.profile-summary p {
  margin: 0;
  line-height: 1.6;
}

.profile-summary__list {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr;
  gap: 0.4rem 1.25rem;
  margin: 0;
}

.profile-summary__list dt {
  font-weight: 600;
}

.profile-summary__list dd {
  margin: 0;
}



.game-insights {
  width: min(420px, 92vw);
  display: grid;
  align-items: stretch;
  gap: 0.75rem;
}

.eval-meter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.eval-meter__side {
  font-size: 0.8rem;
  font-weight: 700;
  color: #10434f;
  opacity: 0.85;
  line-height: 1;
}

.status-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.thinking-indicator {
  font-weight: 600;
  color: #e26b27;
}

.eval-label {
  font-size: 1.1rem;
  font-weight: 600;
}


.turn-indicator {
  margin: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid rgba(16, 67, 79, 0.2);
  background: rgba(16, 67, 79, 0.08);
  color: #10434f;
}

.turn-indicator--your {
  background: rgba(40, 167, 69, 0.15);
  border-color: rgba(40, 167, 69, 0.35);
  color: #1d6a35;
}

.turn-indicator--engine {
  background: rgba(226, 107, 39, 0.14);
  border-color: rgba(226, 107, 39, 0.35);
  color: #9b4618;
}

.turn-indicator--finished {
  background: rgba(16, 67, 79, 0.12);
}

.eval-explainer {
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: rgba(16, 67, 79, 0.06);
  border: 1px dashed rgba(16, 67, 79, 0.2);
  font-size: 0.88rem;
  line-height: 1.35;
  color: #235865;
}

.game-result-banner {
  width: min(420px, 92vw);
  background: #ffffff;
  border: 2px solid rgba(16, 67, 79, 0.15);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  box-shadow: 0 6px 16px rgba(16, 67, 79, 0.08);
}

.game-result-banner h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.game-result-banner p {
  margin: 0;
  color: #235865;
}

.game-result-banner__actions {
  margin-top: 0.7rem;
}

#download-loss-report {
  background: #e26b27;
  border-color: #e26b27;
  color: #fff4dd;
}

#download-loss-report:hover,
#download-loss-report:focus {
  background: #c75a1f;
  border-color: #c75a1f;
}


.game-result-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
}

.game-result-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 30, 36, 0.45);
}

.game-result-modal__dialog {
  position: relative;
  width: min(380px, 90vw);
  background: #fffdf6;
  border: 2px solid rgba(16, 67, 79, 0.25);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(16, 67, 79, 0.25);
  text-align: center;
}

.game-result-modal__dialog h3 {
  margin: 0 0 0.4rem;
  color: #10434f;
}

.game-result-modal__dialog p {
  margin: 0;
  color: #235865;
}

.game-result-modal__actions {
  margin-top: 0.9rem;
}

#game-result-modal-close {
  background: #e26b27;
  border-color: #e26b27;
  color: #fff4dd;
}

#game-result-modal-close:hover,
#game-result-modal-close:focus {
  background: #c75a1f;
  border-color: #c75a1f;
}

.confetti-piece {
  position: fixed;
  top: -16px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  opacity: 0.92;
  pointer-events: none;
  z-index: 9999;
  animation: confetti-fall var(--fall-duration, 3s) linear forwards;
}

@keyframes confetti-fall {
  from {
    transform: translate3d(0, -8vh, 0) rotate(0deg);
  }
  to {
    transform: translate3d(var(--x-drift, 0px), 110vh, 0) rotate(720deg);
  }
}

.eval-bar {
  width: 180px;
  flex: 1;
  min-width: 0;
  height: 24px;
  border: 2px solid #10434f;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  background: #f3ead3;
  position: relative;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55);
}

.eval-bar__midline {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 50%;
  border-left: 1px dashed rgba(16, 67, 79, 0.35);
  transform: translateX(-0.5px);
  pointer-events: none;
}

.eval-bar__fill {
  height: 100%;
  background: linear-gradient(to right, #10434f, #1b6678);
  transition: width 180ms ease;
}

/* ── Move History Panel ──────────────────────────────────── */

.move-history-panel {
  width: min(420px, 92vw);
  background: #ffffff;
  border: 2px solid rgba(16, 67, 79, 0.12);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(16, 67, 79, 0.06);
}

.move-history-panel__title {
  margin: 0;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff4dd;
  background: #10434f;
}

.move-history-panel__scroll {
  max-height: 160px;
  overflow-y: auto;
  padding: 0.35rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 67, 79, 0.25) transparent;
}

.move-history-panel__scroll::-webkit-scrollbar {
  width: 5px;
}

.move-history-panel__scroll::-webkit-scrollbar-thumb {
  background: rgba(16, 67, 79, 0.25);
  border-radius: 4px;
}

.move-history-panel__empty {
  margin: 0;
  padding: 0.75rem 0.85rem;
  font-size: 0.88rem;
  color: rgba(16, 67, 79, 0.5);
  font-style: italic;
}

.move-row {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.85rem;
  font-size: 0.92rem;
  gap: 0.4rem;
  transition: background 120ms ease;
}

.move-row:nth-child(odd) {
  background: rgba(16, 67, 79, 0.03);
}

.move-row:hover {
  background: rgba(226, 107, 39, 0.08);
}

.move-row__number {
  font-weight: 700;
  color: rgba(16, 67, 79, 0.45);
  min-width: 2ch;
  text-align: right;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.move-row__white,
.move-row__black {
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  min-width: 4.5ch;
  cursor: default;
  transition: background 100ms ease;
}

.move-row__elapsed {
  margin-right: 0.45rem;
  font-size: 0.72rem;
  color: rgba(16, 67, 79, 0.68);
  font-variant-numeric: tabular-nums;
  background: rgba(16, 67, 79, 0.08);
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
}

.move-row__white {
  color: #10434f;
}

.move-row__black {
  color: #10434f;
}

.move-row__white:hover,
.move-row__black:hover {
  background: rgba(226, 107, 39, 0.15);
}

.move-row__white.move--latest,
.move-row__black.move--latest {
  background: rgba(226, 107, 39, 0.18);
  color: #e26b27;
  font-weight: 700;
}

/* ── Enhanced Thinking Indicator ─────────────────── */

.thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-weight: 600;
  color: #e26b27;
  animation: thinking-pulse 1.6s ease-in-out infinite;
}

@keyframes thinking-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.55;
  }
}

.thinking-indicator__engine {
  font-weight: 700;
}

.thinking-indicator__dots::after {
  content: '';
  display: inline-block;
  width: 1.4em;
  text-align: left;
  animation: dots-cycle 1.5s steps(4, end) infinite;
}

@keyframes dots-cycle {
  0% {
    content: '';
  }

  25% {
    content: '.';
  }

  50% {
    content: '..';
  }

  75% {
    content: '...';
  }

  100% {
    content: '';
  }
}

.thinking-indicator__timer {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(226, 107, 39, 0.12);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.3rem;
}

/* ── Undo Button ─────────────────────────────────── */

#undo {
  background: transparent;
  color: #10434f;
  border: 2px solid rgba(16, 67, 79, 0.3);
}

#undo:hover,
#undo:focus {
  border-color: #e26b27;
  color: #e26b27;
  background: rgba(226, 107, 39, 0.06);
}

#undo:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(16, 67, 79, 0.15);
  color: rgba(16, 67, 79, 0.4);
}

#board .square-55d63.last-move {
  box-shadow: inset 0 0 0 4px rgba(226, 107, 39, 0.8);
  animation: pulse-highlight 240ms ease-out;
}

@keyframes pulse-highlight {
  0% {
    filter: brightness(1.15);
  }

  100% {
    filter: brightness(1);
  }
}

@media (max-width: 900px) {
  body {
    padding-top: 1.5rem;
  }

  .top-bar {
    width: min(900px, 94vw);
  }
}

@media (max-width: 720px) {
  body {
    padding: 1.25rem 0.75rem 2rem;
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
  }

  .nav-links {
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
  }

  .language-switcher {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .controls label {
    width: 100%;
    text-align: left;
  }

  .controls select,
  .controls input[type='number'],
  .controls button {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .brand h1 {
    font-size: 1.6rem;
  }

  #board {
    width: min(320px, 94vw);
  }

  .game-insights {
    width: min(320px, 94vw);
  }

  .status-row {
    min-width: 0;
  }

  .thinking-indicator {
    font-size: 0.95rem;
  }

  .eval-bar {
    height: 24px;
  }

  .profile-card {
    padding: 1.5rem;
  }

  .profile-form fieldset {
    padding: 1rem;
  }

  .profile-summary__list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .brand h1 {
    font-size: 1.35rem;
  }

  .brand img {
    height: 52px;
  }

  #board,
  .game-insights {
    width: 100%;
  }

  .eval-bar {
    height: 24px;
  }

  .contact-link {
    font-size: 1rem;
    overflow-wrap: anywhere;
  }
}

/* Main Footer Styles */
.main-footer {
  width: 100%;
  margin-top: auto;
  padding: 3rem 1rem;
  color: #fff4dd;
  background:
    radial-gradient(circle at 15% 15%, rgba(234, 124, 53, 0.22), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(75, 164, 184, 0.2), transparent 45%),
    linear-gradient(140deg, #0e3b45 0%, #124b58 55%, #1d5f6f 100%);
  border-top: 4px solid #e26b27;
}

.footer-content {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(1rem, 1.8vw, 1.5rem);
  display: grid;
  gap: 1.3rem;
  justify-items: center;
  text-align: center;
  border: 1px solid rgba(255, 244, 221, 0.18);
  border-radius: 20px;
  background: rgba(8, 35, 41, 0.38);
  backdrop-filter: blur(2px);
}

.footer-branding {
  display: grid;
  gap: 0.35rem;
}

.footer-kicker {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: #f7d8ab;
  opacity: 0.9;
}

.footer-title {
  margin: 0;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  font-weight: 600;
}

.footer-quote {
  margin: 0;
  max-width: 760px;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 244, 221, 0.06);
  border: 1px solid rgba(255, 244, 221, 0.18);
  transition: opacity 260ms ease, transform 260ms ease;
  min-height: 124px;
  opacity: 1;
}

.footer-quote--fading {
  opacity: 0.25;
  transform: translateY(4px);
}

.footer-quote__text {
  margin: 0;
  font-size: clamp(1rem, 1.9vw, 1.2rem);
  line-height: 1.6;
  font-weight: 500;
}

.footer-quote__author {
  margin-top: 0.5rem;
  opacity: 0.85;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.footer-links a {
  color: #fff4dd;
  text-decoration: none;
  font-weight: 600;
  padding: 0.25rem 0.4rem;
  border-bottom: 2px solid transparent;
}

.footer-links a:hover,
.footer-links a:focus {
  border-bottom-color: #f7d8ab;
}

/* ── Engine Attribution & Layout Tweaks ──────────────── */

.move-row__white.move--engine,
.move-row__black.move--engine {
  border-bottom: 2px solid #e26b27;
  position: relative;
}

.move-row__white.move--engine::after,
.move-row__black.move--engine::after {
  content: '🤖';
  font-size: 0.75em;
  margin-left: 0.3ch;
  vertical-align: middle;
  opacity: 0.7;
}

.thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-weight: 600;
  color: #e26b27;
  flex-wrap: wrap;
  /* Allow message to wrap if needed */
}

.thinking-indicator__message {
  font-size: 0.85em;
  color: #10434f;
  margin-left: 0.5rem;
  font-weight: 400;
  font-style: italic;
  opacity: 0.8;
  animation: fade-in 0.5s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }

  to {
    opacity: 0.8;
    transform: translateY(0);
  }
}

/* Compact Game Insights */
.game-insights {
  margin-top: 0.5rem;
  /* Reduced from default if any */
  padding: 0.75rem;
  /* reduced padding */
  background: #f8fbfd;
  border-radius: 8px;
  border: 1px solid rgba(16, 67, 79, 0.08);
}

.status-row {
  margin-bottom: 0.5rem;
}

/* Controls above board adjustments */
.controls {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(16, 67, 79, 0.1);
}

@media (max-width: 720px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .game-insights {
    margin-top: 1rem;
  }
}

.footer-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  width: min(760px, 100%);
}

.footer-action-card {
  width: 100%;
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 244, 221, 0.22);
  background: rgba(255, 244, 221, 0.05);
}

.footer-action-card__label {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f7d8ab;
  font-weight: 600;
}

.bmc-button {
  display: inline-flex;
  max-width: 100%;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.bmc-button img {
  max-width: 100%;
  height: auto !important;
}

.bmc-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.contact-link {
  color: #fff4dd;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.03rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(255, 244, 221, 0.32);
  border-radius: 999px;
  background: rgba(255, 244, 221, 0.08);
  transition: all 0.2s ease;
}

.contact-link:hover {
  background: rgba(255, 244, 221, 0.16);
  border-color: #fff4dd;
  transform: translateY(-2px);
}

.contact-link .icon {
  font-size: 1.1rem;
}

.copyright {
  margin: 0;
  font-size: 0.87rem;
  opacity: 0.85;
  letter-spacing: 0.02em;
}

@media (min-width: 700px) {
  .footer-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

.about-wrapper {
  width: min(1000px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about-hero,
.about-section,
.about-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(16, 67, 79, 0.12);
  box-shadow: 0 10px 24px rgba(16, 67, 79, 0.08);
}

.about-hero {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background:
    radial-gradient(circle at top right, rgba(226, 107, 39, 0.16), transparent 44%),
    radial-gradient(circle at bottom left, rgba(16, 67, 79, 0.12), transparent 50%),
    #ffffff;
}

.about-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 700;
  color: #e26b27;
}

.about-hero h2 {
  margin: 0.5rem 0 0.65rem;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
}

.about-hero p {
  margin: 0;
  line-height: 1.75;
  max-width: 75ch;
}

.about-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.about-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 6px;
  border: 2px solid #10434f;
  color: #10434f;
  text-decoration: none;
  padding: 0.55rem 1rem;
  font-weight: 600;
}

.about-secondary-link:hover,
.about-secondary-link:focus {
  background: rgba(16, 67, 79, 0.08);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.about-card {
  padding: 1rem;
}

.about-card h3,
.about-section h3 {
  margin: 0 0 0.5rem;
}

.about-card p,
.about-section p {
  margin: 0;
  line-height: 1.65;
}

.about-section {
  padding: 1.2rem;
}

.about-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
  line-height: 1.65;
}

.about-faq details {
  border: 1px solid rgba(16, 67, 79, 0.14);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  background: #f9fcfd;
}

.about-faq details+details {
  margin-top: 0.7rem;
}

.about-faq summary {
  cursor: pointer;
  font-weight: 600;
}

.about-faq details p {
  margin-top: 0.6rem;
}

@media (max-width: 720px) {
  .about-wrapper {
    width: min(1000px, 94vw);
  }
}

/* Analysis Panel & Toggle */
.analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.analysis-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: #e26b27;
}

input:focus+.slider {
  box-shadow: 0 0 1px #e26b27;
}

input:checked+.slider:before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #10434f;
}

/* Ensure controls stack properly on mobile */
@media (max-width: 480px) {
  .analysis-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* Enhanced thinking panel */
#board .piece-417db {
  image-rendering: auto;
}

.thinking-indicator {
  width: 100%;
  display: grid;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 243, 225, 0.95), rgba(255, 233, 204, 0.9));
  border: 1px solid rgba(226, 107, 39, 0.22);
  color: #10434f;
  box-shadow: 0 6px 14px rgba(16, 67, 79, 0.08);
  animation: none;
}

.thinking-indicator__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.thinking-indicator__badge {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: #fff4dd;
  background: #e26b27;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
}

.thinking-indicator__timer {
  margin-left: auto;
}

.thinking-indicator__message {
  margin-left: 0;
  min-height: 1.15rem;
  color: #235865;
}

.thinking-indicator__progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(16, 67, 79, 0.12);
  overflow: hidden;
}

.thinking-indicator__progress-fill {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e26b27, #1b6678);
  transform: translateX(-120%);
}

.thinking-indicator--active .thinking-indicator__progress-fill {
  animation: thinking-progress 1.25s ease-in-out infinite;
}

@keyframes thinking-progress {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}

.freestyle-status {
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  background: rgba(27, 102, 120, 0.1);
  color: #10434f;
  border: 1px solid rgba(16, 67, 79, 0.18);
  font-weight: 600;
}
