/* Keep coaching inside the existing Fox speech bubble. */
#board-task.has-fox-review .puzzle-task-fox-bubble { grid-template-columns: minmax(0, 1fr); text-align: left; }
.fox-move-details { position: relative; margin-top: 12px; }
#board-task.has-fox-review #board-task-title,
#board-task.has-fox-review #board-task-side,
#board-task.has-fox-review #puzzle-task-standing { display: none !important; }
.fox-move-review { min-width: 0; width: 100%; color: #67554d; }
.fox-move-heading { margin: 0 0 12px; font: 700 15px/1.4 var(--sans); }
#board-task.has-fox-review .fox-move-toolbar { display: flex; flex-wrap: nowrap; gap: 12px; padding-bottom: 3px; }
#board-task.has-fox-review .fox-move-toolbar > button,
#board-task.has-fox-review .fox-move-toolbar > .learning-result-actions { flex: 1; min-width: 0; }
#board-task.has-fox-review .learning-result-actions { margin: 0; gap: 8px; }
#board-task.has-fox-review .fox-move-toolbar button {
    display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 7px;
    width: 100%; min-height: 48px; padding: 6px 8px; border: 1px solid #d5bba7;
    border-radius: 10px; background: #fffaf5; box-shadow: 0 3px 0 #c7ad99;
    color: #654633; font: 800 12px/1.3 var(--sans); text-decoration: none;
}
.fox-move-toolbar button img { flex: none; width: 34px; height: 34px; object-fit: contain; }
#board-task.has-fox-review .fox-move-toolbar button:hover { background: #fff4e7; }
#board-task.has-fox-review .fox-move-toolbar button:focus-visible { outline: 3px solid #d78044; outline-offset: 3px; }
#board-task.has-fox-review .fox-move-toolbar button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #c7ad99; }
.fox-move-bubble > p { margin: 0 0 13px; font: 600 14px/1.65 var(--sans); }
.fox-move-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 10px; padding-bottom: 5px; }
.fox-move-actions button {
    min-height: 40px; padding: 9px 12px; border: 1px solid #d5bba7; border-radius: min(12px, var(--radius-limit, 14px));
    background: linear-gradient(155deg, #fffdf7, #f4e5d4); color: #654633;
    box-shadow: inset 0 1px 0 #fff, 0 4px 0 #b99477, 0 6px 9px #68462020;
    font: 700 12px/1.3 var(--sans); cursor: pointer; transition: transform .12s, box-shadow .12s;
}
.fox-move-actions button:first-child {
    border-color: #d66c51; background: linear-gradient(155deg, #ff9776, #ee7058); color: #fffaf4;
    box-shadow: inset 0 1px 0 #ffc2a8, 0 4px 0 #b65340, 0 6px 9px #68462026;
}
.fox-move-actions button:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 1px 0 #ffffff80, 0 1px 0 #b99477; }
.fox-move-actions button:focus-visible { outline: 3px solid #d78044; outline-offset: 4px; }
.fox-move-actions button:disabled { opacity: .5; cursor: default; }
.fox-move-preview { margin-top: 16px; }
.fox-move-board {
    position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); width: min(100%, 320px); aspect-ratio: 1;
    border: 4px solid var(--board-frame); border-radius: 7px; overflow: hidden; isolation: isolate;
    box-shadow: 0 5px 0 var(--board-frame), 0 8px 12px #30231825; margin: 0 auto 18px;
}
.fox-move-board .fox-square { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; padding: 0; border: 0; border-radius: 0; aspect-ratio: 1; overflow: visible; }
.fox-move-board .fox-square img { position: relative; width: 90%; height: 90%; object-fit: contain; pointer-events: none; }
.fox-move-review [hidden] { display: none !important; }
@media(max-width: 720px) {
    .fox-move-bubble > p { font-size: 13px; }
    .fox-move-actions { gap: 8px; }
    .fox-move-actions button { font-size: 11px; padding: 9px 10px; }
}
@media(prefers-reduced-motion: reduce) { .fox-move-actions button { transition: none; } }

.fox-move-arrow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; overflow: visible; }
.fox-move-arrow polygon { fill: rgba(247, 211, 89, .8); stroke: rgba(127, 89, 20, .35); stroke-width: .3; stroke-linejoin: round; }

.fox-move-navigation { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
.fox-move-navigation [data-back] { justify-self: start; }
#board-task.has-fox-review .fox-move-navigation [data-restart] {
    display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px;
    justify-self: center; box-sizing: border-box; width: 112px; min-width: 112px; min-height: 48px;
    padding: 7px 12px; font-size: 12px; line-height: 1.3; white-space: nowrap;
}
.fox-move-navigation [data-restart]::before {
    content: ''; flex: 0 0 30px; width: 30px; height: 30px;
    background: url('/assets/images/custom-tools/reset-v1-optimized.webp') center / contain no-repeat;
}
.fox-move-navigation [data-next] { justify-self: end; }
.fox-move-navigation button { padding: 9px 7px; white-space: nowrap; }
.fox-move-board .coord { font-size: 8px; line-height: 1; opacity: .9; }
@media(max-width: 380px) {
    .fox-move-navigation { gap: 4px; }
    .fox-move-navigation button { font-size: 10px; padding: 9px 4px; }
}



