/* Only the unsaved tutorial page uses these controls and visual layers. */
body.torresTutorial #btn_nextGame,
body.torresTutorial #btn_undo,
body.torresTutorial #btn_redo,
body.torresTutorial #btn_undoAll,
body.torresTutorial #btn_redoAll,
body.torresTutorial #btn_finishTurn,
body.torresTutorial #gameOptions .gameOptionsActions,
body.torresTutorial #btnCancelGame {
    display: none !important;
}

body.torresTutorial #game .torres-square,
body.torresTutorial #game .torres-card-play,
body.torresTutorial #game .torres-track-token,
body.torresTutorial #game .torres-advance-btn,
body.torresTutorial #game .torres-knights,
body.torresTutorial #game .torres-stacks,
body.torresTutorial #game .torres-deck,
body.torresTutorial #game .torres-return-btn {
    cursor: default;
}

#torresTutorialSpotlight {
    position: fixed;
    inset: 0;
    z-index: 1040;
    pointer-events: none;
}

.torresTutorialOutline {
    fill: none;
    stroke: #ffd633;
    stroke-width: 3;
    stroke-linejoin: round;
}

#torresTutorialDialog {
    position: fixed;
    z-index: 1042;
    width: min(440px, calc(100vw - 16px));
    max-height: calc(100vh - 124px);
    overflow-y: auto;
    color: #241b10;
    background: #fdf9f0;
    border: 2px solid #78582d;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(32, 22, 10, 0.38);
    font: 14px/1.55 system-ui, -apple-system, sans-serif;
}

#torresTutorialDialog header {
    background: linear-gradient(180deg, #ead4a8 0%, #dfc088 100%);
    color: #2c1e0c;
    padding: 10px 16px 8px;
    border-bottom: 1px solid rgba(120, 88, 45, 0.35);
    border-radius: 8px 8px 0 0;
}

#torresTutorialDialog h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 3px;
    color: inherit;
}

.torresTutorialPosition {
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0;
    color: #543e21;
}

.torresTutorialReading {
    padding: 12px 16px;
}

.torresTutorialText {
    margin: 0;
    white-space: pre-line;
}

.torresTutorialExample {
    margin: 10px 0 0;
    padding: 8px;
    border-radius: 8px;
    background: #f4ebd8;
    border: 1px solid #d5c29d;
    text-align: center;
}

.torresTutorialExampleCards {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.torresTutorialExampleCards img {
    width: 68px;
    height: auto;
    display: block;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(32, 22, 10, 0.25);
}

.torresTutorialExample figcaption {
    font-size: 0.76rem;
    font-weight: 600;
    color: #4d391e;
    margin-top: 6px;
}

.torresTutorialScoreWrap {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f4ebd8;
    border: 1px solid #cfb98f;
    overflow-x: auto;
}

.torresTutorialScoreWrap h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: #4c361a;
    margin: 0 0 6px;
}

.torresTutorialScoreWrap .torres-score-breakdown {
    min-width: 0;
    width: 100%;
    font-size: 0.8rem;
}

.torresTutorialControls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 16px 12px;
}

#torresTutorialDialog .btn-outline-primary {
    color: #594100;
    border-color: #8c6a35;
}

#torresTutorialDialog .btn-outline-primary:hover:not(:disabled),
#torresTutorialDialog .btn-outline-primary:focus-visible:not(:disabled) {
    background-color: #6b4e18;
    border-color: #594100;
    color: #fff8e6;
}

#torresTutorialNext {
    margin-left: auto;
}

.torresTutorialContentsTitle {
    font-size: 1rem;
    font-weight: 700;
    margin: 0.75rem 0.6rem;
}

.torresTutorialChapter {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0.9rem 0.6rem 0.3rem;
    color: #594122;
}

.torresTutorialEntry {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 0.6rem;
    border: 0;
    border-bottom: 1px solid #e4d8c0;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.torresTutorialEntry .bi-check-circle {
    color: #15803d;
}

.torresTutorialEntry:hover,
.torresTutorialEntry[aria-current] {
    background: #efe2c6;
}

.torresTutorialEntry:focus-visible {
    outline: 2px solid #78582d;
    outline-offset: -2px;
}

#btn_torresTutorialReveal .buttonText {
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip-path: none !important;
}
