*{box-sizing:border-box}body{margin:0;background:#f3f6fb;color:#182338;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:16px}button,textarea,input{font:inherit}button{cursor:pointer}header{height:80px;border-bottom:1px solid #e1e7ef;display:flex;align-items:center;justify-content:space-between;padding:0 32px;background:#fff}.brand{font-weight:850;font-size:25px;letter-spacing:-1px;display:flex;align-items:center;gap:10px}.logo{background:#2563eb;color:#fff;border-radius:12px;width:36px;height:36px;text-align:center;line-height:32px;font-size:29px}.lite{font-size:13px;letter-spacing:0;background:#edf3ff;color:#2563eb;padding:5px 8px;border-radius:6px}.badge{font-size:13px;color:#64748b}.shell{max-width:680px;margin:54px auto;padding:0 24px}h1{font-size:32px;letter-spacing:-1.3px;margin:0 0 12px;line-height:1.35}p{line-height:1.65;color:#64748b;margin:0}.intro{margin-bottom:28px}.box{background:#fff;border:1px solid #dce4ef;border-radius:22px;padding:24px;box-shadow:0 8px 28px #18345a06}.label{font-weight:700;font-size:15px;display:block;margin-bottom:14px}textarea{resize:vertical;border:0;outline:none;background:transparent;min-height:140px;width:100%;line-height:1.65;color:#182338}textarea::placeholder{color:#91a0b5}textarea:focus-visible{outline:2px solid #2563eb;border-radius:6px}.rule{border-top:1px solid #edf0f5;margin:14px 0 20px}.primary{background:#2563eb;color:#fff;border:0;border-radius:12px;padding:15px 20px;font-weight:700;width:100%;box-shadow:0 4px 10px #2563eb20}.primary:hover{background:#1d4ed8}.sources{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0 32px}.source{display:flex;align-items:center;justify-content:center;gap:10px;background:#fff;border:1px solid #dce4ef;border-radius:14px;padding:18px;text-align:left;color:#25334a;font-size:15px;font-weight:650}.icon{background:#edf3ff;color:#2563eb;display:grid;place-items:center;width:38px;height:38px;border-radius:10px;font-size:22px}.small{font-size:13px}.examples{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.chip{border:1px solid #dce4ef;background:transparent;border-radius:22px;padding:10px 14px;color:#53637a;font-size:14px}.chip:hover{background:#e8f0ff;color:#2563eb}.foot{text-align:center;font-size:13px;margin-top:34px;color:#8694a7}.back{border:0;background:transparent;padding:0;color:#53637a;font-size:14px;margin-bottom:24px}.resulttop{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.resulttop h1{font-size:26px;margin-bottom:6px}.count{background:#eaf1ff;color:#2563eb;border-radius:24px;padding:8px 13px;font-weight:700;font-size:14px}.notice{background:#eaf1ff;color:#436189;padding:14px 16px;border-radius:12px;font-size:14px;line-height:1.6;margin-bottom:20px}.row{display:grid;grid-template-columns:28px 1fr 34px;gap:10px;padding:19px 0;border-bottom:1px solid #e9edf4}.row:last-child{border-bottom:0}.num{color:#95a1b4;font-size:13px;padding-top:8px}.fields input{width:100%;border:1px solid transparent;background:transparent;border-radius:5px;padding:4px 6px;color:#182338;min-width:0}.fields input:first-child{font-size:18px;font-weight:700;margin-bottom:3px}.fields input:last-child{color:#64748b;font-size:15px}.fields input:hover{background:#f5f8fc}.fields input:focus{outline:2px solid #2563eb;background:#fff}.delete{align-self:center;border:0;background:transparent;color:#98a4b5;font-size:22px;border-radius:8px;height:36px}.delete:hover{color:#dc2626;background:#fff1f2}.resultbox{padding:4px 20px}.actions{margin-top:20px}.secondary{border:1px solid #dce4ef;background:#fff;border-radius:12px;padding:15px;width:100%;color:#53637a;font-weight:650}.attached{display:none;margin:12px 0;padding:12px;background:#f3f6fb;border-radius:10px;font-size:14px;overflow-wrap:anywhere}.attached img{max-height:160px;max-width:100%;display:block;margin-bottom:8px}.status{min-height:22px;color:#2563eb;font-size:14px;margin-top:12px}dialog{border:1px solid #dce4ef;border-radius:20px;padding:24px;width:min(90vw,520px);box-shadow:0 24px 70px #15264530}dialog::backdrop{background:#15264560}dialog{max-height:90dvh;overflow:auto}dialog textarea{height:280px;min-height:280px;font-size:15px;line-height:1.325;border:1px solid #dce4ef;border-radius:10px;padding:12px;margin:18px 0}dialog h2{margin:0;font-size:22px}.dialogbuttons{display:flex;gap:10px}.dialogbuttons button{flex:1}button:focus-visible{outline:3px solid #93b4ff;outline-offset:3px}[hidden]{display:none!important}@media(max-width:600px){header{height:68px;padding:0 20px}.shell{margin:34px auto;padding:0 20px}h1{font-size:28px}.box{padding:20px;border-radius:18px}.sources{gap:10px}.source{padding:14px 6px;gap:7px;font-size:14px;flex-direction:column}.icon{width:32px;height:32px;flex-shrink:0}.badge{font-size:12px}.resultbox{padding:2px 16px}.resulttop h1{font-size:24px}.foot{margin-top:28px}}.error{color:#b91c1c;line-height:1.5}button:disabled{opacity:.55;cursor:wait}.password{width:100%;padding:12px;border:1px solid #dce4ef;border-radius:10px;margin-bottom:18px}.busy{padding:12px 0;color:#2563eb}.usage{font-size:13px;line-height:1.7;margin-top:16px}dialog:not([open]){display:none}.source svg{width:22px;height:22px}.attached button{margin-top:10px}#pasteinput{font-size:15px;line-height:1.325;height:280px;min-height:280px}.generate-actions{display:grid;grid-template-columns:3fr 1fr;gap:10px}.generate-actions button{min-width:0}.reset{padding:15px 8px}.home-button{font-size:16px;font-weight:700;padding:12px 20px;border:1px solid #dce4ef;background:#fff;border-radius:12px}.cost-note{font-size:12px;line-height:1.6;margin-top:6px}.debug-area{margin-top:24px}.code-button{border:1px solid #dce4ef;background:#fff;border-radius:8px;padding:9px 12px;font-size:13px;color:#53637a}.code-button span{font-family:monospace;font-weight:700;margin-right:6px}.debug-panel{margin-top:12px;background:#142033;color:#dbe7ff;border-radius:12px;padding:14px;font-size:12px}.debug-panel p{font-size:12px;color:#a9bbd9}.debug-panel h3{font-size:13px}.debug-panel pre{max-height:260px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.5;margin:0}.page-nav{display:flex;gap:10px;margin-bottom:24px}.history-list{margin-top:20px}.history-card{display:flex;gap:8px;background:#fff;border:1px solid #dce4ef;border-radius:12px;padding:12px;margin-bottom:10px}.history-open{flex:1;min-width:0;border:0;background:transparent;text-align:left;display:flex;flex-direction:column;gap:8px;color:#182338}.history-open strong{overflow-wrap:anywhere;font-size:17px}.history-delete{align-self:center;border:1px solid #fecaca;color:#b91c1c;background:#fff;border-radius:8px;padding:9px;font-size:14px}.pagination{display:flex;align-items:center;justify-content:space-between;margin-top:20px}.flash-start{margin-bottom:18px;background:linear-gradient(120deg,#2463eb,#7544ec)}dialog.flash-game{position:fixed;top:0;right:0;bottom:0;left:0;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;border:0;border-radius:0;padding:max(24px,env(safe-area-inset-top)) 24px max(24px,env(safe-area-inset-bottom));background:radial-gradient(ellipse at 25% 20%,#233e76,transparent 60%),radial-gradient(ellipse at 90% 90%,#493077,transparent 60%),#0b1226;color:#fff;display:flex;flex-direction:column;overflow:auto}.flash-game::backdrop{background:#0b1226}.game-top{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;max-width:700px;width:100%;margin:0 auto}.game-top h2{font-size:18px;font-weight:600;line-height:1.5;margin-top:8px}.game-label{font-size:12px;letter-spacing:3px;color:#9bb6ff}.game-close{border:1px solid #ffffff30;border-radius:50%;width:44px;height:44px;background:#ffffff12;color:#fff;font-size:30px;flex-shrink:0}.game-progress{max-width:420px;width:100%;margin:26px auto 10px;text-align:center;font-size:14px;color:#becdf0}.game-progress>div{height:4px;background:#ffffff18;border-radius:8px;margin-top:12px;overflow:hidden}.game-progress i{display:block;background:#81a9ff;height:100%;transition:width .3s}.card-stage{flex:1;min-height:260px;display:grid;place-items:center;perspective:1200px}.playing-card{position:relative;width:min(100%,380px);height:clamp(260px,48dvh,460px);padding:0;border:0;background:transparent;touch-action:pan-y;transition:transform .15s;cursor:pointer}.card-rotator{position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform .55s cubic-bezier(.2,.8,.2,1)}.flipped .card-rotator{transform:rotateY(180deg)}.card-face{position:absolute;top:0;right:0;bottom:0;left:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;display:flex;flex-direction:column;justify-content:space-between;align-items:center;padding:28px 24px;border-radius:28px;box-shadow:0 24px 0 -14px #50659c,0 34px 0 -20px #344572,0 40px 70px #0007,inset 0 1px #ffffffc0;border:1px solid #ffffff70;overflow:auto}.card-front{background:linear-gradient(145deg,#f5f8ff,#dfe9ff);color:#142c58}.card-back{background:linear-gradient(145deg,#7957e9,#3f2d96);color:#fff;transform:rotateY(180deg)}.card-face>span{font-size:12px;letter-spacing:3px;opacity:.65}.card-face strong{font-size:clamp(24px,6vw,40px);line-height:1.4;overflow-wrap:anywhere;white-space:pre-wrap;margin:auto 0;padding:18px 0}.card-face small{font-size:13px;opacity:.7}.game-hint{text-align:center;color:#a0b4dc;font-size:13px;margin:22px 0 18px}.game-controls{display:flex;gap:12px;max-width:420px;width:100%;margin:0 auto}.game-controls button{flex:1;background:#ffffff12;border:1px solid #ffffff30;border-radius:14px;padding:14px;color:#fff;font-size:15px}.game-controls .game-flip{background:#466fe3;border-color:#6489ff}@media(prefers-reduced-motion:reduce){.card-rotator,.playing-card,.game-progress i{transition:none}}.card-face strong{font-size:clamp(32px,8vw,52px);flex-shrink:0}.playing-card{width:min(100%,440px);height:clamp(300px,52dvh,520px)}.card-face{padding:24px 18px}.source-image{margin-top:24px;padding:18px;background:#fff;border:1px solid #dce4ef;border-radius:16px}.source-image h2{font-size:18px;margin:0 0 14px}.source-image img{width:100%;height:auto;display:block;border-radius:8px}.source-image p{margin-top:12px}.original-input{margin-bottom:18px;padding:16px;background:#eef3fb;border-radius:12px}.original-input h2{font-size:14px;margin:0 0 8px;color:#53637a}.original-input p{white-space:pre-wrap;overflow-wrap:anywhere;color:#182338;font-size:16px}.learning-image{display:block;width:100%;max-width:280px;max-height:170px;object-fit:contain;margin:10px auto 16px;filter:drop-shadow(0 4px 7px #0002)}.card-content{margin:auto 0;width:100%;display:flex;align-items:center;flex-direction:column}.card-content .learning-image{max-width:340px;max-height:230px;margin:10px auto}.card-content strong{font-size:clamp(32px,8vw,52px);padding:14px 0}.card-content.has-image strong{font-size:24px}.image-unavailable{font-size:14px}