#report-board .fox-wrong-notice,
#report-board .puzzle-solved-notice {
    position: absolute; inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%);
    z-index: 20; display: block; padding: 14px 10px; border: 1px solid #d78a76;
    border-radius: 999px; width: max-content; max-width: calc(100% - 24px); box-sizing: border-box; background: #fff5ed; color: #a43f38; text-align: center;
    font: 800 16px/1.4 var(--sans); box-shadow: 0 4px 0 #bc6e5b, 0 8px 20px #54332933;
    pointer-events: none; animation: none;
}

.fox-move-details { scroll-margin-top: 90px; }
.fox-move-practice { display: grid; grid-template-columns: minmax(0, 100px); justify-content: center; gap: 8px; margin-top: 14px; }
#board-task.has-fox-review .fox-move-practice .learning-result-actions { display: flex; flex-direction: column; min-width: 0; }
#board-task.has-fox-review .fox-move-practice button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    width: 100%; min-width: 0; min-height: 66px; padding: 5px 3px 7px;
    border: 1px solid #d2c6bc; border-radius: 11px; background: #fffaf5;
    box-shadow: 0 2px 0 #bfb2a7; color: var(--ink); font: 800 11px/1.3 var(--sans);
}
.fox-move-practice button img { display: block; width: 38px; height: 38px; object-fit: contain; }
#board-task.has-fox-review .fox-move-practice button:hover { background: #fff; border-color: #b9aaa0; }
#board-task.has-fox-review .fox-move-practice button:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
#board-task.has-fox-review .fox-move-review.is-explained .fox-move-toolbar { display: none; }

#report-board .puzzle-solved-notice { border-color: #8eb59c; background: #f0fbf3; color: #286346; box-shadow: 0 4px 0 #719a7f, 0 8px 20px #284d3533; border-radius: 999px; padding: 12px 22px; width: max-content; max-width: calc(100% - 24px); box-sizing: border-box; }

/* Keep the standalone trophy panel readable over every page background. */
#puzzle-result-trophies {
    padding: 14px;
    border: 1px solid #dfd9d2;
    border-radius: var(--radius-limit, 14px);
    background: #fff8ed;
}

/* Match the Coach board's 3D previous/next controls. */
.fox-move-navigation button.fox-move-step {
    position: relative; width: 50px; height: 50px; min-height: 50px; padding: 0;
    border: 0; border-radius: 50%; background: transparent; box-shadow: none;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.fox-move-navigation button.fox-move-step::before {
    position: absolute; top: 3px; left: 5px; width: 40px; height: 40px;
    border: 1px solid #dc513f; border-radius: 50%;
    background: radial-gradient(circle at 34% 24%, rgba(255,255,255,.55) 0 8%, transparent 9%), linear-gradient(145deg,#ff9d7d 0%,#f5715e 52%,#dc4938 100%);
    box-shadow: inset 0 2px 1px rgba(255,255,255,.7), inset 0 -4px 4px rgba(156,39,26,.2), 0 4px 0 #bd3c2e, 0 7px 9px rgba(126,49,38,.24);
    content: ''; transition: filter .14s ease, transform .09s ease, box-shadow .09s ease;
}
.fox-move-navigation button.fox-move-step::after {
    position: absolute; z-index: 1; top: 14px; left: 19px; width: 14px; height: 18px;
    background: linear-gradient(90deg,#fff7eb,#fff); clip-path: polygon(10% 0,100% 50%,10% 100%);
    content: ''; filter: drop-shadow(0 1px 1px rgba(116,39,29,.42)); transform: translateX(1px); transition: transform .09s ease;
}
.fox-move-navigation button.fox-move-step.previous::after { transform: translateX(-1px) rotate(180deg); }
.fox-move-navigation button.fox-move-step:hover::before { filter: saturate(1.06) brightness(1.03); }
.fox-move-navigation button.fox-move-step:active:not(:disabled) { transform: none; box-shadow: none; }
.fox-move-navigation button.fox-move-step:active:not(:disabled)::before {
    box-shadow: inset 0 3px 5px rgba(129,31,21,.26), inset 0 1px 1px rgba(255,255,255,.32), 0 1px 0 #bd3c2e, 0 2px 3px rgba(126,49,38,.18);
    filter: saturate(1.04) brightness(.98); transform: translateY(4px);
}
.fox-move-navigation button.fox-move-step:active:not(:disabled)::after { transform: translate(1px,4px); }
.fox-move-navigation button.fox-move-step.previous:active:not(:disabled)::after { transform: translate(-1px,4px) rotate(180deg); }
@media(prefers-reduced-motion: reduce) {
    .fox-move-navigation button.fox-move-step::before, .fox-move-navigation button.fox-move-step::after { transition: none; }
}

/* Separate the finished puzzle explanation from the board in solved and Reveal states. */
#puzzle-explanation:not(.in-mobile-modal) { margin-top: 10px; }

.fox-move-practice:empty { display: none; }
