/* ═══════════════════════════════════════════════════════════════════════════════
   RESET Y BASE
   ═══════════════════════════════════════════════════════════════════════════════ */

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

body,
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    user-select: none;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CANVAS / PIZARRA
   ═══════════════════════════════════════════════════════════════════════════════ */

canvas {
    cursor: url("iconos/borrador-icon.png"), auto;
}

#pizarra {
    display: block;
    width: 100vw;
    height: 100vh;
    transition: none !important;
}

body.inserting-shape #pizarra {
    cursor: crosshair !important;
}

#text-input-overlay {
    position: absolute;
    z-index: 1000;
    background: transparent;
    border: 2px dashed #0066cc;
    padding: 4px;
    outline: none;
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: bold;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
    border-radius: 6px;
}

#text-drag-handle {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #0066cc;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 1001;
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    user-select: none;
}

#text-drag-handle:active {
    cursor: grabbing;
    background: #004c99;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TOOLBAR PRINCIPAL (centro superior)
   ═══════════════════════════════════════════════════════════════════════════════ */

#toolbar-wrapper {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
    align-items: flex-start;
}

#toolbar,
#contextual-toolbar {
    height: 50px;
    padding: 0 12px;
    border: 1px solid #000;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#toolbar {
    padding: 1px 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

#contextual-toolbar {
    display: none;
    padding: 4px 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

#contextual-toolbar.show {
    display: flex;
}

.toolbar-show {
    animation: toolbarAppear 0.25s ease-out;
}

@keyframes toolbarAppear {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   HERRAMIENTAS SUPERIORES DERECHAS (Insertar)
   ═══════════════════════════════════════════════════════════════════════════════ */

#top-right-tools {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgb(0, 0, 0);
    border-radius: 20px;
    padding: 4px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#top-right-tools .separator {
    width: 1px;
    height: 20px;
    background: rgb(0, 0, 0);
    margin: 0 2px;
}

/* --- Botón principal "Insertar" --- */

#insert-dropdown-wrapper {
    position: relative;
}

#btn-insert-main {
    display: flex;
    align-items: center;
    gap: 2px;
    background: transparent;
    border: none;
    border-radius: 14px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #222;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    height: 36px;
    width: auto;
}

#btn-insert-main:focus {
    outline: none;
}

#btn-insert-main svg {
    flex-shrink: 0;
    color: #222;
}

#btn-insert-main.active {
    background: #222;
    color: #fff;
}

#btn-insert-main.active svg {
    color: #fff;
}

#insert-arrow {
    transition: transform 0.3s ease;
}

#btn-insert-main.open #insert-arrow {
    transform: rotate(180deg);
}

/* --- Dropdown de inserción --- */

#insert-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgb(0, 0, 0);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
    padding: 6px 5px;
    z-index: 200;
}

#insert-dropdown-menu.open {
    display: block;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

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

.insert-section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #000000;
    padding: 4px 10px 2px;
    pointer-events: none;
}

.insert-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 5px 6px;
}

.insert-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Asegura que el contenido vaya a la izquierda */
    gap: 9px;
    width: 100%;
    padding: 7px 10px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 13px;
    font-weight: bold;
    color: #000000;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
}

.insert-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.insert-item svg {
    flex-shrink: 0;
    color: #444;
}

.insert-item img {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
    filter: none !important;
}

/* --- Grilla de formas --- */

.shapes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 2px 0 10px;
}

.shape-cell {
    display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        /* Cambiado de 'center' a 'flex-start' */
        text-align: left;
        /* Alinea el texto a la izquierda */
        padding: 30px 10px;
    border-radius: 9px;
    border: 1px solid rgba(0, 0, 0, 0.411);
    font-size: 11px;
    text-align: center;
    width: auto;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.shape-cell span {
    line-height: 1;
}

.shape-cell:hover {
    background: rgba(0, 0, 0, 0.06);
}

.shape-cell.active {
    background: #222;
    color: #fff;
}

.shape-cell.active svg {
    color: #fff;
}

/* Hint flotante al insertar forma */
.shape-insert-hint {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.82);
    color: #fff;
    font-size: 13px;
    padding: 8px 18px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 500;
    opacity: 1;
    transition: opacity 0.3s;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PANEL DE AJUSTES (izquierda superior)
   ═══════════════════════════════════════════════════════════════════════════════ */

#page-settings-container {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

#side-controls-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* --- Botón toggle de ajustes --- */

#btn-settings-toggle {
    transition: all 0.3s ease;
    background-color: transparent;
}

