/* ==========================================================================
   Sokoban — Game Screen Layer CSS  (redesign 2026-09)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Board Grid Container
   -------------------------------------------------------------------------- */
.sk-board {
    display: grid;
    gap: 2px;
    margin: 0 auto;
    touch-action: manipulation;
}

.sk-board,
.sk-cell,
.sk-cell * {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* --------------------------------------------------------------------------
   Base Cell
   -------------------------------------------------------------------------- */
.sk-cell {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.07s ease;
    border-radius: 3px;
    overflow: visible;
}

.sk-cell .paper-tile-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    border-radius: 3px;
}

/* --------------------------------------------------------------------------
   Wall — dark solid block, clearly impassable
   -------------------------------------------------------------------------- */
.sk-cell--wall {
    cursor: default;
    background: #3b4f63;
    border-radius: 2px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        inset 0 -2px 0 rgba(0, 0, 0, 0.28);
}

/* No paper texture on walls */
.sk-cell--wall .paper-tile-svg {
    display: none;
}

/* --------------------------------------------------------------------------
   Floor — shows notebook paper background through paper tile SVG
   -------------------------------------------------------------------------- */
.sk-cell--floor:hover {
    transform: translateY(-1px);
    z-index: 2;
}

.sk-cell--floor:active {
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Target — large red ink circle drawn on paper
   -------------------------------------------------------------------------- */
.sk-cell--target::before {
    content: '';
    position: absolute;
    inset: 14%;
    border: 2.5px solid rgba(192, 57, 43, 0.75);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.sk-cell--target::after {
    content: '';
    position: absolute;
    inset: 37%;
    background: rgba(192, 57, 43, 0.55);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   Box — cardboard crate look, clearly 3-D
   -------------------------------------------------------------------------- */
.sk-cell--box {
    cursor: pointer;
}

/* No paper SVG for boxes — custom face handles the look */
.sk-cell--box .paper-tile-svg,
.sk-cell--box-done .paper-tile-svg {
    display: none;
}

.sk-box-face {
    position: absolute;
    inset: 5%;
    background: linear-gradient(150deg, #d4924a 0%, #b97130 55%, #9a5c20 100%);
    border-radius: 5px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        0 3px 0 #6b3d10,
        0 4px 6px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* Cross-string lines on crate face */
.sk-box-face::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1.5px;
    background: rgba(0, 0, 0, 0.16);
    transform: translateX(-50%);
}

.sk-box-face::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1.5px;
    background: rgba(0, 0, 0, 0.16);
    transform: translateY(-50%);
}

/* --------------------------------------------------------------------------
   Box on Target — green "delivered" state
   -------------------------------------------------------------------------- */
.sk-cell--box-done .sk-box-face {
    background: linear-gradient(150deg, #5dce81 0%, #27ae60 55%, #1a8a4a 100%);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.28),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12),
        0 3px 0 #126436,
        0 4px 6px rgba(0, 0, 0, 0.18);
}

.sk-box-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #126436;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 4;
}

/* --------------------------------------------------------------------------
   Player — bright blue circle, clearly the character
   -------------------------------------------------------------------------- */
.sk-cell--player .paper-tile-svg {
    border-radius: 50% !important;
}

.sk-cell--player::after {
    content: '';
    position: absolute;
    inset: 11%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 32%, #5dade2 0%, #1a6fa8 75%);
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.4),
        0 3px 7px rgba(0, 0, 0, 0.35);
    z-index: 3;
}

/* Player standing on target square — purple tint */
.sk-cell--player.sk-cell--target::after {
    background: radial-gradient(circle at 35% 32%, #bb8fce 0%, #7d3c98 75%);
}

/* --------------------------------------------------------------------------
   Path Trail — subtle ink dots showing possible walk route
   -------------------------------------------------------------------------- */
.sk-cell--path::before {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(44, 62, 80, 0.28);
    z-index: 2;
}
