/* ============================================================
   Wood settings form — profile picker, color picker, time presets
   Global (not scoped) so it works inside WoodGamePanel and
   PostGameDialog (via WoodSettingsForm component).
   ============================================================ */

/* ── WoodSettingsForm wrapper ────────────────────────────── */

.wood-settings-form {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    /* Warm tinted background so icons don't float on cold white */
    background: #fdf6ed;
    border-radius: 8px;
    padding: 0.75rem 0.65rem 0.55rem;
}

/* ── Piece icon row wrapper ──────────────────────────────── */

/* Full-size: row layout with "Level" label on left, matching Side/Time */
.wood-profile-icons-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
}

.wood-profile-level-label {
    display: block;
}

/* ── Piece icons ─────────────────────────────────────────── */

.wood-profile-icons {
    display: flex;
    gap: 0.3rem;
    justify-content: flex-start;
    flex: 1;
}

.wood-profile-icon-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wood-profile-icon-btn {
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.18rem;
    /* Always-visible border so rounded corners read on all buttons */
    border: 1.5px solid rgba(124, 74, 44, 0.18);
    border-radius: 9px;
    /* Clip the wood-square image to the radius */
    overflow: hidden;
    background: url('/Files/Squares/WhiteSquare.png') center / cover no-repeat;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(44, 31, 22, 0.12);
    transition: border-color 0.12s, box-shadow 0.12s;
}

.wood-profile-icon-btn:hover:not(:disabled) {
    border-color: rgba(124, 74, 44, 0.5);
    box-shadow: 0 0 0 2px rgba(124, 74, 44, 0.14);
}

.wood-profile-icon-btn.active {
    background: url('/Files/Squares/BlackSquare.png') center / cover no-repeat;
    border-color: #7c4a2c;
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(124, 74, 44, 0.28);
}

.wood-profile-icon-btn:disabled {
    opacity: 0.68;
    cursor: default;
}

.wood-profile-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ── Hover tooltip (CSS-only, desktop) ───────────────────── */

.wood-profile-icon-tooltip {
    position: absolute;
    bottom: calc(100% + 0.4rem);
    left: 50%;
    transform: translateX(-50%);
    width: min(8.5rem, calc(100vw - 2rem));
    padding: 0.4rem 0.55rem;
    border: 1px solid rgba(44, 31, 22, 0.14);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 0.35rem 0.9rem rgba(28, 20, 14, 0.13);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s;
    z-index: 5;
    white-space: normal;
}

.wood-profile-icon-wrap:hover .wood-profile-icon-tooltip {
    opacity: 1;
}

/* Touch devices have no hover — hide tooltips entirely */
@media (hover: none) {
    .wood-profile-icon-tooltip {
        display: none;
    }
}

.wood-profile-icon-tooltip-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #2c1f16;
}

.wood-profile-icon-tooltip-elo {
    font-size: 0.75rem;
    color: #5b4638;
    font-weight: 700;
}


/* ── Option groups — shared row layout ───────────────────── */

.wood-game-options {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Default: label left, control right, single row */
.wood-game-option-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
    border-top: 1px solid rgba(124, 74, 44, 0.12);
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.wood-game-option-label {
    color: #4e4037;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 2.4rem; /* aligns Side/Time labels */
}

/* ── Time preset grid (inline with label) ────────────────── */

.wood-time-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.3rem;
    flex: 1;
}

.wood-time-preset {
    height: 1.75rem;
    border: 1px solid rgba(124, 74, 44, 0.18);
    border-radius: 5px;
    /* Warm tint instead of cold white */
    background: #fdf0e0;
    color: #2c1f16;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
    padding: 0;
}

.wood-time-preset:hover:not(:disabled):not(.active) {
    border-color: rgba(124, 74, 44, 0.4);
    background: rgba(124, 74, 44, 0.05);
}

.wood-time-preset.active {
    border-color: #7c4a2c;
    background: rgba(124, 74, 44, 0.10);
}

.wood-time-preset:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ── Color picker inside wood form ──────────────────────── */

.wood-game-options .custom-color-picker {
    gap: 0.45rem;
    justify-content: flex-start;
    flex: 1;
}

/* ── Play button — narrow, centered ─────────────────────── */

.wood-play-btn {
    align-self: center;
    width: auto !important;
    min-width: 7rem;
    min-height: 0 !important;
    height: 1.9rem;
    padding: 0 1.6rem !important;
    border-radius: 5px;
    font-size: 0.85rem;
    border-top: 1px solid rgba(44, 31, 22, 0.09);
    margin-top: 0.05rem;
}

/* ── Compact mode (PostGameDialog rematch) ───────────────── */

.wood-settings-form--compact {
    padding-top: 0;
    background: transparent;
}

/* Icons row: add divider + tighter padding to match other option groups */
.wood-settings-form--compact .wood-profile-icons-row {
    border-top: 1px solid rgba(124, 74, 44, 0.12);
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    width: 100%;
}

/* Slightly smaller icons in compact */
.wood-settings-form--compact .wood-profile-icon-btn {
    width: 2.6rem;
    height: 2.6rem;
    padding: 0.12rem;
}

.wood-settings-form--compact .wood-game-option-group {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.wood-settings-form--compact .wood-play-btn {
    height: 1.75rem;
}