#btn-settings-toggle img {
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    object-fit: contain !important;
    pointer-events: none;
    filter: brightness(0) saturate(100%) invert(0%);
    transition: transform 0.4s ease;
}

#btn-settings-toggle.rotating img {
    transform: rotate(180deg);
}

#btn-settings-toggle.fondo-oscuro {
    border-color: #ffffff !important;
}

#btn-settings-toggle.fondo-oscuro img {
    filter: brightness(0) invert(1);
}

/* --- Menú desplegable de ajustes --- */

#page-settings-menu {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgb(0, 0, 0);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    gap: 8px;
    min-width: 140px;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateY(-10px);
    transform-origin: top left;
    transition:
        opacity 0.3s ease,
        transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        visibility 0.3s;
}

#page-settings-menu.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

#page-settings-menu label {
    font-weight: 700;
    margin-top: 4px;
    padding-left: 2px;
}

/* --- Fila de tema (sol/luna) --- */

#theme-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

#theme-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    flex: none;
}

.theme-half {
    flex: 1;
    height: 40px;
    min-width: 42px;
    border-radius: 20%;
    border: none;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: auto;
    transition: background 0.2s, transform 0.15s;
}

.theme-half.active {
    background: #222;
    color: #fff;
}

/* --- Botones de estilo de fondo (liso / puntos / rejilla) --- */

#style-btns {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 8px;
}

.style-bg-btn {
    flex: 1;
    min-width: 40px;
    height: 40px;
    border-radius: 20%;
    border: 1.5px solid rgb(0, 0, 0);
    background: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.style-bg-btn.active {
    background: #222;
    border-color: #222;
    color: #fff;
    min-width: 42px;
}

.style-bg-btn svg {
    pointer-events: none;
}

.style-bg-btn.active svg rect,
.style-bg-btn.active svg circle,
.style-bg-btn.active svg line {
    opacity: 1;
}

/* --- Círculos de color de fondo --- */

.bg-color-circle {
    width: 34px !important;
    height: 34px !important;
    border-radius: 20% !important;
    border: 2.5px solid rgb(0, 0, 0) !important;
    cursor: pointer;
    background-color: #ffffff;
    padding: 0 !important;
    flex-shrink: 0;
    transition: border-color 0.2s, transform 0.15s;
}

.bg-color-circle:hover {
    border-color: #000000 !important;
}

.bg-color-circle.active {
    border-color: #000 !important;
    box-shadow: 0 0 0 2px #000;
}

/* --- Selects y select personalizado de idioma --- */

.mini-select {
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: #fff;
    cursor: pointer;
    outline: none;
}

.custom-select {
    position: relative;
    width: 100%;
    max-width: 180px;
    margin: 0 auto;
    font-family: inherit;
    user-select: none;
}

.selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgb(0, 0, 0);
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #000000;
    transition: all 0.2s ease;
}

.selected:hover {
    background: #fdfdfd;
    border-color: rgba(0, 0, 0, 0.3);
}

.selected::after {
    content: "▼";
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.custom-select.open .selected::after {
    transform: rotate(180deg);
}

.selected img,
.option img {
    width: 24px;
    height: 24px;
    object-fit: cover;
}

.options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-top: 4px;
    display: none;
    z-index: 1000;
    font-weight: bold;
}

.custom-select.open .options {
    display: block;
}

.option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    cursor: pointer;
}

.option:hover {
    background: #f0f0f0;
}

/* --- Botones de acción del panel (guardar, cargar, limpiar) --- */

