.tool-coin{
            --ink: #17212f;
            --muted: #637083;
            --soft: #f3f6fa;
            --line: #dce4ee;
            --blue: #0a5c92;
            --blue-dark: #083a5d;
            --shadow: 0 16px 34px rgba(15, 35, 58, 0.12);
        }
.tool-coin *{
            box-sizing: border-box;
        }
.tool-coin{
            margin: 0;
            min-height: 100vh;
            overflow: hidden;
            font-family: Arial, Helvetica, sans-serif;
            background:
                radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.95), transparent 28%),
                linear-gradient(180deg, #f8fbfe 0%, var(--soft) 100%);
            color: var(--ink);
        }
.tool-coin button,.tool-coin input,.tool-coin a{
            font: inherit;
        }
.tool-coin a{
            color: inherit;
        }
.tool-coin .back-button{
            position: fixed;
            z-index: 10;
            top: max(12px, env(safe-area-inset-top));
            left: 14px;
            min-height: 42px;
            padding: 9px 13px;
            border-radius: 8px;
            background: rgba(238, 243, 248, 0.9);
            color: var(--blue-dark);
            text-decoration: none;
            font-weight: 800;
            backdrop-filter: blur(10px);
        }
.tool-coin .page{
            position: relative;
            width: 100%;
            min-height: 100svh;
            overflow: hidden;
        }
.tool-coin .setup{
            position: absolute;
            z-index: 5;
            top: max(66px, calc(env(safe-area-inset-top) + 62px));
            left: 50%;
            width: min(560px, calc(100% - 28px));
            transform: translateX(-50%);
            transition: opacity 220ms ease, transform 220ms ease;
        }
.tool-coin .page.is-ready .setup{
            opacity: 0;
            pointer-events: none;
            transform: translate(-50%, -16px);
        }
.tool-coin .choice-grid{
            display: grid;
            gap: 12px;
        }
.tool-coin label{
            display: grid;
            grid-template-columns: 58px minmax(0, 1fr);
            gap: 10px;
            align-items: center;
            color: var(--muted);
            font-weight: 800;
            font-size: 0.9rem;
        }
.tool-coin .choice-image{
            width: 58px;
            height: 58px;
            border-radius: 50%;
            object-fit: cover;
            border: 1px solid var(--line);
            background: #fff;
            box-shadow: 0 5px 14px rgba(15, 35, 58, 0.12);
        }
.tool-coin .choice-field{
            display: grid;
            gap: 6px;
            min-width: 0;
        }
.tool-coin input[type="text"]{
            width: 100%;
            min-height: 48px;
            border: 1px solid var(--line);
            border-radius: 8px;
            padding: 10px 12px;
            color: var(--ink);
            background: rgba(255, 255, 255, 0.92);
            font-weight: 800;
            box-shadow: 0 10px 26px rgba(15, 35, 58, 0.08);
        }
.tool-coin input[type="text"]:focus{
            outline: 3px solid rgba(10, 92, 146, 0.18);
            border-color: var(--blue);
        }
.tool-coin .ready-button{
            width: 100%;
            min-height: 50px;
            margin-top: 14px;
            border: 0;
            border-radius: 8px;
            background: var(--blue);
            color: #fff;
            cursor: pointer;
            font-weight: 900;
        }
.tool-coin .ready-button:hover,.tool-coin .ready-button:focus-visible{
            background: #084b78;
        }
.tool-coin .coin-world{
            position: absolute;
            inset: 0;
            overflow: hidden;
            perspective: 1000px;
            touch-action: none;
        }
.tool-coin .choice-ambient{
            position: absolute;
            z-index: 1;
            top: 50%;
            display: grid;
            justify-items: center;
            gap: 8px;
            width: min(22vw, 190px);
            opacity: 0;
            transform: translateY(-50%) scale(0.96);
            transition: opacity 260ms ease, transform 260ms ease;
            pointer-events: none;
        }
.tool-coin .page.is-ready .choice-ambient{
            opacity: 0.28;
            transform: translateY(-50%) scale(1);
        }
.tool-coin .choice-ambient-left{
            left: clamp(8px, 4vw, 54px);
        }
.tool-coin .choice-ambient-right{
            right: clamp(8px, 4vw, 54px);
        }
.tool-coin .choice-ambient img{
            width: min(20vw, 150px);
            height: min(20vw, 150px);
            min-width: 86px;
            min-height: 86px;
            border-radius: 50%;
            object-fit: cover;
            filter: saturate(0.9);
        }
