@font-face {
  font-family: "GoldMiner";
  src: url("/assets/goldminer/Kurland.ttf") format("truetype");
  font-display: swap;
}

body:has(.arcade-shell.is-gold-miner),
.arcade-shell.is-gold-miner,
.is-gold-miner button {
  font-family: "GoldMiner", "PingFang SC", sans-serif;
}

body:has(.arcade-shell.is-gold-miner) {
  background: #100600;
}

.arcade-shell.is-gold-miner {
  width: min(100%, 680px);
  background:
    linear-gradient(rgba(38, 12, 1, .82), rgba(14, 5, 0, .95)),
    url("/assets/goldminer/bg_level_A.png") center / cover fixed;
}

.is-gold-miner .arcade-nav {
  min-height: 54px;
  padding: 6px 8px;
  border: 3px solid #d78717;
  border-radius: 8px;
  background: linear-gradient(#9a4b08, #572000);
  box-shadow: inset 0 2px #ffc34a, 0 5px #250b00;
}

.is-gold-miner .arcade-nav strong {
  color: #fff1af;
  text-shadow: 2px 2px #4b1700;
}

.is-gold-miner .arcade-nav small {
  color: #ffd55d;
}

.is-gold-miner .arcade-nav .round-button {
  border: 2px solid #e99a22;
  border-radius: 6px;
  background: #6c2804;
  box-shadow: inset 0 1px #ffc95b;
}

.is-gold-miner .game-stage {
  width: 100%;
  max-height: none;
  aspect-ratio: 4 / 3;
  margin-top: 14px;
  border: 5px solid #bc650d;
  border-radius: 8px;
  background: #9a500b;
  box-shadow: inset 0 0 0 2px #ffd04a, 0 8px 0 #260a00;
}

.is-gold-miner .gold-miner-menu {
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(38, 11, 0, .94), rgba(38, 11, 0, .34)),
    url("/assets/goldminer/bg_start_menu.png?v=hd1") 100% 100% / auto 92% no-repeat,
    #160800;
}

.is-gold-miner .gold-miner-menu::after {
  display: none;
}

.is-gold-miner .miner-menu-hero {
  align-items: flex-start;
  width: 100%;
  padding: 16px;
  border: 4px solid #bd650c;
  border-radius: 8px;
  background: rgba(83, 27, 1, .88);
  box-shadow: inset 0 2px #f4aa2e, 0 5px #240a00;
  text-align: left;
}

.miner-menu-logo {
  width: min(66%, 230px);
}

.is-gold-miner .miner-menu-hero h1 {
  margin: 14px 0 6px;
  color: #ffd543;
  font-size: 28px;
  text-shadow: 3px 3px #611e00;
}

.is-gold-miner .miner-menu-hero p {
  max-width: 58%;
  color: #fff1b4;
}

.is-gold-miner .miner-mode-actions {
  width: 100%;
}

.is-gold-miner .miner-mode-actions button {
  min-height: 70px;
  border: 3px solid #9d4405;
  border-radius: 7px;
  color: #fff1b4;
  background: linear-gradient(#923e05, #5b2000);
  box-shadow: inset 0 2px #e99a22, 0 4px #270b00;
  backdrop-filter: none;
}

.is-gold-miner .miner-mode-actions button > span,
.is-gold-miner .miner-mode-actions button > small {
  color: #ffd64c;
}

.is-gold-miner .gold-miner-hud {
  top: 7px;
  min-height: 58px;
  padding: 7px 12px;
  border: 4px solid #bc650d;
  border-radius: 7px;
  background: #773000 url("/assets/goldminer/panel.png?v=hd1") center / 100% 100% no-repeat;
  box-shadow: inset 0 1px #ffd04a, 0 4px #270b00;
  backdrop-filter: none;
}

.is-gold-miner .gold-miner-hud span,
.is-gold-miner .gold-miner-hud small {
  color: #ffe69a;
}

.is-gold-miner .gold-miner-hud strong,
.is-gold-miner .gold-miner-hud small b {
  color: #fff46b;
  text-shadow: 2px 2px #6e2200;
}

.is-gold-miner .stage-message {
  background: rgba(39, 10, 0, .76);
  backdrop-filter: blur(3px);
}

.is-gold-miner .stage-symbol {
  border: 3px solid #a94b05;
  border-radius: 7px;
  background: linear-gradient(#ffd94d, #e88b13);
  box-shadow: inset 0 2px #fff2a1, 0 5px #411100;
}

.is-gold-miner .stage-message h1 {
  color: #ffd74b;
  text-shadow: 3px 3px #5b1d00;
}

.is-gold-miner .stage-message button,
.is-gold-miner .stage-message .stage-menu-button {
  border: 3px solid #9d4405;
  border-radius: 7px;
  color: #4b1700;
  background: linear-gradient(#ffd951, #e58a13);
  box-shadow: inset 0 2px #fff1a2, 0 4px #491500;
}

.is-gold-miner .game-tip {
  color: #efc66f;
}

@media (max-width: 430px) {
  .arcade-shell.is-gold-miner {
    padding-inline: 8px;
  }

  .is-gold-miner .gold-miner-menu {
    padding: 10px;
  }

  .is-gold-miner .miner-menu-hero {
    padding: 12px;
  }

  .is-gold-miner .miner-mode-actions {
    gap: 7px;
  }

  .is-gold-miner .miner-mode-actions button {
    min-height: 62px;
    padding: 8px;
  }

  .is-gold-miner .gold-miner-hud {
    grid-template-columns: 1fr 70px 1fr;
    min-height: 52px;
    padding: 5px 8px;
    border-width: 3px;
  }

  .is-gold-miner .gold-miner-hud strong {
    font-size: 18px;
  }

  .is-gold-miner .gold-miner-hud .miner-hud-title > strong {
    font-size: 11px;
  }
}

/* The original assets are 4:3, but locking the whole game to that ratio leaves
   most of a portrait phone unused. Keep 4:3 on wide screens and let the mobile
   mine occupy the viewport below the navigation bar. */
@media (max-width: 559px) and (orientation: portrait) {
  .is-gold-miner .game-stage {
    height: calc(100dvh - 122px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: none;
    aspect-ratio: auto;
  }
}

/* Entry loading screen: preloads gold miner sprites with a real progress bar,
   then shows a spinner while the real campaign level progress is fetched. */
.is-gold-miner .gold-miner-loader {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: rgba(20, 6, 0, .82);
  backdrop-filter: blur(3px);
}

.is-gold-miner .loader-card {
  width: min(82%, 320px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 26px 22px;
  border: 4px solid #bd650c;
  border-radius: 10px;
  background: linear-gradient(#8c3b05, #592000);
  box-shadow: inset 0 2px #f4aa2e, 0 8px #270b00;
}

.is-gold-miner .loader-bar {
  width: 100%;
  height: 12px;
  border: 2px solid #321000;
  border-radius: 7px;
  background: #2c1000;
  overflow: hidden;
}

.is-gold-miner .loader-bar > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(#ffd951, #e58a13);
  box-shadow: inset 0 1px #fff1a2;
  transition: width .15s ease;
}

.is-gold-miner .loader-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(255, 213, 75, .25);
  border-top-color: #ffd543;
  border-radius: 50%;
  animation: miner-loader-spin .8s linear infinite;
}

@keyframes miner-loader-spin {
  to { transform: rotate(360deg); }
}

.is-gold-miner .loader-label {
  margin: 0;
  color: #fff1b4;
  font-size: 14px;
  text-align: center;
}