button.panel-action-btn,
label.panel-action-btn {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    background: #0066cc;
    color: #ffffff;
    font-size: 13px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-action-btn img {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    pointer-events: none;
}

.danger-btn {
    background: #d32f2f !important;
}

.danger-btn:hover {
    background: #b71c1c;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BOTONES GENERICOS
   ═══════════════════════════════════════════════════════════════════════════════ */

button {
    background: transparent;
    border: none;
    font-size: 18px;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button.active {
    background: #222;
    color: #fff;
}

/* Tamaño uniforme de iconos en botones */
button img,
.panel-action-btn img,
.align-btn img,
.toolbar-icon,
#top-right-tools img {
    display: block !important;
    width: 30px !important;
    height: 25px !important;
    object-fit: contain !important;
    pointer-events: none;
}

/* Invertir iconos cuando el botón está activo */
button.active img {
    filter: brightness(0) invert(1);
}

.align-btn img {
    filter: brightness(0) saturate(100%) invert(0%);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SEPARADORES
   ═══════════════════════════════════════════════════════════════════════════════ */

.separator {
    width: 1px;
    height: 24px;
    background: rgba(162, 101, 101, 0.15);
    margin: 0 2px;
}

.insert-separator {
    height: 2px;
    background: rgb(0, 0, 0);
    margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   COLORES Y GROSOR
   ═══════════════════════════════════════════════════════════════════════════════ */

.color-picker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
}

.color-picker.active {
    border-color: #000;
    transform: scale(1.15);
}

.rainbow-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    background-size: cover;
}

.rainbow-btn.active {
    border-color: #000;
    transform: scale(1.15);
}

.custom-color-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    position: relative;
}

.custom-color-container input[type="color"] {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    border: none;
    pointer-events: none;
}

#float-color-dyn,
#floating-text-toolbar .custom-color-container:last-child {
    display: none !important;
}

/* --- Grosor de línea --- */

.thickness-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.thickness-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.thickness-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.thickness-btn.active {
    background: rgba(0, 0, 0, 0.1);
}

.dot {
    background: #444;
    border-radius: 50%;
    display: inline-block;
}

.dot.thin {
    width: 3px;
    height: 3px;
}

.dot.medium {
    width: 7px;
    height: 7px;
}

.dot.thick {
    width: 14px;
    height: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DROPDOWNS GENERICOS
   ═══════════════════════════════════════════════════════════════════════════════ */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 6px;
    z-index: 20;
    gap: 6px;
    margin-top: 5px;
}

.dropdown-content.show {
    display: flex;
    flex-direction: column;
}

.dropdown-content button {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BARRA FLOTANTE DE TEXTO
   ═══════════════════════════════════════════════════════════════════════════════ */

#floating-text-toolbar {
    position: absolute;
    z-index: 1002;
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.15);
    padding: 2px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    gap: 4px;
    align-items: center;
}

#floating-text-toolbar.show {
    display: flex;
}

.align-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
}

.align-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.align-btn.active {
    background: #222;
    /* Cambiá este valor por el color que quieras */
    color: #fff;
    /* Para asegurar que el contenido contraste bien */
}

.style-btn {
    width: 28px;
    height: 28px;
    margin: 0 2px;
    cursor: pointer;
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.style-square {
    width: 24px;
    height: 24px;
    background: #888;
    border-radius: 4px;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ZOOM (inferior izquierdo)
   ═══════════════════════════════════════════════════════════════════════════════ */

#bottom-zoom-container {
    position: absolute;
    bottom: 10px;
    left: 20px;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #000;
    border-radius: 999px;
    overflow: hidden;
    z-index: 10;
}

#btn-zoom-in,
#btn-zoom-out {
    width: 26px;
    height: 26px;
    font-size: 18px;
}

#bottom-zoom-badge {
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    font-weight: bold;
    color: #000;
    font-size: 15px;
    width: 40px;
    text-align: center;
    padding: 0;
}

#bottom-zoom-badge.modo-contraste {
    background: #ffffff !important;
    border: 1px solid #000000 !important;
    color: #000000 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PRESENTACIÓN
   ═══════════════════════════════════════════════════════════════════════════════ */

#presentation-toolbar {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 4px 6px;
    border-radius: 12px;
    gap: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

#presentation-toast {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 100;
    transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#presentation-toast.show {
    top: 25px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BOTÓN "VOLVER AL TABLERO"
   ═══════════════════════════════════════════════════════════════════════════════ */