.tool-coin .choice-ambient span{
            max-width: 100%;
            color: var(--blue-dark);
            font-size: clamp(1rem, 2.4vw, 1.8rem);
            font-weight: 900;
            text-align: center;
            overflow-wrap: anywhere;
        }
.tool-coin .coin-button{
            position: absolute;
            z-index: 3;
            left: 50%;
            bottom: max(34px, env(safe-area-inset-bottom));
            width: min(42vw, 230px);
            height: min(42vw, 230px);
            min-width: 164px;
            min-height: 164px;
            border: 0;
            border-radius: 50%;
            padding: 0;
            background: transparent;
            cursor: grab;
            transform: translateX(-50%);
            transform-style: preserve-3d;
        }
.tool-coin .coin-button:active{
            cursor: grabbing;
        }
.tool-coin .coin-button:focus-visible{
            outline: 4px solid rgba(10, 92, 146, 0.28);
            outline-offset: 8px;
        }
.tool-coin .coin-button.show-tails{
            transform: translateX(-50%) rotateY(180deg);
        }
.tool-coin .coin-face{
            position: absolute;
            inset: 0;
            border-radius: 50%;
            display: grid;
            place-items: center;
            backface-visibility: hidden;
            background-size: cover;
            background-position: center;
            box-shadow: var(--shadow);
        }
.tool-coin .coin-heads{
            background-image: url("https://terapisomvirker.no/mynt-side-kron.jpg");
        }
.tool-coin .coin-tails{
            transform: rotateY(180deg);
            background-image: url("https://terapisomvirker.no/mynt-side-mynt.jpg");
        }
.tool-coin .shadow{
            position: absolute;
            z-index: 2;
            left: 50%;
            bottom: max(24px, calc(env(safe-area-inset-bottom) - 6px));
            width: min(42vw, 210px);
            height: 18px;
            transform: translateX(-50%);
            border-radius: 50%;
            background: rgba(23, 33, 47, 0.16);
            filter: blur(5px);
        }
.tool-coin .hint{
            position: absolute;
            z-index: 4;
            left: 50%;
            bottom: max(10px, calc(env(safe-area-inset-bottom) + 8px));
            width: min(420px, calc(100% - 32px));
            margin: 0 0 0;
            padding: 8px 12px;
            border-radius: 999px;
            transform: translateX(-50%);
            color: var(--blue-dark);
            background: rgba(255, 255, 255, 0.76);
            font-size: 1rem;
            font-weight: 900;
            text-align: center;
            opacity: 0;
            transition: opacity 180ms ease;
            backdrop-filter: blur(10px);
        }
.tool-coin .page.is-ready .hint{
            opacity: 1;
        }
.tool-coin .result-toast{
            position: absolute;
            z-index: 6;
            left: 50%;
            top: max(70px, calc(env(safe-area-inset-top) + 62px));
            width: min(440px, calc(100% - 32px));
            padding: 13px 16px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.9);
            box-shadow: var(--shadow);
            text-align: center;
            transform: translate(-50%, -12px);
            opacity: 0;
            pointer-events: none;
            transition: opacity 180ms ease, transform 180ms ease;
            backdrop-filter: blur(10px);
        }
.tool-coin .result-toast.is-visible{
            opacity: 1;
            transform: translate(-50%, 0);
        }
.tool-coin .result-label{
            margin: 0 0 3px;
            color: var(--muted);
            font-size: 0.86rem;
            font-weight: 800;
        }
.tool-coin .result-value{
            margin: 0;
            color: var(--blue-dark);
            font-size: clamp(1.35rem, 4vw, 2.25rem);
            font-weight: 900;
            line-height: 1.1;
            overflow-wrap: anywhere;
        }
@media (max-width: 700px) {.tool-coin .choice-ambient{
                top: 36%;
                width: 110px;
            }
.tool-coin .choice-ambient-left{
                left: 10px;
            }
.tool-coin .choice-ambient-right{
                right: 10px;
            }
.tool-coin .choice-ambient img{
                width: 88px;
                height: 88px;
                min-width: 88px;
                min-height: 88px;
            }
.tool-coin .choice-ambient span{
                font-size: 0.95rem;
            }}
@media (max-width: 520px) {.tool-coin .setup{
                top: max(62px, calc(env(safe-area-inset-top) + 58px));
            }
.tool-coin .coin-button{
                width: min(52vw, 200px);
                height: min(52vw, 200px);
                min-width: 152px;
                min-height: 152px;
            }}