/* TapFlow — koi pond skin. Gameplay IDs stay unchanged. */

:root {
    --ink: #1e3a2a;
    --muted: #4d6d5c;
    --cream: #fff8e4;
    --stroke: #23463a;
    --water-deep: #1f5f58;
    --water: #2f7a72;
    --water-lite: #6fb8ae;
    --pad: #7ec33a;
    --pad-deep: #3d7a12;
    --lotus: #ff8aa0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Fredoka', 'Trebuchet MS', 'Segoe UI', sans-serif;
    min-height: 100vh;
    color: var(--ink);
    overflow-x: hidden;
    position: relative;
    background:
        radial-gradient(ellipse at 18% 82%, rgba(140, 210, 170, 0.28) 0%, transparent 42%),
        radial-gradient(ellipse at 86% 16%, rgba(90, 180, 190, 0.22) 0%, transparent 40%),
        linear-gradient(180deg, #7ec8c0 0%, #3d8f88 46%, #246762 100%);
}

/* Static pond props — no looping shaders */
.pond-scene {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.pad {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #c6e86a 0%, #6fb52a 62%, #3d7a12 100%);
    border: 3px solid #2d5a14;
    box-shadow: 0 4px 0 #1d3f12, inset 0 2px 0 rgba(255,255,255,0.28);
    opacity: 0.55;
}

.pad-a { width: 86px; height: 68px; left: -18px; bottom: 8%; }
.pad-b { width: 64px; height: 50px; right: -10px; top: 14%; }
.pad-c { width: 48px; height: 38px; left: 12%; top: 6%; opacity: 0.4; }
.pad-d { width: 72px; height: 56px; right: 8%; bottom: 4%; opacity: 0.42; }

.lotus {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, #fff4c2 0 18%, transparent 19%),
        radial-gradient(circle at 50% 18%, #ffb3c6 0 34%, transparent 35%),
        radial-gradient(circle at 18% 62%, #ff8aa8 0 34%, transparent 35%),
        radial-gradient(circle at 82% 62%, #ff8aa8 0 34%, transparent 35%),
        #ffd1dc;
    opacity: 0.7;
}

.lotus-a { left: 22%; bottom: 11%; }
.lotus-b { right: 18%; top: 11%; width: 22px; height: 22px; }

.koi {
    position: absolute;
    width: 54px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f4a24a, #ffd27a 60%, #fff6d8);
    box-shadow: 8px 0 0 -6px #c45a28;
    opacity: 0.35;
}

.koi-a { left: 8%; top: 38%; transform: rotate(-18deg); }
.koi-b { right: 10%; bottom: 22%; transform: rotate(14deg); width: 40px; height: 14px; }

.container {
    max-width: 100vw;
    margin: 0 auto;
    padding: 18px 16px max(20px, env(safe-area-inset-bottom));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.game-title {
    text-align: center;
    margin-bottom: 14px;
    font-size: clamp(2rem, 8vw, 2.7rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--cream);
    text-shadow: 0 3px 0 #1d4a44;
}

.menu-screen,
.game-screen,
.result-screen {
    text-align: center;
    width: 100%;
    max-width: 500px;
}

.menu-screen,
.result-screen {
    background: linear-gradient(#fffdf2, #e8f6c8);
    padding: 20px 18px 16px;
    border-radius: 28px;
    max-width: 400px;
    border: 4px solid var(--stroke);
    box-shadow: 0 8px 0 var(--stroke), inset 0 3px 0 #fff;
}

.logo { display: flex; justify-content: center; }

.tagline {
    margin: 2px 0 14px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
}

.how-list {
    list-style: none;
    display: grid;
    gap: 7px;
    margin: 0 0 16px;
    text-align: left;
}

.how-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff8e4;
    border: 3px solid var(--stroke);
    border-radius: 14px;
    box-shadow: 0 3px 0 var(--stroke);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.how-list span {
    flex: 0 0 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    border-radius: 999px;
    background: linear-gradient(#7ec33a, #4f9a1c);
    border: 2px solid var(--stroke);
    color: #143018;
    font-size: 11px;
    letter-spacing: 0.08em;
}

.layout-section,
.color-section,
.animation-section,
.mode-section {
    margin-bottom: 14px;
}

.section-title {
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.option-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.option-btn {
    font: inherit;
    background: linear-gradient(#fffdf2, #d8efc2);
    border: 3px solid var(--stroke);
    color: var(--ink);
    padding: 9px 12px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 3px 0 var(--stroke);
}

.option-btn.selected {
    background: linear-gradient(#ffb05a, #e06a22);
    color: #3a2414;
}

.option-btn:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 var(--stroke);
}

.menu-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.start-btn {
    font: inherit;
    background: linear-gradient(#ffb05a, #e06a22);
    border: 4px solid var(--stroke);
    color: #3a2414;
    padding: 0 22px;
    min-height: 52px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 18px;
    cursor: pointer;
    letter-spacing: 0.04em;
    box-shadow: 0 5px 0 var(--stroke), inset 0 2px 0 rgba(255,255,255,0.4);
    flex: 1;
}

.start-btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--stroke);
}

.help-btn {
    font: inherit;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    border: 4px solid var(--stroke);
    background: linear-gradient(#fffdf2, #d8efc2);
    color: var(--ink);
    cursor: pointer;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 5px 0 var(--stroke), inset 0 2px 0 #fff;
    flex: 0 0 52px;
}

.help-btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--stroke);
}

.credit {
    margin: 12px 0 0;
    font-size: 11px;
    color: var(--muted);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    margin-bottom: 12px;
    gap: 6px;
}

.info-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px 8px;
    background: linear-gradient(#fffdf2, #e8f6c8);
    border: 3px solid var(--stroke);
    border-radius: 14px;
    box-shadow: 0 3px 0 var(--stroke);
}

.info-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.info-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.timer {
    color: #c45a28;
    font-size: 16px !important;
}

.numbers-container {
    position: relative;
    width: 100%;
    height: 60vh;
    margin: 8px 0 12px;
    background:
        radial-gradient(circle at 28% 30%, rgba(255,255,255,0.16) 0%, transparent 28%),
        radial-gradient(circle at 74% 68%, rgba(255,255,255,0.1) 0%, transparent 26%),
        linear-gradient(180deg, #4aa39a 0%, #2a6d68 100%);
    border-radius: 22px;
    overflow: hidden;
    border: 4px solid var(--stroke);
    box-shadow: 0 6px 0 var(--stroke), inset 0 0 40px rgba(13, 40, 38, 0.22);
}

/* Lily-pad numbers. Size/position come from JS. */
.number-btn {
    font-family: inherit;
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid #2d5a14;
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 30%, #e4f79a 0%, #8fd13a 46%, #5aa01c 78%, #3d7a12 100%);
    font-size: 1.1rem;
    font-weight: 700;
    color: #143018;
    cursor: pointer;
    box-shadow: 0 3px 0 #234812, inset 0 2px 0 rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    text-shadow: 0 1px 0 rgba(255,255,255,0.35);
}

.number-btn::before {
    content: '';
    position: absolute;
    right: 8%;
    bottom: 10%;
    width: 26%;
    height: 26%;
    background: linear-gradient(135deg, transparent 46%, rgba(29, 63, 18, 0.28) 50%, transparent 56%);
    pointer-events: none;
}

.number-btn:active,
.number-btn.pressing {
    transform: translateY(3px) scale(0.94);
    box-shadow: 0 1px 0 #234812, inset 0 1px 0 rgba(255,255,255,0.25);
    filter: brightness(0.94);
}

.number-btn.releasing {
    transform: translateY(-2px) scale(1.04);
    filter: brightness(1.08);
}

.number-btn.found {
    opacity: 0.45;
    cursor: not-allowed;
}

.number-btn.paused {
    color: transparent !important;
    text-shadow: none !important;
}

.number-btn.paused.pressing,
.number-btn.paused.releasing {
    transform: none !important;
    filter: none !important;
}

.number-btn.shuffling {
    opacity: 0.72;
}

/* Multi-color pads stay readable */
.number-btn.color-1 {
    background: radial-gradient(circle at 34% 30%, #ffd1dc 0%, #ff8aa8 55%, #d45a78 100%);
    border-color: #7a3044;
    color: #3a1420;
    box-shadow: 0 3px 0 #7a3044, inset 0 2px 0 rgba(255,255,255,0.35);
}
.number-btn.color-2 {
    background: radial-gradient(circle at 34% 30%, #b8f3e4 0%, #2bb39a 55%, #187866 100%);
    border-color: #0f4a40;
    color: #06332c;
}
.number-btn.color-3 {
    background: radial-gradient(circle at 34% 30%, #c9e8ff 0%, #4aa3e0 55%, #256aa8 100%);
    border-color: #1a466e;
    color: #0d2a44;
}
.number-btn.color-4 {
    background: radial-gradient(circle at 34% 30%, #e4f79a 0%, #7ec33a 55%, #3d7a12 100%);
    border-color: #2d5a14;
    color: #143018;
}
.number-btn.color-5 {
    background: radial-gradient(circle at 34% 30%, #ffe9a8 0%, #f4a24a 55%, #c45a28 100%);
    border-color: #7a3a14;
    color: #3a2414;
}
.number-btn.color-6 {
    background: radial-gradient(circle at 34% 30%, #f3d4ff 0%, #b06ad4 55%, #6e3a90 100%);
    border-color: #4a2464;
    color: #2a1038;
}
.number-btn.color-7 {
    background: radial-gradient(circle at 34% 30%, #fff6d8 0%, #e8c27a 55%, #a8843a 100%);
    border-color: #6a4a18;
    color: #3a2414;
}
.number-btn.color-8 {
    background: radial-gradient(circle at 34% 30%, #d8e8e4 0%, #4d6d6a 55%, #2a4040 100%);
    border-color: #1a2a28;
    color: #fff8e4;
    text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}
.number-btn.color-9 {
    background: radial-gradient(circle at 34% 30%, #c8f0f4 0%, #3aa8b8 55%, #1a6a78 100%);
    border-color: #124850;
    color: #083038;
}
.number-btn.color-10 {
    background: radial-gradient(circle at 34% 30%, #ffd8c4 0%, #ff8a5a 55%, #c44a28 100%);
    border-color: #7a2a14;
    color: #3a140c;
}

.game-controls {
    margin-top: 8px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    font: inherit;
    background: linear-gradient(#fffdf2, #d8efc2);
    border: 3px solid var(--stroke);
    color: var(--ink);
    padding: 10px 20px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 0 var(--stroke);
}

.control-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--stroke);
}

.result-title {
    font-size: 1.8rem;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--ink);
}

.result-title.win { color: #2a6d28; }
.result-title.lose { color: #c45a28; }

.result-stats {
    margin-bottom: 18px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.55;
    color: var(--muted);
}

.result-stats div + div { margin-top: 4px; }

.hidden { display: none !important; }

.help-modal {
    position: fixed;
    inset: 0;
    background: rgba(18, 48, 44, 0.72);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.help-content {
    background: linear-gradient(#fffdf2, #e8f6c8);
    border-radius: 24px;
    border: 4px solid var(--stroke);
    box-shadow: 0 8px 0 var(--stroke);
    max-width: 420px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left;
}

.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 10px;
}

.help-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
}

.help-close {
    font: inherit;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 3px solid var(--stroke);
    background: #fff8e4;
    color: var(--ink);
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 3px 0 var(--stroke);
}

.help-body { padding: 4px 16px 8px; }

.help-section { margin-bottom: 14px; }

.help-section h3 {
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #2a6d28;
    margin-bottom: 4px;
}

.help-section p,
.help-section li {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.45;
}

.help-section ul {
    margin: 0;
    padding-left: 18px;
}

.help-section strong { font-weight: 700; }

.help-footer {
    padding: 10px 16px 16px;
    text-align: center;
}

.help-ok-btn {
    font: inherit;
    background: linear-gradient(#7ec33a, #4f9a1c);
    border: 4px solid var(--stroke);
    color: #143018;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--stroke);
}

.help-ok-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--stroke);
}

/* Decoy splash — one pad only, short motion */
.number-btn.trick-hint {
    animation: padSplash 0.55s ease-in-out infinite;
    box-shadow:
        0 0 0 4px rgba(255, 244, 194, 0.55),
        0 3px 0 #234812,
        inset 0 2px 0 rgba(255,255,255,0.4);
    z-index: 4 !important;
    filter: brightness(1.08);
}

@keyframes padSplash {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-2px, -1px) rotate(-4deg); }
    50% { transform: translate(2px, 1px) rotate(4deg); }
    75% { transform: translate(-1px, 1px) rotate(-2deg); }
}

/* Water ring on a correct tap */
.ripple-circle-simple {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: transparent;
    border: 3px solid rgba(255, 248, 228, 0.85);
    box-shadow: 0 0 0 2px rgba(126, 195, 58, 0.25);
    transform: translate(-50%, -50%);
    animation: pondRipple 0.3s ease-out;
    pointer-events: none;
    z-index: 1000;
}

@keyframes pondRipple {
    0% {
        transform: translate(-50%, -50%) scale(0.4);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.6);
        opacity: 0;
    }
}

.ripple-rays,
.ripple-ray,
.ripple-circle,
.ripple-particle { display: none; }

.performance-mode * {
    animation: none !important;
    transition: none !important;
}

.performance-mode .number-btn,
.performance-mode .number-btn.trick-hint {
    animation: none !important;
}

@media (hover: none) and (pointer: coarse) {
    .number-btn { user-select: none; }
}

@media (max-width: 768px) {
    .container { padding: 12px 10px max(14px, env(safe-area-inset-bottom)); }
    .game-title { margin-bottom: 10px; }
    .numbers-container { height: 58vh; margin: 6px 0 10px; }
}

@media (max-width: 480px) {
    .menu-screen,
    .result-screen { padding: 16px 14px 14px; }
    .how-list li { font-size: 13px; }
    .info-value { font-size: 13px; }
    .info-label { font-size: 9px; }
}