#btn-back-to-board {
    display: none;
    position: fixed;
    top: 16px;
    left: 15px;
    padding: 8px 10px;
    min-width: 100px;
    border: 1px solid #000000;
    border-radius: 8px;
    background: white;
    color: #000000;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 99999;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BOTÓN FLOTANTE DE TUTORIAL
   ═══════════════════════════════════════════════════════════════════════════════ */

#btn-open-tutorial {
    position: fixed;
    bottom: 10px;
    right: 20px;
    width: 35px;
    height: 35px;
    background-color: #ffffff;
    color: #333333;
    border: 1px solid rgb(0, 0, 0);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.2s, background-color 0.2s;
    padding: 4px;
}

#btn-open-tutorial:hover {
    background-color: #f5f5f5;
}

#btn-open-tutorial svg {
    width: 100%;
    height: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MODAL: TUTORIAL / AYUDA
   ═══════════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    padding: 10px;
    border-radius: 24px;
    max-width: 800px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-header h2 {
    font-size: 2rem;
    margin-bottom: 6px;
}

.titulos {
    text-align: center;
    padding-top: 15px;
    padding-bottom: 15px;
}

/* --- Grid del tutorial --- */

.tutorial-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.tutorial-column {
    flex: 1;
    min-width: 350px;
}

.tutorial-group {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
}

.tutorial-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 5px;
    border-radius: 14px;
    background: #fafafa;
    transition: 0.2s;
}

.tutorial-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.tutorial-item p {
    margin: 0;
    line-height: 1.4;
}

.tutorial-item span,
.tutorial-item kbd {
    background: #eee;
    padding: 5px 10px;
    border-radius: 5px;
    border-bottom: 3px solid #ccc;
    font-family: monospace;
    font-weight: bold;
}

/* --- Tecla estilizada (kbd) --- */

kbd {
    min-width: 42px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #ffffff, #e8e8e8);
    border: 1px solid #cfcfcf;
    border-bottom: 3px solid #b5b5b5;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    padding: 0 10px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.08);
}

/* --- Botón "Entendido" --- */

#close-tutorial {
    width: fit-content;
    min-width: 180px;
    margin: 20px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 5px;
    border-radius: 18px;
    border: 1px solid #000000;
    background: #f8f5ff;
    cursor: pointer;
}

.btn-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #000000;
    flex-shrink: 0;
}

.btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.btn-title {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MODAL: CONFIRMACIÓN (Limpiar lienzo)
   ═══════════════════════════════════════════════════════════════════════════════ */

#confirm-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#confirm-modal.show {
    opacity: 1;
}

.confirm-box {
    background: #fff;
    width: 380px;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    transform: scale(0.8);
    opacity: 0;
    transition:
        transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.25s ease;
}

#confirm-modal.show .confirm-box {
    transform: scale(1);
    opacity: 1;
}

.confirm-box p {
    font-size: 18px;
    font-weight: 600;
    color: #000;
    line-height: 1.4;
    margin-bottom: 20px;
    text-align: left;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

#btn-confirm-no,
#btn-confirm-yes {
    width: auto !important;
    height: auto !important;
    min-width: 90px;
    padding: 8px 14px;
    border-radius: 8px !important;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

#btn-confirm-no {
    background: #e5e5e5;
    color: #333;
}

#btn-confirm-no:hover {
    background: #d7d7d7;
}

#btn-confirm-yes {
    background: #d32f2f;
    color: #fff;
}

#btn-confirm-yes:hover {
    background: #b71c1c;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ESTADO: MODO PRESENTACIÓN (hide-ui)
   ═══════════════════════════════════════════════════════════════════════════════ */

body.hide-ui #toolbar-wrapper,
body.hide-ui #page-settings-container,
body.hide-ui #top-right-tools,
body.hide-ui #bottom-zoom-badge,
body.hide-ui #floating-text-toolbar,
body.hide-ui #bottom-zoom-container {
    display: none !important;
    color: black;
}

body.hide-ui #presentation-toolbar {
    display: flex;
}

body.hide-ui #btn-back-to-board {
    display: flex;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TRANSICIÓN DE IDIOMA
   ═══════════════════════════════════════════════════════════════════════════════ */

#page-settings-menu.language-changing,
#tutorial-modal.language-changing {
    opacity: 0.5;
    transition: opacity 0.15s ease;
}


