/* 오늘의 이중주차: an underground car park. Green epoxy floor with white paint, the lot as a yard
   behind a concrete curb, hazard-striped pillars, white signboards in the site's ink-and-shadow style.
   Lime (the game's colour) is my car and every "this is yours" mark. */
.parking-page {
    --floor: #4C6A61;
    --floor-deep: #3E5951;
    --paint: #F4F3EC;
    --paint-soft: rgba(244, 243, 236, 0.78);
    --curb: #B9BEB6;
    --glass: #26313A;
    --cell: 68px;
    --gap: 4px;
    --curb-w: 12px;
    --lane-w: 40px;
}

.parking-page .site-main {
    background-color: var(--floor);
    /* Two yellow lane lines down the page on wide screens; off-screen on phones. */
    background-image:
        linear-gradient(90deg, transparent calc(50% - 332px), #D9B84A calc(50% - 332px), #D9B84A calc(50% - 326px), transparent calc(50% - 326px)),
        linear-gradient(90deg, transparent calc(50% + 326px), #D9B84A calc(50% + 326px), #D9B84A calc(50% + 332px), transparent calc(50% + 332px));
}

.garage { max-width: 600px; margin: 0 auto; padding: 20px 16px 48px; color: var(--paint); }
.tabular { font-variant-numeric: tabular-nums; }

/* Signboard */
.sign {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    background: var(--paper);
    color: var(--ink);
    border: var(--line);
    border-radius: 14px;
    box-shadow: 4px 5px 0 var(--ink);
    overflow: hidden;
}
.sign-zone {
    margin: 0;
    display: grid;
    place-items: center;
    padding: 0 16px;
    background: var(--ink);
    color: var(--paper);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.04em;
}
.sign-text { padding: 10px 14px 11px; }
.sign-kicker { margin: 0; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.sign-title { margin: 1px 0 0; font-size: 26px; font-weight: 900; letter-spacing: -0.045em; line-height: 1.2; }
.sign-level {
    margin: 0;
    min-width: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1px;
    padding: 0 12px;
    background: var(--lime);
    border-left: var(--line);
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.3;
}
.sign-level b { font-size: 18px; font-weight: 900; letter-spacing: -0.02em; }

/* Daily / practice switch */
.modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-top: 16px;
    padding: 4px;
    background: rgba(22, 22, 22, 0.28);
    border-radius: 999px;
}
.mode {
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--paint);
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
}
.mode.is-on { background: var(--paper); color: var(--ink); }

.brief { margin: 14px 2px 0; font-size: 14.5px; line-height: 1.6; color: var(--paint-soft); }
.brief b { color: var(--lime); }

/* Move counter and tools */
.meter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.count {
    margin: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    padding: 4px 14px 5px;
    background: var(--paper);
    color: var(--ink);
    border: var(--line);
    border-radius: 999px;
}
.count span { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.count b { font-size: 21px; font-weight: 900; line-height: 1.25; }
.count.is-goal { background: none; color: var(--paint); border-color: var(--paint-soft); }
.count.is-goal span { color: var(--paint-soft); }
.tools { margin-left: auto; display: flex; gap: 6px; }
.tool {
    min-height: 38px;
    padding: 0 14px;
    border: 1.5px solid var(--paint-soft);
    border-radius: 999px;
    background: none;
    color: var(--paint);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.tool:disabled { opacity: 0.4; cursor: default; }
.parking-page :focus-visible { outline-color: var(--lime); }

/* The yard: concrete curb around the lot, a gap and a barrier on the right of row 3, a lane outside. */
.yard-wrap { display: flex; justify-content: center; margin-top: 16px; overflow: hidden; padding: 0 0 6px; margin-bottom: -6px; }
.yard {
    position: relative;
    margin-right: var(--lane-w);
    padding: var(--curb-w);
    background: var(--curb);
    border: var(--line);
    border-radius: 18px;
    box-shadow: 4px 5px 0 var(--ink);
}
.lot {
    position: relative;
    width: calc(var(--cell) * 6);
    height: calc(var(--cell) * 6);
    background-color: var(--floor-deep);
    background-image:
        linear-gradient(rgba(244, 243, 236, 0.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(244, 243, 236, 0.09) 1px, transparent 1px);
    background-size: var(--cell) var(--cell);
    background-position: -0.5px -0.5px;
    box-shadow: 0 0 0 1.5px var(--ink);
    border-radius: 4px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
/* The way out: a dashed line painted along row 3. */
.lot::before {
    content: "";
    position: absolute;
    left: 6%;
    right: 0;
    top: calc(var(--cell) * 2.5 - 1.5px);
    height: 3px;
    background: repeating-linear-gradient(90deg, rgba(244, 243, 236, 0.32) 0 14px, transparent 14px 26px);
}

.gate {
    position: absolute;
    top: calc(var(--curb-w) + var(--cell) * 2);
    right: -1.5px;
    width: calc(var(--curb-w) + 1.5px);
    height: var(--cell);
    background: var(--floor-deep);
    z-index: 1;
}
.gate-arm {
    position: absolute;
    left: calc(50% - 3px);
    top: -4px;
    width: 6px;
    height: calc(100% + 8px);
    background: repeating-linear-gradient(180deg, var(--alarm) 0 9px, var(--paper) 9px 18px);
    border: 1.5px solid var(--ink);
    border-radius: 3px;
    transform-origin: 50% 3px;
    transition: transform 0.45s ease;
}
.is-open .gate-arm { transform: rotate(-90deg); }

.lane {
    position: absolute;
    left: calc(100% + 1.5px);
    top: calc(var(--curb-w) + var(--cell) * 2);
    width: var(--lane-w);
    height: var(--cell);
    background: var(--floor-deep);
    border-top: var(--line);
    border-bottom: var(--line);
}
.lane::after {
    content: "";
    position: absolute;
    left: 9px;
    top: calc(50% - 7px);
    border-left: 13px solid rgba(244, 243, 236, 0.55);
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}
.lane-sign {
    position: absolute;
    left: -2px;
    bottom: calc(100% + 6px);
    padding: 1px 5px;
    background: var(--lime);
    color: var(--ink);
    border: var(--line);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

/* Vehicles: --x, --y are the first cell, --w, --h the size in cells, --dx, --dy a drag in px. */
.vehicle {
    --body: #F6F6F2;
    position: absolute;
    left: 0;
    top: 0;
    width: calc(var(--cell) * var(--w) - var(--gap) * 2);
    height: calc(var(--cell) * var(--h) - var(--gap) * 2);
    padding: 0;
    border: 1.5px solid var(--ink);
    border-radius: calc(var(--cell) * 0.22);
    background: var(--body);
    box-shadow: 0 3px 0 rgba(10, 18, 15, 0.35);
    transform: translate(calc(var(--cell) * var(--x) + var(--gap) + var(--dx, 0px)), calc(var(--cell) * var(--y) + var(--gap) + var(--dy, 0px)));
    transition: transform 0.14s ease;
    cursor: grab;
    touch-action: none;
}
.vehicle.is-dragging { transition: none; cursor: grabbing; z-index: 3; box-shadow: 0 7px 0 rgba(10, 18, 15, 0.3); }
.vehicle:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

/* Windscreen (::before) and rear window (::after). fwd = front at the right or bottom end. */
.vehicle::before,
.vehicle::after { content: ""; position: absolute; background: var(--glass); }
.h::before { top: 15%; bottom: 15%; width: 15%; border-radius: 3px 8px 8px 3px; }
.h::after { top: 19%; bottom: 19%; width: 9%; border-radius: 3px; }
.h.fwd::before { right: 16%; }
.h.fwd::after { left: 9%; }
.h.rev::before { left: 16%; border-radius: 8px 3px 3px 8px; }
.h.rev::after { right: 9%; }
.v::before { left: 15%; right: 15%; height: 15%; border-radius: 3px 3px 8px 8px; }
.v::after { left: 19%; right: 19%; height: 9%; border-radius: 3px; }
.v.fwd::before { bottom: 16%; }
.v.fwd::after { top: 9%; }
.v.rev::before { top: 16%; border-radius: 8px 8px 3px 3px; }
.v.rev::after { bottom: 9%; }
.len3.h::before { width: 10%; }
.len3.v::before { height: 10%; }
.len3.h.fwd::before { right: 10%; }
.len3.h.rev::before { left: 10%; }
.len3.v.fwd::before { bottom: 10%; }
.len3.v.rev::before { top: 10%; }

/* Car colours come from parking.js (--body, --glass), shared with the result card. */

/* Small trucks: a pale blue cab and an open bed with slats. */
.truck { --body: #8DBCE6; --bed: #D3D7D9; }
.truck.h.fwd { background: linear-gradient(90deg, transparent 0 66%, var(--ink) 66% calc(66% + 1.5px), transparent 0), repeating-linear-gradient(90deg, var(--bed) 0 9px, #B9BEC1 9px 11px) left / 66% 100% no-repeat, var(--body); }
.truck.h.rev { background: linear-gradient(90deg, transparent 0 34%, var(--ink) 34% calc(34% + 1.5px), transparent 0), repeating-linear-gradient(90deg, var(--bed) 0 9px, #B9BEC1 9px 11px) right / 66% 100% no-repeat, var(--body); }
.truck.v.fwd { background: linear-gradient(180deg, transparent 0 66%, var(--ink) 66% calc(66% + 1.5px), transparent 0), repeating-linear-gradient(180deg, var(--bed) 0 9px, #B9BEC1 9px 11px) top / 100% 66% no-repeat, var(--body); }
.truck.v.rev { background: linear-gradient(180deg, transparent 0 34%, var(--ink) 34% calc(34% + 1.5px), transparent 0), repeating-linear-gradient(180deg, var(--bed) 0 9px, #B9BEC1 9px 11px) bottom / 100% 66% no-repeat, var(--body); }
.truck::after { display: none; }
/* The yellow academy van. */
.van { --body: var(--mustard); }

.vehicle.is-mine { --body: var(--lime); border-width: 2px; z-index: 2; }
.mine-tag {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-58%, -50%);
    padding: 0 6px;
    background: var(--ink);
    color: var(--lime);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.6;
    white-space: nowrap;
    pointer-events: none;
}
.vehicle.is-mine.is-leaving { transition: transform 0.7s cubic-bezier(0.5, 0, 0.75, 0); }

/* Pillars: hazard tape around a concrete square. */
.pillar {
    position: absolute;
    left: 0;
    top: 0;
    width: calc(var(--cell) - 6px);
    height: calc(var(--cell) - 6px);
    transform: translate(calc(var(--cell) * var(--x) + 3px), calc(var(--cell) * var(--y) + 3px));
    border: 1.5px solid var(--ink);
    border-radius: 6px;
    background: repeating-linear-gradient(45deg, var(--mustard) 0 6px, var(--ink) 6px 12px);
}
.pillar::after {
    content: "";
    position: absolute;
    inset: 7px;
    background: #C9CDC6;
    border: 1.5px solid var(--ink);
    border-radius: 3px;
}

.hint { margin: 14px 2px 0; font-size: 13px; color: var(--paint-soft); text-align: center; }
.status { margin: 10px 0 0; font-size: 14px; font-weight: 700; text-align: center; }
.status:empty { display: none; }
.status .btn { margin-top: 10px; }

/* Result: a car park exit ticket. */
.ticket {
    margin-top: 20px;
    background: var(--paper);
    color: var(--ink);
    border: var(--line);
    border-radius: 16px;
    box-shadow: 4px 5px 0 var(--ink);
    overflow: hidden;
}
.ticket-head {
    margin: 0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 16px;
    background: var(--lime);
    border-bottom: var(--line);
    font-size: 14px;
    font-weight: 900;
}
.ticket-main { padding: 16px 18px 6px; }
.ticket-moves { margin: 0; display: flex; align-items: baseline; gap: 6px; }
.ticket-moves b { font-size: 60px; font-weight: 900; letter-spacing: -0.05em; line-height: 1; }
.ticket-moves span { font-size: 19px; font-weight: 900; letter-spacing: -0.03em; }
.ticket-verdict { margin: 8px 0 0; font-size: 15px; font-weight: 700; color: var(--soft); }
.ticket-verdict b { color: var(--ink); }
.ticket-stats {
    margin: 12px 18px 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1.5px dashed #9A9A94;
    border-bottom: 1.5px dashed #9A9A94;
}
.ticket-stats div { padding: 10px 0; }
.ticket-stats div + div { padding-left: 12px; border-left: 1.5px dashed #9A9A94; }
.ticket-stats dt { font-size: 12px; font-weight: 800; color: var(--muted); }
.ticket-stats dd { margin: 0; font-size: 18px; font-weight: 900; }
.ticket-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px 18px 0; }
.ticket-next { margin: 12px 0 16px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.toast { margin: 10px 18px 0; text-align: center; font-size: 13px; font-weight: 700; }

/* Practice: numbered bays; a cleared bay holds a lime car. */
.practice { margin-top: 22px; }
.practice-head h2 { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: -0.03em; }
.practice-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--paint-soft); }
.slots { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); row-gap: 6px; }
.slots li { position: relative; }
.bay {
    position: relative;
    width: 100%;
    height: 54px;
    padding: 0 0 3px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border: 0;
    border-left: 2px solid var(--paint-soft);
    background: none;
    color: var(--paint);
    font-size: 12.5px;
    font-weight: 900;
    line-height: 1.2;
    cursor: pointer;
}
.slots li:nth-child(10n) .bay, .slots li:last-child .bay { border-right: 2px solid var(--paint-soft); }
.bay::before {
    content: "";
    position: absolute;
    left: 24%;
    right: 24%;
    top: 5px;
    bottom: 21px;
    border-radius: 5px;
    border: 1.5px dashed rgba(244, 243, 236, 0.25);
}
.is-done .bay::before { background: var(--lime); border: 1.5px solid var(--ink); box-shadow: 0 2px 0 rgba(10, 18, 15, 0.35); }
.is-perfect .bay::after {
    content: "";
    position: absolute;
    left: calc(50% - 3.5px);
    top: 11px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink);
}
.is-current .bay { color: var(--lime); }
.is-current .bay::before { border: 2px solid var(--lime); }
.is-current.is-done .bay::before { border-color: var(--ink); outline: 2px solid var(--lime); outline-offset: 2px; }
.practice-key { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--paint-soft); }
.practice-key span { display: inline-flex; align-items: center; gap: 6px; }
.practice-key i { display: inline-block; width: 12px; height: 16px; border-radius: 3px; background: var(--lime); border: 1.5px solid var(--ink); }
.practice-key i.dot { position: relative; }
.practice-key i.dot::after { content: ""; position: absolute; left: 2px; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }

/* How to play */
.notes {
    margin-top: 24px;
    padding: 16px 18px;
    background: var(--paper);
    color: var(--ink);
    border: var(--line);
    border-radius: 16px;
}
.notes h2 { margin: 0 0 6px; font-size: 15px; font-weight: 900; }
.notes ol { margin: 0; padding-left: 1.2em; font-size: 14px; line-height: 1.65; color: var(--soft); }

@media (max-width: 640px) {
    .parking-page {
        --curb-w: 9px;
        --lane-w: 34px;
        --gap: 3px;
        --cell: min(64px, calc((100vw - 32px - var(--curb-w) * 2 - 3px - var(--lane-w)) / 6));
    }
    .garage { padding: 14px 16px 40px; }
    .sign-zone { padding: 0 12px; font-size: 24px; }
    .sign-text { padding: 8px 12px 9px; }
    .sign-kicker { font-size: 11.5px; }
    .sign-title { font-size: 21px; }
    .sign-level { min-width: 76px; padding: 0 8px; font-size: 11.5px; }
    .sign-level b { font-size: 15px; }
    .modes { margin-top: 12px; }
    .mode { min-height: 38px; font-size: 14px; }
    .brief { margin-top: 10px; font-size: 13.5px; }
    .meter { margin-top: 10px; gap: 6px; }
    .count { padding: 3px 11px 4px; gap: 5px; }
    .count b { font-size: 18px; }
    .tool { min-height: 36px; padding: 0 11px; font-size: 12.5px; }
    .yard { border-radius: 14px; box-shadow: 3px 4px 0 var(--ink); }
    .mine-tag { font-size: 10px; padding: 0 5px; }
    .ticket-moves b { font-size: 52px; }
    .bay { height: 50px; font-size: 11.5px; }
}
