.pebble.dragging .marching-ants::after {
    display: none !important;
}

.pebble.marching-ants {
    border-color: transparent !important;
}

.marching-ants {
    position: relative;
    z-index: 1;
}

.marching-ants::after {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    width: calc(100% + 6px);
    height: calc(100% + 6px);
    border-radius: 50%;
    pointer-events: none;
    border: 3px dashed var(--pebble-border-color, #6366f1);
    box-sizing: border-box;
    animation: ants-circular 5s linear infinite;
    filter: drop-shadow(0 0 2px var(--pebble-border-color, #6366f1));
}

@keyframes ants-circular {
    0% {
        border-style: dashed;
        border-radius: 50%;
        transform: rotate(0deg);
    }

    100% {
        border-style: dashed;
        border-radius: 50%;
        transform: rotate(360deg);
    }
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    margin: auto;
    padding: 20px 24px;
    border: 2px solid #6366f1;
    border-radius: 8px;
    width: 400px;
    box-shadow: 0 4px 32px #6366f133;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2vh;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 1.5vh;
    color: #3730a3;
    font-size: 1.6em;
    text-align: center;
}

.modal-row {
    display: flex;
    flex-direction: row;
    gap: 0.7em;
    margin-bottom: 1.2em;
    align-items: center;
}

.modal-row label {
    font-weight: 500;
    font-size: 1.1em;
}

.modal-row input[type="number"],
.modal-row input[type="text"] {
    font-size: 1.1em;
    padding: 0.5em;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.close {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 2em;
    color: #6366f1;
    cursor: pointer;
    font-weight: bold;
}

.game-header-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
    margin-top: 16px;
}

.game-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #3730a3;
    margin-right: 2vw;
}

.target-weight-box {
    border: 3px solid #6366f1;
    border-radius: 8px;
    padding: 20px 40px;
    font-size: 2em;
    font-weight: 600;
    color: #4338ca;
    background: #f3f4f6;
    box-shadow: 0 2px 8px #6366f122;
    display: flex;
    align-items: center;
    min-width: 220px;
    justify-content: center;
    transition: background 0.2s, border 0.2s, color 0.2s;
}

.target-weight-box.target-match {
    background: #d1fae5;
    border-color: #10b981;
    color: #047857;
}

.sums-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 0;
}

.sum-block {
    border: 3px solid #ededed;
    border-radius: 8px;
    padding: 12px 20px;
    background: #ffffff;
    box-shadow: 0 2px 8px #6366f122;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    transition: background 0.2s, border 0.2s, color 0.2s;
}

.sum-number {
    font-size: 2em;
    font-weight: 700;
    color: #000;
    margin-bottom: 0.5em;
}

.sum-label {
    font-size: 0.9em;
    font-weight: 500;
    color: #666;
}

.sum-block.target-sum-block {
    background: #f0f4ff;
    border-color: #6366f1;
}

.sum-block.target-sum-block .sum-number {
    color: #6366f1;
}

.sum-block.target-sum-block .sum-label {
    color: #6366f1;
}

.sum-block.current-sum-block {
    background: #fef2f2;
    border-color: #ef4444;
}

.sum-block.current-sum-block .sum-number {
    color: #ef4444;
}

.sum-block.current-sum-block .sum-label {
    color: #ef4444;
}

.sum-block.target-match {
    background: #d1fae5;
    border-color: #10b981;
}

.sum-block.target-match .sum-number {
    color: #047857;
}

.sum-block.target-match .sum-label {
    color: #047857;
}

html,
body {
    font-family: 'Segoe UI', sans-serif;
    background: #fff;
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    min-width: 100vw;
    width: 100vw;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
}

.container {
    width: 100vw;
    height: 100dvh;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    margin: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    align-items: center;
    box-sizing: border-box;
}

.landing-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100dvh;
    width: 100vw;
    box-sizing: border-box;
}

.landing-title {
    margin-top: 16px;
    margin-bottom: 24px;
    font-size: 3rem;
    letter-spacing: 0.03em;
}

.landing-desc {
    max-width: 600px;
    text-align: center;
    color: #555;
    font-size: 1.2em;
    margin-bottom: 0;
    margin-top: 0;
    line-height: 1.7;
}

.landing-btn-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 56px;
    margin-bottom: 16px;
}

.landing-btn {
    font-size: 1.6em;
    padding: 20px 60px;
    margin-bottom: 2vh;
}



h1 {
    text-align: center;
    margin-bottom: 12px;
    font-size: 2rem;
}


.desc {
    text-align: center;
    color: #555;
    margin-bottom: 20px;
    font-size: 1.1em;
}


.target {
    display: none;
}



.pouch-weight-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 1.1em;
    color: #222;
    background: #f3f4f6;
    border: 2.5px solid #a3a3a3;
    border-radius: 8px;
    padding: 0.7em 2.2em;
    min-width: 120px;
    font-weight: 600;
}

.pouch-weight-info.target-match {
    background: #d1fae5;
    border-color: #10b981;
    color: #047857;
}


.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1 1 auto;
    justify-content: center;
}



.pebbles {
    display: grid;
    grid-template-columns: repeat(auto-fit, 90px);
    gap: 10px;
    justify-items: center;
    align-items: center;
    justify-content: center;
    min-height: 10vh;
    margin-bottom: 20px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 10px;
    box-sizing: border-box;
}


.pebble {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f3f4f6 70%, #a5b4fc 100%);
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    font-weight: bold;
    color: #3730a3;
    cursor: grab;
    user-select: none;
    transition: border 0.2s, background 0.2s;
    position: relative;
}

.pebble.dragging {
    opacity: 0.5;
    border-color: transparent !important;
}

.pebble.in-pouch {
    background: radial-gradient(circle at 70% 70%, #fef9c3 70%, #fde68a 100%);
    border: 3px solid #f59e42;
    color: #b45309;
}

.pebble .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f87171;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 1em;
    cursor: pointer;
    display: none;
}

.pebble.in-pouch .remove-btn {
    display: block;
}


.pouch-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pouch {
    background: repeating-linear-gradient(135deg, #f3f4f6, #e5e7eb 10px, #f3f4f6 20px);
    border: 3px dashed #737373;
    border-radius: 64px;
    min-height: 120px;
    min-width: 360px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    margin-top: 0;
    transition: background 0.2s, border 0.2s;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    padding-left: 10px;
    padding-right: 10px;
}

.pouch.dragover {
    background: #e5e7eb;
    border-color: #525252;
}


.btn {
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    /* avoid bulshit clamp logics */
    padding: 10px;
    font-size: 1em;
    cursor: pointer;
    margin: 8px 8px 8px 0;
    font-weight: 500;
    white-space: nowrap;
}

.btn:active {
    background: #4338ca;
}



.game-bottom-row {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-end;
    margin-top: auto;
    margin-bottom: 16px;
    gap: 12px;
    position: relative;
    left: 0;
    bottom: 0;
    z-index: 10;
}

#gamePage {
    position: relative;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
}