/* Mine & Earn — روشن، مینیمال و واکنش‌گرا */
@import url('https://fonts.googleapis.com/css2?family=Lalezar&display=swap');
:root {
  --bg: #f4f8ff; --surface: #fff; --ink: #24324a; --muted: #7b8aa4;
  --blue: #5b8def; --blue-dark: #3971df; --mint: #dff8ec; --yellow: #fff2c8;
  --border: #e5ebf5; --shadow: 0 14px 38px rgba(54, 83, 130, .10);
}
* { box-sizing: border-box; }
html { min-height: 100%; cursor: none; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  background: radial-gradient(ellipse at 50% 5%, #fff 0, var(--bg) 62%);
  font-family: "Lalezar", sans-serif;
  cursor: none;
}
button, a, input { font: inherit; }
button { cursor: none; }
button:focus-visible { outline: 3px solid #8bb4ff; outline-offset: 3px; }
.app-shell { width: min(1240px, 100%); min-height: 100vh; margin: auto; padding: 24px clamp(14px, 3vw, 36px) 18px; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: #e8efff; font-size: 27px; }
.brand strong { display: block; font-size: 19px; }
.brand small { display: block; color: var(--muted); letter-spacing: 2px; font-size: 10px; margin-top: 3px; }
.wallet { display: flex; gap: 10px; flex-wrap: wrap; }
.wallet-item { display: flex; align-items: center; gap: 9px; padding: 9px 14px; min-width: 105px; border: 1px solid var(--border); border-radius: 15px; background: rgba(255,255,255,.88); box-shadow: 0 4px 14px rgba(50,80,130,.04); }
.wallet-icon { font-size: 22px; }
.wallet-item small { display: block; font-size: 11px; color: var(--muted); }
.wallet-item b { display: block; font-size: 15px; direction: ltr; text-align: right; }
.coins { background: #fff9e8; border-color: #f7e8b9; }
.game-layout { flex: 1; display: grid; grid-template-columns: 112px minmax(0, 1fr) 112px; align-items: center; gap: clamp(10px, 3vw, 34px); padding: 38px 0 20px; }
.side-tools { display: flex; flex-direction: column; gap: 14px; align-self: center; }
.tool-card { border: 1px solid var(--border); background: white; border-radius: 18px; min-height: 104px; padding: 13px 8px 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--ink); box-shadow: 0 8px 22px rgba(52,80,130,.06); transition: transform .16s, box-shadow .16s, border-color .16s; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #b9cefa; }
.tool-card img { width: 42px; height: 42px; object-fit: contain; image-rendering: auto; }
.tool-card span { font-weight: 700; font-size: 12px; direction: ltr; }
.mine-area { display: flex; align-items: center; flex-direction: column; text-align: center; min-width: 0; }
.welcome-line { display: inline-flex; align-items: center; gap: 8px; color: #5d6f8d; background: #fff; border: 1px solid var(--border); border-radius: 99px; padding: 8px 15px; font-size: 13px; }
.status-dot { width: 8px; height: 8px; background: #35c98b; border-radius: 50%; box-shadow: 0 0 0 4px #e4faef; }
.mine-button { position: relative; border: 0; background: transparent; margin: 24px 0 6px; padding: 0; width: min(370px, 65vw); aspect-ratio: 1; display: grid; place-items: center; transition: transform .12s; }
.mine-button img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 20px 15px rgba(57,76,106,.14)); user-select: none; pointer-events: none; }
.mine-button:hover { transform: translateY(-3px) scale(1.015); }
.mine-button.hit { animation: hit-shake .25s ease-in-out; }
.mine-button.hit img { filter: drop-shadow(0 12px 12px rgba(57,76,106,.17)) brightness(1.12); }
.mine-shine { position: absolute; inset: 8%; border-radius: 30%; background: transparent; pointer-events: none; }
@keyframes hit-shake { 0%,100% { transform: translateX(0) rotate(0); } 20% { transform: translateX(-5px) rotate(-1deg); } 45% { transform: translateX(5px) rotate(1deg); } 70% { transform: translateX(-3px) rotate(-.5deg); } }
.mine-message { min-height: 24px; color: var(--muted); font-size: 13px; }
.cooldown-wrap { width: min(350px, 90%); margin-top: 14px; }
.cooldown-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.cooldown-label b { color: var(--blue-dark); }
.cooldown-track { height: 8px; background: #e8edf6; border-radius: 99px; overflow: hidden; }
.cooldown-track div { height: 100%; width: 100%; background: linear-gradient(90deg, #76a6ff, #67dcb2); border-radius: inherit; transition: width .1s linear; }
.stats-row { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.stats-row > div { background: #fff; border: 1px solid var(--border); border-radius: 13px; padding: 10px 14px; min-width: 105px; }
.stats-row small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.stats-row b { font-size: 14px; }
.footer-note { text-align: center; color: #9aa7ba; font-size: 11px; padding-top: 12px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(26, 39, 61, .42); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 18px; z-index: 20; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(640px, 100%); max-height: min(82vh, 760px); overflow: auto; background: white; border: 1px solid rgba(255,255,255,.7); border-radius: 24px; box-shadow: 0 25px 90px rgba(20,37,70,.25); animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 24px 17px; border-bottom: 1px solid var(--border); }
.modal-kicker { font-size: 10px; letter-spacing: 2px; color: var(--blue); direction: ltr; display: block; }
.modal-header h2 { margin: 5px 0 0; font-size: 22px; }
.close-button { border: 0; background: #f0f4fa; color: #52627a; width: 38px; height: 38px; border-radius: 12px; font-size: 28px; line-height: 1; }
.modal-content { padding: 20px 24px 24px; }
.section-label { color: #71819b; font-size: 12px; font-weight: 700; margin: 0 0 12px; }
.upgrade-list { display: flex; flex-direction: column; gap: 10px; }
.upgrade-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: #fbfcff; }
.upgrade-card.locked { opacity: .58; background: #f5f7fb; }
.upgrade-card.owned { border-color: #b9efd7; background: #f0fff7; }
.upgrade-card h3 { font-size: 14px; margin: 0 0 5px; }
.upgrade-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.price { display: block; font-size: 12px; font-weight: 700; margin-top: 7px; color: #98701a; }
.buy-button, .sell-button { border: 0; border-radius: 11px; padding: 10px 14px; color: white; background: var(--blue); font-size: 12px; font-weight: 700; min-width: 88px; transition: background .15s, transform .15s; }
.buy-button:hover:not(:disabled), .sell-button:hover:not(:disabled) { background: var(--blue-dark); transform: translateY(-1px); }
.buy-button:disabled, .sell-button:disabled { cursor: not-allowed; opacity: .45; }
.sell-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.sell-option { border: 1px solid var(--border); background: #fbfcff; border-radius: 16px; padding: 17px 10px; text-align: center; }
.sell-option img { width: 48px; height: 48px; object-fit: contain; margin-bottom: 9px; }
.sell-option h3 { margin: 0 0 6px; font-size: 13px; }
.sell-option p { margin: 0 0 13px; color: var(--muted); font-size: 12px; }
.sell-option .sell-button { width: 100%; min-width: 0; }
.modal-note { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 14px 0 0; }
.toast-stack { position: fixed; bottom: 22px; left: 22px; z-index: 40; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: #24324a; color: white; border-radius: 12px; padding: 12px 16px; font-size: 13px; box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast.good { background: #16875d; }
.toast.bad { background: #a64b55; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#customCursor { position: fixed; top: 0; left: 0; width: 54px; height: 54px; pointer-events: none; z-index: 1000; transform: translate(-12px, -10px); display: none; }
#customCursor img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
body.cursor-ready #customCursor { display: block; }
body.cursor-ready, body.cursor-ready * { cursor: none !important; }
#customCursor.swing { animation: pick-swing .19s ease-in-out; transform-origin: 20% 80%; }
@keyframes pick-swing { 0% { rotate: 0deg; } 45% { rotate: -28deg; translate: -3px 3px; } 100% { rotate: 0deg; translate: 0 0; } }
@media (max-width: 700px) {
  .app-shell { padding-top: 14px; }
  .topbar { align-items: flex-start; }
  .brand strong { font-size: 16px; }
  .wallet { width: 100%; display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
  .wallet-item { min-width: 0; padding: 8px; gap: 5px; justify-content: center; }
  .wallet-icon { font-size: 17px; }
  .wallet-item small { font-size: 10px; }
  .game-layout { grid-template-columns: 1fr; gap: 16px; padding-top: 20px; }
  .mine-area { grid-row: 1; }
  .side-tools { flex-direction: row; justify-content: center; }
  .left-tools { grid-row: 2; }
  .right-tools { grid-row: 3; }
  .tool-card { flex: 1; max-width: 150px; min-height: 82px; flex-direction: row; }
  .tool-card img { width: 34px; height: 34px; }
  .mine-button { width: min(300px, 70vw); margin-top: 17px; }
  .stats-row { margin-top: 16px; gap: 6px; }
  .stats-row > div { min-width: 0; flex: 1; padding: 9px 7px; }
  .stats-row small { font-size: 9px; }
  .sell-grid { grid-template-columns: 1fr; }
  .sell-option { display: grid; grid-template-columns: 45px minmax(0,1fr) auto; align-items: center; gap: 10px; text-align: right; padding: 10px; }
  .sell-option img { width: 40px; height: 40px; margin: 0; }
  .sell-option p { margin: 4px 0 0; }
  .sell-option .sell-button { width: auto; min-width: 80px; }
  .modal-header { padding: 18px; }
  .modal-content { padding: 16px; }
  .upgrade-card { padding: 11px; }
  #customCursor { display: none !important; }
  html, body, button { cursor: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
