/* Panel de entrenamiento y tablero del personaje diario. */
.db-character-page { padding-top: 23px; }
.db-title { text-align: center; color: #f4ecd9; margin-bottom: 24px; }
.db-title h1 { font-size: clamp(2.1rem, 4vw, 3rem); color: #ffce70; text-shadow: 2px 3px 0 #743818, 0 4px 16px #112c37; margin: 0 0 8px; line-height: 1.15; }
.db-title > p { color: #d6e0d4; font-size: 12px; margin-bottom: 17px; }
.db-difficulty-bar { display: inline-flex; padding: 5px; gap: 4px; border: 1px solid #87988b66; border-radius: 9px; background: #142f3be6; box-shadow: 0 3px 0 #10263060; }
.db-dif-btn { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 22px; min-height: 33px; border-radius: 5px; color: #cedacf; font-size: 12px; text-decoration: none; font-weight: 900; border: 1px solid transparent; }
.db-dif-btn.active { background: #fff1d2; color: var(--db-text); border-color: #ebca8b; box-shadow: 0 2px 4px #0002; }
.db-dif-btn:hover:not(.active) { color: #ffce70; background: #ffffff08; }
.db-dif-dot { width: 6px; height: 6px; border-radius: 50%; background: #74a993; }
.db-dif-dot--2 { background: #dc8b32; }
.db-dif-dot--3 { background: #7d9cc9; }
/* Una sola superficie de juego: pistas, búsqueda y tablero, como en WhatPiece. */
.db-character-page { width: min(1300px, 100%); }
.db-game { max-width: 1240px; margin: auto; padding: 22px 20px 16px; background: var(--db-surface); border: 2px solid #132f50; border-top: 5px solid var(--db-orange); border-radius: 12px; box-shadow: var(--db-shadow); }
.db-character-page .db-search-panel { position: relative; z-index: 20; max-width: 760px; margin: 23px auto 18px; padding: 0 12px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.db-search-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 17px; }
.db-search-emblem { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: #edce8d33; border: 1px solid #dbbb7b60; }
.db-search-heading label { display: block; font-size: 17px; line-height: 1.3; font-weight: 900; }
.db-search-heading p { margin: 3px 0 0; color: var(--db-muted); font-size: 11px; }
.db-controls { display: flex; align-items: stretch; gap: 8px; }
.db-search-wrap { position: relative; flex: 1; min-width: 0; }
.db-search-icon { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); color: #6b7a7b; pointer-events: none; font-size: 16px; }
.db-search-input { width: 100%; height: 49px; padding: 10px 12px 10px 40px; background: #fffdf5; border: 1px solid #b7b7a4; border-radius: 7px; color: var(--db-text); font-size: 13px; outline: none; box-shadow: inset 0 2px 3px #51432108; }
.db-search-input::placeholder { color: #758080; }
.db-search-input:focus { border: 2px solid var(--db-blue); padding-left: 39px; box-shadow: 0 0 0 3px #27639912; }
.db-search-input:disabled { background: #e8e5d9; color: #637172; }
.db-guess-btn, .db-surrender-btn, .db-share-btn { border-radius: 7px; font-weight: 900; font-size: 13px; border: 1px solid transparent; }
.db-guess-btn { display: flex; align-items: center; justify-content: center; gap: 13px; padding: 0 19px; color: #fff9e7; background: #bc581b; border-color: #a04c20; box-shadow: 0 3px 0 #783614; }
.db-guess-btn:hover:not(:disabled) { background: #a94b13; }
.db-surrender-btn { width: 44px; color: #fff; background: #da3633; border-color: #da3633; transition: filter .2s; }
.db-surrender-btn:hover:not(:disabled) { filter: brightness(.85); }
.db-guess-btn:disabled, .db-surrender-btn:disabled { opacity: .55; cursor: default; box-shadow: none; }
.db-search-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; font-size: 10px; color: var(--db-muted); }
.db-search-status > span { display: flex; align-items: center; gap: 6px; }
.db-search-status > span > i { color: #42786b; }
.db-try-counter { margin: 0; font-size: 11px; font-weight: 900; color: #5a6c6d; white-space: nowrap; }
.db-autocomplete { position: absolute; top: calc(100% + 7px); left: 0; width: 100%; min-width: 230px; z-index: 30; max-height: 320px; overflow-y: auto; background: #fffaec; color: var(--db-text); border: 1px solid #acb0a0; border-radius: 8px; box-shadow: 0 12px 24px #102a3650; }
.db-ac-item { display: flex; align-items: center; gap: 11px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #e2d7c3; }
.db-ac-item img { width: 39px; height: 43px; border-radius: 5px; object-fit: cover; object-position: top; background: #e5decc; border: 1px solid #d2c6ab; }
.db-ac-item.highlighted, .db-ac-item:hover { background: #f0dcad; }
.db-ac-name { font-size: 13px; font-weight: 900; }
.db-ac-alias { font-size: 10px; color: #67716d; }
.db-ac-msg, .db-ac-more { padding: 12px; text-align: center; font-size: 12px; color: #667373; }
.db-ac-more { cursor: pointer; color: var(--db-blue); font-weight: 900; }
.db-hints-section { margin: 0 auto; }
.db-hints-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 12px; }
.db-hints-heading h2 { font-family: inherit; font-size: 12px; font-weight: 900; color: var(--db-text); margin: 0; }
.db-hints-heading > span { font-size: 11px; color: var(--db-muted); }
.db-hints { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.db-character-page .db-hint { --hint-progress: 0%; display: flex; align-items: center; justify-content: center; gap: 8px; position: relative; overflow: hidden; min-height: 44px; padding: 7px 9px; background: #173b64; border: 1px solid #385f85; border-radius: 6px; color: #fff1d2; text-align: left; box-shadow: 0 2px 0 #102d4c; }
.db-hint.disabled { cursor: default; }
.db-character-page .db-hint-icon { font-size: 17px; color: #ffd282; }
.db-hint-copy { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px 10px; }
.db-hint-title { font-size: 13px; font-weight: 900; }
.db-character-page .db-hint-lock { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border: 1px solid #729fc05e; border-radius: 12px; font-size: 10px; color: #d4e3ee; white-space: nowrap; }
.db-hint-lock i { font-size: 10px; }
.db-hint-progress { height: 3px; position: absolute; bottom: 0; left: 0; width: var(--hint-progress); background: var(--db-orange); transition: width .2s; }
.db-character-page .db-hint.enabled { cursor: pointer; border-color: #dc8e35; }
.db-character-page .db-hint.enabled:hover, .db-character-page .db-hint.active { background: #254f78; border-color: #ffbf60; }
.db-hint-ready { color: #ffd282; font-size: 11px; }
.db-hint:focus-visible { outline: 3px solid #f58b28; outline-offset: 3px; }
.db-revealed-hints:empty { display: none; }
.db-revealed-hints { margin-top: 13px; padding: 11px 16px; background: #fff8e8; border: 1px solid #c8b58e; border-left: 4px solid #f58b28; border-radius: 5px; font-size: 13px; color: var(--db-text); }
.db-revealed-hints p { margin: 3px 0; }
.db-revealed-hints strong { color: #8e4318; }
@media (min-width: 761px) {
    .db-revealed-hints { width: 600px; max-width: 100%; margin: 13px auto 0; text-align: center; }
}
.db-character-page .db-board { background: transparent; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
.db-board-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 6px 8px; }
.db-board-heading h2 { font-family: inherit; font-weight: 900; font-size: 12px; margin: 0; }
.db-board-heading > span { display: none; gap: 5px; align-items: center; color: var(--db-muted); font-size: 11px; }
.db-table-wrap { overflow-x: auto; padding: 0 0 8px; scrollbar-color: #c1782d #e5d7ba; scrollbar-width: thin; }
.db-table-wrap:focus-visible { outline: 3px solid var(--db-blue); outline-offset: 2px; }
.db-results { --cell-height: 96px; width: 100%; min-width: 1140px; border-collapse: separate; border-spacing: 6px 8px; table-layout: fixed; }
.db-col-nombre { width: 140px; }
.db-col-imagen { width: 68px; }
.db-col-genero { width: 92px; }
.db-col-raza { width: 120px; }
.db-col-cabello { width: 96px; }
.db-col-origen { width: 120px; }
.db-col-afiliacion { width: 140px; }
.db-col-etapa { width: 125px; }
.db-col-saga { width: 160px; }
.db-results thead th { padding: 14px 8px; text-align: center; background: #173b64; color: #ffe0a1; border: 1px solid #3e6386; border-bottom: 3px solid #f58b28; border-radius: 5px 5px 0 0; font-size: 12px; line-height: 1.3; font-weight: 900; overflow-wrap: anywhere; }
.db-results tbody :is(td, th) { height: var(--cell-height); padding: 12px 8px; vertical-align: middle; text-align: center; border-radius: 6px; font-size: 12px; font-weight: 800; line-height: 1.35; position: relative; overflow-wrap: anywhere; border: 1px solid #0002; }
.db-results .photo-cell { padding: 0; overflow: hidden; background: #e5ddc9; }
.db-photo { width: 100%; height: var(--cell-height); display: block; object-fit: cover; object-position: top; }
.db-results .name-cell { position: sticky; left: 0; z-index: 4; background: #e9dfc6; color: #173b64; box-shadow: 3px 0 0 var(--db-surface); }
.db-results thead th:first-child { position: sticky; left: 0; z-index: 5; box-shadow: 3px 0 0 var(--db-surface); }
.db-cell { color: #fffaf0; box-shadow: inset 0 -3px 0 #0002; transition: transform .3s, opacity .3s; isolation: isolate; }
.db-cell-content { position: relative; z-index: 2; display: block; }
.db-cell-content--unknown { font: 400 28px/1 'Nunito', sans-serif; }
/* Estado pequeño en la esquina; flechas de cronología grandes detrás del texto. */
.db-cell::before { position: absolute; top: 4px; right: 4px; z-index: 3; display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid #ffffff65; border-radius: 50%; background: #102b43c4; color: #fff9eb; font: 800 10px/1 Arial, sans-serif; pointer-events: none; }
.db-cell.correct { background: var(--db-correct); }
.db-cell.correct::before { content: '✓'; }
.db-cell.partial { background: var(--db-partial); color: #30250d; }
.db-cell.partial::before { content: '≈'; }
.db-cell.incorrect { background: var(--db-incorrect); }
.db-cell.incorrect::before { content: '×'; font-size: 12px; }
.db-cell.unknown { background: var(--db-unknown); }
.db-cell.unknown::before { content: '?'; }
.db-cell:is(.hint-up, .hint-down)::after { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; font: 900 calc(var(--cell-height) * .9)/1 Arial, sans-serif; color: rgb(0 0 0 / 55%); pointer-events: none; }
.db-cell.hint-up::after { content: '\2B06\FE0E'; }
.db-cell.hint-down::after { content: '\2B07\FE0E'; }
.db-cell:is(.hint-up, .hint-down) .db-cell-content { text-shadow: 0 1px 3px #0008; }
.db-cell.pending { transform: rotateX(90deg); opacity: 0; }
.db-board-empty { padding: 18px 20px 25px; text-align: center; }
.db-board-empty[hidden] { display: none; }
.db-empty-radar { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 10px; border: 1px solid #bebda3; border-radius: 50%; background: #dce0c83b; color: #617a80; font-size: 24px; }
.db-board-empty strong { display: block; font-size: 13px; color: #3f5861; }
.db-board-empty p { font-size: 12px; margin: 5px auto 0; color: #68776e; max-width: 400px; }
.db-legend { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 20px; width: fit-content; max-width: 100%; padding: 11px 20px; margin: 16px auto 0; border: 1px solid #527594; border-bottom: 3px solid #f58b28; border-radius: 30px; background: #173b64; color: #fff1d2; font-size: 11px; }
.db-legend > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.db-state-key { width: 19px; height: 19px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid #ffffff65; border-radius: 50%; color: #fff; font: 900 12px/1 Arial, sans-serif; }
.db-state-key.correct { background: var(--db-correct); }
.db-state-key.partial { background: var(--db-partial); color: #30250d; }
.db-state-key.incorrect { background: var(--db-incorrect); }
.db-state-key.unknown { background: var(--db-unknown); }
.db-direction-key { display: inline-grid; place-items: center; width: 21px; height: 21px; flex: 0 0 auto; border: 1px solid #ffffff65; border-radius: 5px; background: var(--db-incorrect); font: 900 18px/1 Arial, sans-serif; color: rgb(0 0 0 / 55%); }
.db-yesterday { display: flex; align-items: center; gap: 12px; max-width: 350px; margin: 24px auto 16px; padding: 10px 14px; background: #17313dcc; border: 1px solid #8b9f8d60; border-radius: 9px; color: #f9eacb; }
.db-yesterday img { width: 42px; height: 45px; border-radius: 5px; object-fit: cover; object-position: top; background: #ddd5b8; }
.db-yesterday div { display: flex; flex-direction: column; }
.db-yesterday span { font-size: 10px; color: #bbcdc1; }
.db-yesterday strong { font-size: 13px; }
/* Resultado: retrato y mensaje, compartir a todo el ancho, cuenta atrás debajo. */
.db-result { --result-tone: var(--db-correct); max-width: 520px; margin: 26px auto; padding: 24px 22px 20px; border: 2px solid var(--result-tone); border-top-width: 5px; border-radius: 12px; background: color-mix(in srgb, var(--result-tone) 8%, var(--db-surface)); box-shadow: var(--db-shadow); text-align: center; }
.db-result.is-loss { --result-tone: var(--db-incorrect); }
.db-result.hidden { display: none; }
.db-result-summary { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 21px; }
.db-result-portrait { display: grid; place-items: center; flex: 0 0 86px; width: 86px; height: 86px; overflow: hidden; border: 3px solid var(--result-tone); border-radius: 50%; background: #fff7e6; box-shadow: 0 3px 0 #102b431a; }
.db-result-img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.db-result-copy { min-width: 0; text-align: left; }
.db-result h2 { margin: 0 0 6px; color: var(--result-tone); font-size: 32px; line-height: 1.12; overflow-wrap: anywhere; }
.db-result p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--db-text); }
.db-result .db-result-extra { margin-top: 5px; color: var(--db-muted); font-size: 12px; font-weight: 800; }
.db-result .db-share-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 11px 16px; border: 1px solid #a95417; border-bottom-width: 3px; border-radius: 7px; background: #f58b28; color: #152e4e; box-shadow: 0 2px 0 #823d1926; font-size: 14px; font-weight: 900; }
.db-result .db-share-btn:hover:not(:disabled) { background: #ffa645; color: #152e4e; }
.db-share-btn svg { flex-shrink: 0; }
.db-result-countdown { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 19px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--result-tone) 24%, transparent); color: var(--result-tone); }
.db-result-countdown-copy { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.db-result-countdown-label { color: var(--db-muted); font-size: 11px; font-weight: 800; }
.db-result-timer { color: var(--db-text); font-size: 28px; line-height: 1.3; font-weight: 900; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.db-levels { display: flex; justify-content: center; gap: 10px; margin: 22px 0 27px; }
.db-level-btn { color: #e1e7d8; text-decoration: none; padding: 5px 16px; border: 1px solid #90a59166; border-radius: 6px; background: #15313cd9; font-size: 11px; font-weight: 800; }
.db-levels .db-level-btn { padding: 10px 24px; border-width: 2px; border-radius: 8px; font-size: 13px; font-weight: 900; }
.db-level-btn:hover { border-color: var(--db-gold); color: var(--db-gold); }
.db-level-btn.disabled { opacity: .4; pointer-events: none; }
.db-howto { max-width: 730px; margin: 25px auto 0; background: #17313de6; border: 1px solid #8b9f8d66; border-radius: 9px; color: #cfdbcf; font-size: 12px; }
.db-howto > summary { display: flex; gap: 9px; align-items: center; padding: 14px 18px; color: #f3e7cb; font-weight: 900; cursor: pointer; list-style: none; }
.db-howto > summary::-webkit-details-marker { display: none; }
.db-howto > summary i:first-child { color: #f5bf70; font-size: 17px; }
.db-howto > summary i:last-child { margin-left: auto; transition: transform .2s; }
.db-howto[open] > summary i:last-child { transform: rotate(180deg); }
.db-howto-content { padding: 0 20px 8px; }
.db-howto p { margin-bottom: 13px; }
.db-howto ul { list-style: none; padding: 0; display: grid; gap: 9px; margin: 0 0 14px; }
.db-howto li { display: flex; align-items: baseline; gap: 8px; }
.db-unavailable { max-width: 600px; margin: 30px auto; text-align: center; padding: 30px; border-radius: 12px; border: 2px solid #28444e; background: var(--db-surface); box-shadow: var(--db-shadow); }
.db-unavailable > i { font-size: 35px; color: var(--db-orange-dark); }
.db-unavailable p { margin-top: 10px; }
@media (max-width: 1240px) { .db-board-heading > span { display: inline-flex; } }
@media (max-width: 760px) {
    .db-character-page { padding-left: 12px; padding-right: 12px; }
    .db-game { padding: 16px 10px; }
    .db-hints-heading > span { max-width: 160px; text-align: right; }
    .db-hints { gap: 7px; }
    .db-character-page .db-hint { gap: 4px; padding: 7px 4px 8px; min-height: 54px; }
    .db-hint-copy { flex-direction: column; gap: 3px; }
    .db-hint-title { font-size: 11px; line-height: 1.1; }
    .db-character-page .db-hint-lock { padding: 1px 5px; line-height: 1.2; }
    .db-character-page .db-hint-icon { display: none; }
    .db-hint-ready { font-size: 10px; line-height: 1.2; }
    .db-hints-heading h2, .db-hints-heading > span { font-size: 10px; }
    .db-character-page .db-search-panel { padding: 0 4px; margin-top: 21px; }
    .db-search-heading { gap: 10px; margin-bottom: 14px; }
    .db-search-emblem { width: 39px; height: 39px; flex-shrink: 0; }
    .db-search-emblem .db-dragon-ball { width: 29px; height: 29px; }
    .db-search-heading label { font-size: 16px; }
    .db-search-heading p { font-size: 11px; }
    .db-controls { flex-wrap: wrap; gap: 8px; }
    .db-search-wrap { flex-basis: 100%; }
    .db-search-input { height: 48px; font-size: 16px; padding-left: 36px; }
    .db-search-input:focus { padding-left: 35px; }
    .db-search-input::placeholder { font-size: 12px; }
    .db-search-icon { left: 12px; }
    .db-guess-btn { flex: 1; min-height: 44px; }
    .db-surrender-btn { min-height: 44px; }
    .db-search-status { font-size: 10px; margin-top: 12px; }
    .db-try-counter { font-size: 10px; }
    .db-board-heading { padding: 0 4px 5px; gap: 8px; }
    .db-board-heading h2 { font-size: 11px; }
    .db-board-heading > span { font-size: 10px; }
    .db-results { --cell-height: 88px; min-width: 1090px; border-spacing: 5px 7px; }
    .db-col-nombre { width: 116px; }
    .db-results thead th { font-size: 11px; padding: 12px 6px; }
    .db-results tbody :is(td, th) { font-size: 12px; }
    .db-results .name-cell, .db-results thead th:first-child { position: relative; left: auto; z-index: auto; box-shadow: none; }
    .db-legend { gap: 9px 14px; font-size: 10px; padding: 11px 14px; border-radius: 10px; }
    .db-board > .db-legend { display: grid; grid-template-columns: repeat(3, max-content); }
    .db-title { margin-bottom: 19px; }
    .db-title h1 { font-size: 32px; }
    .db-title > p { font-size: 12px; max-width: 330px; margin: 0 auto 15px; }
    .db-dif-btn { padding: 5px 19px; }
    .db-result { padding: 20px 16px 17px; }
    .db-result-summary { flex-direction: column; gap: 12px; margin-bottom: 18px; }
    .db-result-portrait { flex-basis: 74px; width: 74px; height: 74px; }
    .db-result-copy { width: 100%; text-align: center; }
    .db-result h2 { font-size: 30px; }
    .db-result-timer { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
    .db-cell, .db-hint-progress { transition: none; }
}
