@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;700&display=swap');

:root {
    --display-font: "Oswald", ui-sans-serif, system-ui, sans-serif;
    --body-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg: #f7f8fb;
    --card: #ffffff;
    --text: #182033;
    --muted: #5f6b7a;
    --line: #e2e6ee;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --soft: #eef4ff;
    --shadow: 0 12px 30px rgba(24, 32, 51, 0.08);
    --radius: 18px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--body-font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: inherit; }

.site-header {
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    backdrop-filter: blur(14px);
    z-index: 10;
}

.nav {
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, var(--brand), #7c3aed);
    font-weight: 900;
}

.nav-links {
    display: flex;
    gap: 18px;
    color: var(--muted);
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--brand); }

.hero {
    max-width: 1120px;
    margin: 0 auto;
    padding: 72px 20px 34px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 36px;
    align-items: center;
}

.eyebrow {
    color: var(--brand);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

h1 {
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 0.96;
    letter-spacing: -0.07em;
    margin: 12px 0 18px;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin: 0 0 12px;
}

h3 {
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.18rem;
    color: var(--muted);
    max-width: 680px;
}

.hero-card, .card, .tool-card, .tool-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card { padding: 22px; }
.hero-card-list { display: grid; gap: 12px; }

.mini-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    background: var(--soft);
    border-radius: 14px;
}

.mini-row span { color: var(--muted); }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.button {
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: white;
    padding: 12px 18px;
    font-weight: 750;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button:hover { background: var(--brand-dark); }

.button.secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--line);
}

