@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Nunito:wght@600;700;800;900&display=swap');

:root { color: #27231f; background: #fff8e7; font-family: 'Nunito', sans-serif; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background-color: #fff8e7; background-image: radial-gradient(#e9d9bd 0.7px, transparent 0.7px); background-size: 9px 9px; }
body::before, body::after { content: ''; position: fixed; z-index: -1; width: 220px; height: 220px; border: 3px solid #f0c84c; border-radius: 48% 52% 44% 56%; opacity: .34; }
body::before { top: -105px; left: -90px; transform: rotate(24deg); }
body::after { right: -110px; bottom: -130px; border-color: #55bda2; }
button, textarea { font: inherit; }
button { color: inherit; }
main { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 35px 0 24px; }
.site-header { text-align: center; margin-bottom: 30px; }
.logo { display: inline-flex; flex-direction: column; color: inherit; text-decoration: none; font-family: 'Baloo 2', sans-serif; font-size: clamp(3rem, 7vw, 5.4rem); font-weight: 800; line-height: .8; transform: rotate(-2deg); }
.logo svg { width: 110px; margin: 8px auto 0; overflow: visible; }
.logo path { fill: none; stroke: #ff604c; stroke-width: 7; stroke-linecap: round; }
.tagline { margin: 16px 0 0; font-weight: 800; color: #746b5f; letter-spacing: .02em; }
.tagline span { display: inline-block; color: #f6b92c; margin: 0 8px; }
.picker { display: grid; grid-template-columns: 1fr 1fr; border: 3px solid #27231f; border-radius: 30px 26px 34px 27px; background: rgba(255, 253, 246, .94); box-shadow: 8px 9px 0 #27231f; overflow: hidden; }
.input-side, .action-side { padding: clamp(26px, 5vw, 54px); min-width: 0; }
.input-side { border-right: 3px dashed #cabfae; }
.step-label { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; font-family: 'Baloo 2', sans-serif; font-size: 1.25rem; font-weight: 800; }
.step-label span { display: grid; place-items: center; width: 35px; height: 35px; flex: none; color: #fff; background: #27231f; border-radius: 48% 52% 45% 55%; transform: rotate(-5deg); }
.paper-wrap { position: relative; }
textarea { display: block; width: 100%; height: 315px; resize: vertical; border: 3px solid #27231f; border-radius: 11px 14px 9px 16px; padding: 26px 25px; color: #39332d; background-color: #fffdf6; background-image: repeating-linear-gradient(transparent 0, transparent 37px, #c7ddef 38px, transparent 39px); line-height: 39px; font-size: 1.12rem; font-weight: 800; box-shadow: 5px 6px 0 #f2b644; outline: none; }
textarea:focus { box-shadow: 5px 6px 0 #ff715e, 0 0 0 4px rgba(255, 113, 94, .15); }
.tape { position: absolute; width: 61px; height: 23px; background: rgba(255, 205, 92, .68); transform: rotate(-8deg); }
.tape-one { top: -9px; left: -18px; }.tape-two { right: -17px; bottom: -8px; transform: rotate(-6deg); }
.input-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 20px; color: #766e64; font-size: .88rem; font-weight: 700; }
.input-meta p { margin: 0; }.count { padding: 7px 13px; color: #27231f; background: #e9f8e4; border: 2px solid #27231f; border-radius: 99px; transform: rotate(1deg); white-space: nowrap; }.count strong { color: #26836a; }
.clear-button { margin-top: 25px; padding: 0; border: 0; border-bottom: 2px solid currentColor; background: none; color: #8a7f72; font-size: .9rem; font-weight: 800; cursor: pointer; }
.clear-button:hover { color: #e95243; }
.action-side { display: flex; flex-direction: column; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border: 3px solid #27231f; border-radius: 17px 20px 16px 19px; background: #f2ecdf; transform: rotate(.2deg); }
.mode-tab { min-height: 52px; padding: 8px; border: 0; border-radius: 11px 14px 10px 13px; background: transparent; font-weight: 900; cursor: pointer; }
.mode-tab span { margin-right: 5px; font-size: 1.15em; }.mode-tab.active { color: white; background: #27231f; box-shadow: 2px 3px 0 #f3b83d; }
.mode-panel { flex: 1; text-align: center; }.mode-panel[hidden] { display: none; }
.direct-panel { padding-top: 42px; }
.dice { position: relative; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 88px; height: 88px; margin: 0 auto 26px; padding: 14px; border: 3px solid #27231f; border-radius: 18px 23px 17px 22px; background: #ff6b57; box-shadow: 5px 6px 0 #f6c847; transform: rotate(7deg); }
.dice span { width: 11px; height: 11px; place-self: center; border-radius: 50%; background: #fffdf6; }.dice span:nth-child(1) { grid-area: 1 / 1; }.dice span:nth-child(2) { grid-area: 1 / 3; }.dice span:nth-child(3) { grid-area: 2 / 2; }.dice span:nth-child(4) { grid-area: 3 / 1; }.dice span:nth-child(5) { grid-area: 3 / 3; }
.direct-panel h2 { margin: 0; font-family: 'Baloo 2', sans-serif; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.05; }.direct-panel p, .wheel-panel > p { margin: 15px 0 27px; color: #756c61; font-weight: 700; line-height: 1.55; }
.pick-button, .again-button { position: relative; display: inline-flex; align-items: center; gap: 24px; border: 3px solid #27231f; border-radius: 15px 18px 14px 20px; padding: 14px 16px 14px 25px; background: #ffc63f; box-shadow: 5px 6px 0 #27231f; font-weight: 900; cursor: pointer; transition: transform .15s, box-shadow .15s; }.pick-button b { display: grid; place-items: center; width: 35px; height: 35px; color: white; background: #27231f; border-radius: 50%; font-size: 1.25rem; }.pick-button:hover, .again-button:hover { transform: translate(-1px, -2px) rotate(-1deg); box-shadow: 7px 8px 0 #27231f; }.pick-button:active, .again-button:active { transform: translate(4px, 4px); box-shadow: 1px 2px 0 #27231f; }.pick-button.pop { animation: button-pop .36s ease; }
.wheel-panel { padding-top: 24px; }.wheel-stage { position: relative; width: min(100%, 340px); aspect-ratio: 1; margin: 0 auto; }.wheel-stage canvas { display: block; width: 100%; height: 100%; filter: drop-shadow(5px 7px 0 #27231f); transition: transform 4.2s cubic-bezier(.12,.72,.12,1); }.pointer { position: absolute; z-index: 3; top: -8px; left: 50%; width: 0; height: 0; border-left: 18px solid transparent; border-right: 18px solid transparent; border-top: 43px solid #27231f; transform: translateX(-50%); filter: drop-shadow(0 2px 0 #fff); }.wheel-center { position: absolute; z-index: 2; inset: 50% auto auto 50%; width: 91px; height: 91px; border: 4px solid #27231f; border-radius: 50%; transform: translate(-50%, -50%) rotate(-4deg); background: #fff9e9; box-shadow: 3px 4px 0 #27231f; font-family: 'Baloo 2', sans-serif; font-size: .78rem; font-weight: 900; cursor: pointer; }.wheel-center:hover { background: #ffc83d; }.wheel-center:disabled { cursor: wait; }
.footer-note { margin: 30px 0 0; text-align: center; color: #82786d; font-size: .85rem; font-weight: 800; }.footer-note span { color: #f15e57; }
dialog { width: min(500px, calc(100% - 32px)); overflow: visible; padding: 46px 30px 38px; border: 4px solid #27231f; border-radius: 28px 35px 25px 33px; background: #fffaf0; box-shadow: 9px 10px 0 #27231f; text-align: center; }.result-kicker { margin: 0 0 9px; color: #756c61; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }dialog h2 { overflow-wrap: anywhere; margin: 0 0 27px; font-family: 'Baloo 2', sans-serif; color: #e95143; font-size: clamp(2.5rem, 10vw, 4.5rem); line-height: 1; }dialog::backdrop { background: rgba(39, 35, 31, .48); backdrop-filter: blur(3px); }.close-dialog { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 2rem; cursor: pointer; }.again-button { padding: 12px 19px; background: #75d2b7; }.confetti { position: absolute; inset: -24px; pointer-events: none; background-image: radial-gradient(circle, #ff644f 0 3px, transparent 4px), radial-gradient(circle, #4b83e8 0 3px, transparent 4px), radial-gradient(circle, #ffc83d 0 3px, transparent 4px); background-size: 61px 67px, 73px 53px, 47px 79px; background-position: 0 0, 12px 17px, 29px 4px; mask-image: linear-gradient(#000, transparent 31%, transparent 70%, #000); }
.toast { position: fixed; z-index: 10; bottom: 20px; left: 50%; padding: 12px 20px; border: 3px solid #27231f; border-radius: 99px; background: #ff7866; box-shadow: 4px 5px 0 #27231f; color: #fff; font-weight: 900; opacity: 0; transform: translate(-50%, 25px); pointer-events: none; transition: .25s; white-space: nowrap; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes button-pop { 50% { transform: scale(.94) rotate(1deg); } }
@media (max-width: 800px) { main { width: min(620px, calc(100% - 25px)); padding-top: 24px; }.picker { grid-template-columns: 1fr; box-shadow: 6px 7px 0 #27231f; }.input-side { border-right: 0; border-bottom: 3px dashed #cabfae; }.site-header { margin-bottom: 23px; }.logo { font-size: 3.6rem; }.tagline { font-size: .88rem; }textarea { height: 255px; }.wheel-stage { width: min(100%, 370px); } }
@media (max-width: 440px) { main { width: calc(100% - 20px); }.input-side, .action-side { padding: 25px 19px; }.mode-tab { font-size: .83rem; }.input-meta { align-items: flex-start; flex-direction: column; }.toast { max-width: calc(100% - 20px); white-space: normal; text-align: center; }.pick-button { gap: 14px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
textarea { resize: none; }
.direct-panel h2 { margin-bottom: 28px; }
.mode-panel { min-height: 364px; }
@media (max-width: 800px) { .mode-panel { min-height: 394px; } }
