/* EarnGiftHub Tools - widgets. All rules are scoped under .egh-box. Colours come from egh-site.css (with fallbacks). */
.egh-box{box-sizing:border-box;max-width:760px;margin:1.25em auto;padding:24px;border:1px solid var(--egh-line,#e6e3f3);border-radius:var(--egh-radius,16px);background:var(--egh-card,#fff);color:var(--egh-text,#27272f);font-family:var(--egh-font,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif);font-size:16px;line-height:1.55;box-shadow:var(--egh-shadow,0 8px 24px rgba(30,27,75,.07));overflow-wrap:anywhere}
.egh-box *,.egh-box *::before,.egh-box *::after{box-sizing:border-box}
.egh-box .egh-title{margin:0 0 10px;padding:0;font-family:inherit;font-size:1.3rem;font-weight:800;line-height:1.25;color:var(--egh-ink,#1e1b4b)}
.egh-box .egh-sub{margin:20px 0 8px;padding:0;font-family:inherit;font-size:1.02rem;font-weight:800;line-height:1.3;color:var(--egh-ink,#1e1b4b)}
.egh-box .egh-text,.egh-box .egh-note,.egh-box .egh-muted,.egh-box .egh-stats,.egh-box .egh-balance-line{margin:0 0 10px}
.egh-box .egh-note{padding:10px 12px;border:1px solid #f1dc8f;border-radius:10px;background:var(--egh-gold-soft,#fff6d6);color:#5a3a00;font-size:.92em}
.egh-box .egh-muted{color:var(--egh-muted,#5b6170);font-size:.92em}
.egh-box .egh-stats{color:var(--egh-muted,#5b6170);font-weight:600}
.egh-box .egh-balance-line{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border:1px solid #f1dc8f;border-radius:999px;background:var(--egh-gold-soft,#fff6d6);color:#5a3a00;font-size:.92em;font-weight:600}
.egh-box .egh-label{display:block;margin:0 0 6px;color:var(--egh-ink,#1e1b4b);font-weight:700;font-size:.95em}
.egh-box .egh-field{margin:0 0 14px}
.egh-box .egh-textarea,.egh-box .egh-input{display:block;width:100%;max-width:100%;min-height:48px;height:auto;margin:0;padding:11px 14px;border:1.5px solid #cfcbe6;border-radius:12px;background:#fff;color:var(--egh-text,#27272f);font:inherit;font-size:16px;line-height:1.4;box-shadow:none}
.egh-box select.egh-input{height:auto;padding-right:34px}
.egh-box .egh-textarea{min-height:170px;resize:vertical}
.egh-box .egh-textarea:focus,.egh-box .egh-input:focus{border:1.5px solid var(--egh-primary,#4f46e5);outline:3px solid #c7d2fe;outline-offset:0}
.egh-box .egh-coin:focus-visible{outline:3px solid #a5b4fc;outline-offset:3px}
.egh-box .egh-check{display:flex;align-items:center;gap:10px;min-height:44px;margin:6px 0;font-size:.95em;cursor:pointer}
.egh-box .egh-check input{flex:0 0 auto;width:20px;height:20px;margin:0;accent-color:var(--egh-primary,#4f46e5)}
.egh-box .egh-actions{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}
.egh-box .egh-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:0 0 10px}
.egh-box .egh-row .egh-input{flex:1 1 120px;width:auto}
.egh-box .egh-btn{min-height:48px;cursor:pointer;touch-action:manipulation}
.egh-box .egh-msg{min-height:1.5em;margin:10px 0 0;font-weight:700}
.egh-box .egh-msg:empty{min-height:0;margin:0}
.egh-box .egh-msg.egh-ok{color:var(--egh-ok,#15803d)}
.egh-box .egh-msg.egh-err{color:var(--egh-err,#b91c1c)}
.egh-box .egh-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.egh-box .egh-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.egh-box ul{list-style:none;margin:0;padding:0}

/* Log-in box */
.egh-box.egh-login{border-style:dashed;border-color:#cfc9f5;background:var(--egh-tint,#eef0ff);box-shadow:none}

/* AI checker */
.egh-box .egh-ai-result{margin-top:18px;padding-top:18px;border-top:1px solid var(--egh-line,#e6e3f3)}
.egh-box .egh-ai-result[hidden]{display:none}
.egh-box .egh-score{color:var(--egh-ink,#1e1b4b);font-size:3em;font-weight:800;line-height:1}
.egh-box .egh-score-of{font-size:.38em;font-weight:700;color:var(--egh-muted,#5b6170)}
.egh-box .egh-score-label{margin:6px 0 10px;font-weight:800}
.egh-box .egh-bar{height:12px;border-radius:999px;background:var(--egh-tint,#eef0ff);overflow:hidden}
.egh-box .egh-bar-fill{height:100%;width:0;border-radius:999px;background:#16a34a;transition:width .4s ease}
.egh-box .egh-signals li{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid var(--egh-line,#e6e3f3);font-size:.95em}
.egh-box .egh-signals li span:last-child{font-weight:700;white-space:nowrap}
.egh-box .egh-flags li,.egh-box .egh-counts li{display:inline-block;margin:0 6px 6px 0;padding:5px 12px;border-radius:999px;background:var(--egh-tint,#eef0ff);color:var(--egh-primary-dark,#3730a3);font-size:.9em;font-weight:600}

/* Wallet: gold coin card */
.egh-box.egh-wallet{padding:14px}
.egh-box .egh-wallet-card{position:relative;overflow:hidden;padding:22px;border-radius:14px;background:linear-gradient(135deg,#ffe58a 0%,#f8c21b 55%,#f5a301 100%);color:#2a1a00;box-shadow:inset 0 0 0 1px rgba(138,75,6,.25)}
.egh-box .egh-wallet-card::after{content:"";position:absolute;right:-46px;top:-46px;width:170px;height:170px;border-radius:50%;background:rgba(255,255,255,.22);box-shadow:inset 0 0 0 14px rgba(255,255,255,.18);pointer-events:none}
.egh-box .egh-wallet-card>*{position:relative;z-index:1}
.egh-box .egh-wallet-head{display:flex;align-items:center;gap:10px;margin:0 0 6px}
.egh-box .egh-wallet-head .egh-title{margin:0;color:#3b2300;font-size:1.05rem;letter-spacing:.02em}
.egh-box .egh-coin-ico{display:inline-block;flex:0 0 auto;width:30px;height:30px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff3b8 0%,#f5b301 60%,#b97a00 100%);box-shadow:inset 0 0 0 3px rgba(255,255,255,.55),0 0 0 2px #8a4b06}
.egh-box .egh-wallet-balance{margin:0 0 2px;color:#2a1a00;font-size:1.1em;line-height:1.1}
.egh-box .egh-wallet-balance .egh-balance-num{font-size:2.4rem;font-size:clamp(2.2rem,1.6rem + 3vw,3.2rem);font-weight:800;letter-spacing:-.02em}
.egh-box .egh-wallet-unit{font-weight:700}
.egh-box .egh-wallet-card .egh-wallet-value{margin:0 0 14px;color:#3b2300;font-weight:700}
.egh-box .egh-wallet-card .egh-muted{color:#5a3a00;font-weight:600}
.egh-box .egh-wallet-card .egh-actions{margin:16px 0 0}
.egh-box.egh-wallet>.egh-sub,.egh-box.egh-wallet>.egh-activity-wrap{margin-left:10px;margin-right:10px}

/* Progress to a gift card (wallet and redeem) */
.egh-box .egh-progress{margin:0 0 4px}
.egh-box .egh-progress-bar{height:12px;border-radius:999px;background:var(--egh-tint,#eef0ff);overflow:hidden}
.egh-box .egh-progress-fill{height:100%;min-width:0;border-radius:999px;background:linear-gradient(90deg,var(--egh-primary,#4f46e5),var(--egh-violet,#7c3aed));transition:width .5s ease}
.egh-box .egh-progress-text{margin:6px 0 0;color:var(--egh-muted,#5b6170);font-size:.92em;font-weight:600}
.egh-box .egh-wallet-card .egh-progress-bar{background:rgba(255,255,255,.55)}
.egh-box .egh-wallet-card .egh-progress-fill{background:#3b2300}
.egh-box .egh-wallet-card .egh-progress-text{color:#3b2300}
.egh-box .egh-redeem-need{margin:10px 0;padding:10px 12px;border-radius:10px;background:var(--egh-tint,#eef0ff);color:var(--egh-primary-dark,#3730a3);font-weight:700}
.egh-box .egh-redeem-need:empty{display:none}

.egh-box .egh-activity li{display:flex;flex-wrap:wrap;gap:4px 10px;padding:10px 0;border-bottom:1px solid var(--egh-line,#e6e3f3);font-size:.95em}
.egh-box .egh-activity li:last-child{border-bottom:0}
.egh-box .egh-activity-label{flex:1 1 160px}
.egh-box .egh-activity-amount{font-weight:800}
.egh-box .egh-plus{color:var(--egh-ok,#15803d)}
.egh-box .egh-minus{color:var(--egh-err,#b91c1c)}
.egh-box .egh-activity-time{flex:1 1 100%;color:var(--egh-muted,#5b6170);font-size:.85em}

/* Spin wheel */
.egh-box .egh-wheel-wrap{position:relative;width:min(280px,80%);margin:18px auto 10px}
.egh-box .egh-wheel{position:relative;width:100%;aspect-ratio:1/1;border-radius:50%;border:6px solid var(--egh-ink,#1e1b4b);background:conic-gradient(#f59e0b 0 45deg,#10b981 45deg 90deg,#3b82f6 90deg 135deg,#ef4444 135deg 180deg,#8b5cf6 180deg 225deg,#14b8a6 225deg 270deg,#f97316 270deg 315deg,#ec4899 315deg 360deg);box-shadow:0 6px 18px rgba(30,27,75,.22);transition:transform 4s cubic-bezier(.17,.67,.2,1)}
.egh-box .egh-wheel-label{position:absolute;top:0;left:50%;width:3em;height:50%;margin-left:-1.5em;padding-top:9%;transform-origin:50% 100%;text-align:center;color:#fff;font-weight:800;text-shadow:0 1px 2px rgba(0,0,0,.5)}
.egh-box .egh-wheel-pointer{position:absolute;z-index:2;top:-10px;left:50%;width:0;height:0;margin-left:-12px;border-left:12px solid transparent;border-right:12px solid transparent;border-top:22px solid var(--egh-ink,#1e1b4b)}

/* Tap game */
.egh-box .egh-coin{display:block;width:150px;height:150px;min-height:0;margin:14px auto;padding:0;border:6px solid #b45309;border-radius:50%;background:radial-gradient(circle at 35% 30%,#ffe58a 0%,#fbbf24 60%,#f59e0b 100%);color:#78350f;font:inherit;font-size:1.5em;font-weight:800;line-height:1;box-shadow:0 6px 18px rgba(180,83,9,.3);cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
.egh-box .egh-coin:hover,.egh-box .egh-coin:focus{background:radial-gradient(circle at 35% 30%,#ffe58a 0%,#fbbf24 60%,#f59e0b 100%);color:#78350f;border-color:#b45309}
.egh-box .egh-coin:active{transform:scale(.94)}
.egh-box .egh-coin:disabled{opacity:.45;cursor:not-allowed}

/* Quiz */
.egh-box .egh-quiz-count{margin:0 0 6px;color:var(--egh-muted,#5b6170);font-size:.9em;font-weight:700}
.egh-box .egh-quiz-q{margin:0 0 12px;color:var(--egh-ink,#1e1b4b);font-size:1.1em;font-weight:800}
.egh-box .egh-quiz-options{display:grid;gap:10px}
.egh-box .egh-quiz-options .egh-btn{width:100%;justify-content:flex-start;border-radius:12px;text-align:left}
.egh-box .egh-quiz-options .egh-right{background:#16a34a;color:#fff;opacity:1}
.egh-box .egh-quiz-options .egh-wrong{background:#b91c1c;color:#fff;opacity:1}

/* Giveaway */
.egh-box .egh-rules{margin:0 0 12px;padding:12px 14px;border:1px solid #f1dc8f;border-radius:12px;background:var(--egh-gold-soft,#fff6d6);color:#5a3a00;font-weight:700}

@media (max-width:480px){
	.egh-box{padding:16px;border-radius:14px}
	.egh-box.egh-wallet{padding:10px}
	.egh-box .egh-wallet-card{padding:18px}
	.egh-box .egh-actions .egh-btn{flex:1 1 auto}
}
@media (prefers-reduced-motion:reduce){
	.egh-box .egh-wheel{transition-duration:.01s}
	.egh-box .egh-bar-fill,.egh-box .egh-progress-fill{transition:none}
}