.button.small {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.section {
    max-width: 1120px;
    margin: 0 auto;
    padding: 34px 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.tool-card {
    padding: 20px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(24, 32, 51, 0.12);
}

.tool-card p, .muted { color: var(--muted); }

.page {
    max-width: 860px;
    margin: 0 auto;
    padding: 56px 20px;
}

.tool-layout {
    max-width: 920px;
    margin: 0 auto;
    padding: 46px 20px;
}

.tool-panel {
    padding: 24px;
    margin-top: 24px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

label { font-weight: 750; }

input, select, textarea {
    width: 100%;
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid var(--line);
    font: inherit;
    background: white;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-row input { width: auto; }

.result {
    margin-top: 18px;
    padding: 18px;
    background: var(--soft);
    border-radius: 14px;
    font-size: 1.5rem;
    font-weight: 850;
    word-break: break-word;
}

.result-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--soft);
    border-radius: 14px;
    word-break: break-word;
}

.dice-result, .coin-result {
    text-align: center;
    font-size: 4rem;
    line-height: 1;
}

.qr-output {
    display: grid;
    place-items: center;
    min-height: 280px;
    margin-top: 18px;
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 16px;
    padding: 18px;
}

.qr-output canvas {
    max-width: 100%;
    height: auto !important;
}

.color-preview {
    width: 100%;
    height: 180px;
    border-radius: 18px;
    border: 1px solid var(--line);
    margin-top: 18px;
}

.wheel-wrap {
    display: grid;
    place-items: center;
    margin: 20px 0;
}

.wheel {
    width: min(360px, 80vw);
    height: min(360px, 80vw);
    border-radius: 50%;
    border: 10px solid white;
    box-shadow: var(--shadow);
    display: grid;
    place-items: center;
    background: conic-gradient(#dbeafe 0deg 60deg, #e0e7ff 60deg 120deg, #ede9fe 120deg 180deg, #f5f3ff 180deg 240deg, #eff6ff 240deg 300deg, #e0f2fe 300deg 360deg);
    transition: transform 2.4s cubic-bezier(.12,.67,.18,1);
}

.wheel-center {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: white;
    border: 1px solid var(--line);
    text-align: center;
    font-weight: 850;
    padding: 10px;
}

.help-list {
    margin-top: 24px;
    padding: 18px 20px;
    background: var(--soft);
    border-radius: 14px;
}

.site-footer {
    margin-top: 50px;
    border-top: 1px solid var(--line);
    background: white;
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 0.92rem;
}

.footer-inner a {
    color: var(--muted);
    text-decoration: none;
    margin-left: 14px;
}

.footer-inner a:hover { color: var(--brand); }

@media (max-width: 780px) {
    .hero {
        grid-template-columns: 1fr;
        padding-top: 42px;
    }

    .grid { grid-template-columns: 1fr; }

    .nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-inner { flex-direction: column; }

    .footer-inner a { margin: 0 14px 0 0; }

    .result-row {
        align-items: flex-start;
        flex-direction: column;
    }
}


.name-result-grid {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.name-tag {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--soft);
    border-radius: 14px;
    font-weight: 800;
    word-break: break-word;
}

.name-tag span {
    color: var(--muted);
    font-weight: 650;
    font-size: 0.92rem;
}

@media (max-width: 780px) {
    .name-tag {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* v0.5.0 polish */
.logo,
.nav-links,
.eyebrow,
h1,
h2,
h3,
.button,
.result strong,
.name-tag strong,
.result-row strong,
.mini-row strong,
.result-table-header {
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.lead,
.muted,
p,
li,
input,
select,
textarea,
label,
.result span,
.name-tag span {
    font-family: var(--body-font);
    text-transform: none;
    letter-spacing: normal;
}

.tool-helper {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.96rem;
}

.result-table-header,
.name-tag,
.result-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(90px, 160px) auto;
    align-items: center;
    gap: 14px;
}

.result-table-header {
    margin-top: 22px;
    padding: 0 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

.name-tag span,
.result-row span {
    justify-self: center;
}

.name-tag .button,
.result-row .button {
    justify-self: end;
}

.coin-stage {
    display: grid;
    place-items: center;
    min-height: 190px;
}

.coin-disc {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 35% 30%, #fff7c2, #f4b63f 42%, #9a5c08 100%);
    border: 8px solid #f8d36a;
    box-shadow: 0 18px 40px rgba(112, 70, 0, 0.22);
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1b2438;
}

.coin-disc.flipping {
    animation: coinFlipSpin 0.85s ease;
}

@keyframes coinFlipSpin {
    0% { transform: rotateY(0) translateY(0); }
    35% { transform: rotateY(540deg) translateY(-28px); }
    70% { transform: rotateY(900deg) translateY(8px); }
    100% { transform: rotateY(1080deg) translateY(0); }
}

.dice-roll-visual {
    display: inline-grid;
    place-items: center;
    width: 98px;
    height: 98px;
    margin: 0 auto 12px;
    border-radius: 20px;
    background: white;
    border: 2px solid var(--line);
    box-shadow: var(--shadow);
    font-family: var(--display-font);
    font-size: 2.4rem;
}

.dice-roll-visual.rolling {
    animation: diceShake 0.55s ease;
}

@keyframes diceShake {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    20% { transform: translate(-7px, 3px) rotate(-8deg); }
    40% { transform: translate(6px, -4px) rotate(8deg); }
    60% { transform: translate(-4px, -2px) rotate(-5deg); }
    80% { transform: translate(3px, 5px) rotate(6deg); }
}

.color-preview {
    transition: background 0.25s ease, transform 0.2s ease;
}

.color-preview.color-pop {
    transform: scale(1.015);
}

.uuid-reveal {
    animation: revealSoft 0.3s ease;
}

@keyframes revealSoft {
    from { opacity: 0.4; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.qr-output img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.wheel-zone {
    display: grid;
    grid-template-columns: minmax(260px, 420px) 1fr;
    gap: 22px;
    align-items: start;
}

.wheel-pointer {
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 24px solid #111827;
    margin: 0 auto -10px;
    position: relative;
    z-index: 2;
}

.wheel {
    position: relative;
    overflow: hidden;
    background: conic-gradient(#ef4444 0deg 45deg, #f97316 45deg 90deg, #eab308 90deg 135deg, #22c55e 135deg 180deg, #06b6d4 180deg 225deg, #3b82f6 225deg 270deg, #8b5cf6 270deg 315deg, #ec4899 315deg 360deg);
}

.wheel-labels {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
}

.wheel-label {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42%;
    transform-origin: 0 0;
    color: white;
    font-family: var(--display-font);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
    text-shadow: 0 1px 5px rgba(0,0,0,0.45);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wheel-center {
    position: relative;
    z-index: 1;
}

.wheel-options-list {
    display: grid;
    gap: 8px;
}

.wheel-option-pill {
    padding: 9px 11px;
    border-radius: 999px;
    background: var(--soft);
    font-size: 0.94rem;
}

.writing-output {
    white-space: pre-wrap;
    font-size: 1.05rem;
    line-height: 1.7;
    font-weight: 650;
}

@media (max-width: 780px) {
    .result-table-header {
        display: none;
    }

    .result-table-header,
    .name-tag,
    .result-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .name-tag span,
    .result-row span,
    .name-tag .button,
    .result-row .button {
        justify-self: start;
    }

    .wheel-zone {
        grid-template-columns: 1fr;
    }
}
