@import url("https://fonts.googleapis.com/css2?family=Geom:ital,wght@0,300..900;1,300..900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap");

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

:root {
  /* Brand palette derived from #d08f00 */
  --brand:        #d08f00;
  --brand-dark:   #a87000;
  --brand-deeper: #7a5000;
  --brand-light:  #e8b84b;
  --brand-pale:   #f5d98a;
  --brand-xpale:  #fdf3d6;

  /* Light theme backgrounds */
  --bg:           #fdf8ef;
  --bg2:          #f7efdb;
  --surface:      #ffffff;
  --card:         #fffbf0;
  --border:       rgba(208, 143, 0, 0.18);
  --border-strong: rgba(208, 143, 0, 0.38);

  /* Text */
  --text:         #2a1f00;
  --text-sec:     #6b4e00;
  --muted:        #a07830;

  /* Status */
  --red:          #c0392b;
  --green:        #27ae60;

  /* Fonts — Geo is the closest Google Font to "Geom" */
  --ft: "Geom",  sans-serif;
  --fb: "Geom", sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--fb);
  color: var(--text);
  touch-action: none;
}

/* ────────────────────────────────────────
   LOAD SCREEN
──────────────────────────────────────── */
#loadScreen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.6s ease;
}

#loadScreen.fade {
  opacity: 0;
  pointer-events: none;
}

.load-coin {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden; 
  animation: loadBounce 1.2s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center; 
  box-shadow: 0 8px 32px rgba(208, 143, 0, 0.25);
}

.load-coin img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

@keyframes loadBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-14px) scale(1.06); }
}

.load-title {
  font-family: var(--ft);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--brand);
}

.load-bar-wrap {
  width: 180px;
  height: 4px;
  background: rgba(208, 143, 0, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.load-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand-light));
  border-radius: 2px;
  animation: loadProg 1.5s ease-out forwards;
}

@keyframes loadProg { to { width: 100%; } }

.load-sub {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--muted);
  text-transform: uppercase;
  font-family: var(--ft);
}

/* ────────────────────────────────────────
   APP SHELL
──────────────────────────────────────── */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

/* Remove bg canvas and star layer — no shooting stars */
#bgCanvas { display: none; }
#starLayer { display: none; }

/* Subtle warm gradient texture */
#app::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%,  rgba(208,143,0,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 60% 30% at 80% 80%, rgba(168,112,0,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ────────────────────────────────────────
   HEADER
──────────────────────────────────────── */
#header {
     position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 40px 16px 10px;
    background: rgba(253, 248, 239, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

#backBtn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(208, 143, 0, 0.08);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

#backBtn:active {
  transform: scale(0.88);
  background: rgba(208, 143, 0, 0.18);
}

#backBtn svg {
  width: 18px;
  height: 18px;
  stroke: var(--brand);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#headerTitle {
  font-family: var(--ft);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--brand);
}

.hdr-r { width: 38px; }

/* ────────────────────────────────────────
   BALANCE CARDS
──────────────────────────────────────── */
#balanceBar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px 10px;
}

.bal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 14px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(208, 143, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.bal-card::after {
     content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 11px;
    background: linear-gradient(90deg, var(--brand-dark), var(--brand-light));
    border-radius: 16px 16px 0 0;
}

.bal-label {
      font-size: 9px;
    letter-spacing: 1px;
    color: var(--muted);
    text-transform: uppercase;
    font-family: var(--ft);
    margin-bottom: 7px;
}

.bal-value {
      font-family: var(--ft);
    font-size: 16px;
    font-weight: 900;
    color: var(--brand-deeper);
    margin-bottom: 4px;
}

.bal-unit {
  font-size: 10px;
  color: var(--brand);
  margin-left: 2px;
  font-weight: 600;
}

/* ────────────────────────────────────────
   TIMER ROW — big ring with counter inside
──────────────────────────────────────── */
#timerRow {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 4px 0 8px;
}

#timerRing {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

#timerRing svg {
  width: 88px;
  height: 88px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(208, 143, 0, 0.12);
  stroke-width: 7;
}

.ring-prog {
  fill: none;
  stroke: var(--brand);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 163.36;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.35s linear, stroke 0.4s; 
}

#timerInner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ft);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

#phaseInfo {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#phaseLbl {
  font-family: var(--ft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--brand);
  text-transform: uppercase;
}

#phaseDesc {
  font-size: 12px;
  color: var(--muted);
}

/* Progress bar — removed */
#progressSection { display: none; }

/* ────────────────────────────────────────
   COIN AREA
──────────────────────────────────────── */
#coinArea {
       position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-top-left-radius: 85px;
    border-top-right-radius: 85px;
   background: linear-gradient(
    180deg,
    #fffaf0 0%,
    #f8ecd2 45%,
    #e8c16a 100%
);
}

#coinWrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(208, 143, 0, 0.14);
  pointer-events: none;
  animation: orbitSpin var(--spd, 10s) linear infinite;
}

@keyframes orbitSpin { to { transform: rotate(360deg); } }

.orbit-dot {
  position: absolute;
  border-radius: 50%;
  top: -3px;
  left: calc(50% - 3px);
  width: 6px;
  height: 6px;
}
 

@keyframes glowPulse {
  0%, 100% { transform: scale(1);    opacity: 0.7; }
  50%       { transform: scale(1.12); opacity: 1;   }
}

#coin {
       width: 184px;
    position: relative;
    cursor: pointer;
    transition: transform 0.07s ease, box-shadow 0.07s;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0px 18px 16px rgba(67, 67, 67, 0.445));
}

#coin.pressed {
  transform: scale(0.91); 
}

#coin.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.7);
  pointer-events: none;
}

#coinImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: absolute;
  inset: 0;
  display: none;
  z-index: 1;
}

#coinFace {
  font-size: 82px;
  line-height: 1;
  pointer-events: none; 
  position: relative;
  z-index: 1;
}

#coinFace img { width: 100%; }

 

/* ────────────────────────────────────────
   FLOAT TEXT & PARTICLES
──────────────────────────────────────── */
.floatText {
  position: fixed;
  pointer-events: none;
  font-family: var(--ft);
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
  z-index: 500;
  animation: floatUp 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1.1); }
  100% { opacity: 0; transform: translateY(-72px) scale(0.7); }
}

.tap-particle {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  z-index: 499;
  animation: partOut 0.55s ease-out forwards;
}

@keyframes partOut {
  0%   { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

.tap-ripple {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  z-index: 498;
  border: 2px solid rgba(208, 143, 0, 0.55);
  animation: rippleOut 0.5s ease-out forwards;
}

@keyframes rippleOut {
  from { width:16px; height:16px; opacity:0.9; margin-left:-8px;  margin-top:-8px; }
  to   { width:88px; height:88px; opacity:0;   margin-left:-44px; margin-top:-44px; }
}

/* ────────────────────────────────────────
   BOTTOM SHEET (replaces center modal)
──────────────────────────────────────── */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(42, 31, 0, 0.38);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

#overlay.show {
  display: flex;
  animation: overlayIn 0.25s ease forwards;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#modal {
    background: var(--surface);
    border-radius: 44px 44px 0 0;
    padding: 0px 24px 40px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: sheetUp 0.38s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* Drag handle pill */
#modal::before {
     content: "";
    display: block;
    width: 80px;
    height: 4px;
    background: rgba(208, 143, 0, 0.22);
    border-radius: 2px;
    margin: 14px auto 20px;
}
 
.m-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

.m-title {
  font-family: var(--ft);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: var(--text);
}

.m-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 14px;
  white-space: pre-line;
}

.m-reward {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 22px;
  font-family: var(--ft);
  font-size: 32px;
  font-weight: 900;
  color: var(--brand);
}

.m-reward .unit {
  font-size: 13px;
  color: var(--brand-dark);
  font-weight: 600;
  align-self: flex-end;
  margin-bottom: 5px;
}

/* Ad progress bar — keep hidden, unused */
#adProgress { display: none; }

/* ── AD BANNER inside sheet ── */
#adBanner {
  display: none;
  width: 100%;
  min-height: 90px;
  background: var(--bg2);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  margin: 6px 0 18px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  font-family: var(--ft);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}

#adBanner.visible { display: flex; }

/* ────────────────────────────────────────
   BUTTONS
──────────────────────────────────────── */
.btn {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: none;
  font-family: var(--ft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 10px;
  display: block;
  position: relative;
}

.btn:last-child { margin-bottom: 0; }
.btn:active:not(:disabled) { transform: scale(0.96); }

.btn:disabled,
.btn.btn-locked {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.5);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-light));
  color: #fff;
  box-shadow: 0 4px 20px rgba(208, 143, 0, 0.32);
}

.btn-secondary {
  background: rgba(208, 143, 0, 0.07);
  color: var(--brand-dark);
  border: 1px solid var(--border-strong);
}

.btn-danger {
  background: rgba(192, 57, 43, 0.07);
  color: var(--red);
  border: 1px solid rgba(192, 57, 43, 0.22);
}

.btn-gold {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 4px 20px rgba(208, 143, 0, 0.38);
}

.btn-lock-badge {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.7;
  letter-spacing: 1px;
}

/* ────────────────────────────────────────
   TOAST
──────────────────────────────────────── */
#toast {
  position: fixed;
  top: 78px;
  left: 50%;
  z-index: 300;
  transform: translateX(-50%) translateY(-16px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 30px;
  padding: 10px 20px;
  font-family: var(--ft);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--brand-dark);
  white-space: nowrap;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(208,143,0,0.15);
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}