/* Mökkimaa — idle-peli */
.mm-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  justify-content: center;
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.mm-res-item strong {
  font-variant-numeric: tabular-nums;
}

/* Hover-vihjeet ikoneille ja napeille */
[data-tip] {
  position: relative;
  cursor: help;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  min-width: 9rem;
  max-width: 16rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  color: #f4f4f4;
  background: rgba(18, 22, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 50;
  white-space: normal;
}
[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.mm-has-tip[data-tip]::after {
  bottom: calc(100% + 6px);
}
.mm-plot[data-tip]::after,
.mm-crop-btn[data-tip]::after {
  max-width: 14rem;
  z-index: 60;
}
.mm-building-emoji[data-tip]::after,
.mm-trader-emoji[data-tip]::after,
.mm-exp-emoji[data-tip]::after {
  bottom: auto;
  top: calc(100% + 6px);
  transform: translateX(-50%) translateY(-4px);
}
.mm-building-emoji[data-tip]:hover::after,
.mm-trader-emoji[data-tip]:hover::after,
.mm-exp-emoji[data-tip]:hover::after {
  transform: translateX(-50%) translateY(0);
}
.mm-hero-scene [data-tip]::after {
  font-size: 0.68rem;
  max-width: 11rem;
}
.mm-tab[data-tip]::after {
  bottom: auto;
  top: calc(100% + 6px);
  transform: translateX(-50%) translateY(-4px);
}
.mm-tab[data-tip]:hover::after,
.mm-tab[data-tip]:focus-visible::after {
  transform: translateX(-50%) translateY(0);
}

.mm-banner {
  text-align: center;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.mm-banner.offline {
  border-color: var(--accent);
  background: rgba(74, 158, 255, 0.08);
}
.mm-banner.err {
  border-color: #c44;
}
.mm-next-goal {
  text-align: center;
  padding: 0.55rem 0.85rem;
  margin: -0.35rem 0 1rem;
  border-radius: 10px;
  border: 1px dashed rgba(74, 158, 255, 0.55);
  background: rgba(74, 158, 255, 0.08);
  font-size: 0.86rem;
  line-height: 1.4;
}
.mm-next-goal.hidden {
  display: none !important;
}
.mm-next-goal-label {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  margin-right: 0.35rem;
}
.mm-next-goal-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  opacity: 0.9;
}
.mm-buff-row {
  margin: -0.5rem 0 1rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 140, 60, 0.12);
  border: 1px solid rgba(255, 140, 60, 0.35);
  color: #ffb86c;
  text-align: center;
  font-size: 0.85rem;
}
.mm-buff-row.hidden {
  display: none !important;
}
.mm-sauna-active {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: #ffb86c;
  font-weight: 600;
}
.mm-hero-scene {
  position: relative;
  height: 5.5rem;
  background: linear-gradient(180deg, #87ceeb 0%, #98d98e 55%, #6b8e4e 100%);
  border-radius: 14px;
  border: 2px solid #4a6741;
  margin-bottom: 0.35rem;
  overflow: hidden;
}
.mm-cottage {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.8rem;
}
.mm-farmer {
  position: absolute;
  bottom: 0.4rem;
  left: 28%;
  font-size: 1.8rem;
}
.mm-bees {
  position: absolute;
  top: 1rem;
  right: 22%;
  font-size: 1.2rem;
  animation: mm-float 2s ease-in-out infinite;
}
.mm-dock {
  position: absolute;
  bottom: 0.3rem;
  right: 12%;
  font-size: 1.5rem;
}
.mm-garden {
  position: absolute;
  bottom: 0.35rem;
  right: 31%;
  font-size: 1.25rem;
}
.mm-woodshed {
  position: absolute;
  bottom: 0.3rem;
  left: 42%;
  font-size: 1.25rem;
}
.mm-compost {
  position: absolute;
  bottom: 0.3rem;
  right: 42%;
  font-size: 1.2rem;
}
.mm-cows {
  position: absolute;
  bottom: 0.35rem;
  left: 12%;
  font-size: 1.4rem;
}
.mm-trader-wrap {
  margin-bottom: 1rem;
}
.mm-trader {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 2px dashed #c9a227;
  background: rgba(201, 162, 39, 0.1);
}
.mm-trader.used {
  opacity: 0.65;
  border-style: solid;
}
.mm-trader-emoji {
  font-size: 2rem;
}
.mm-trader p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.mm-trader-passive,
.mm-trader-done {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.mm-auto {
  border-color: rgba(74, 158, 255, 0.35);
}
.mm-maxed {
  font-size: 0.78rem;
  color: #5a8f4a;
  font-weight: 600;
}
@keyframes mm-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
.mm-hero-caption {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 1rem;
}
.mm-daily-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.mm-daily-quest {
  flex: 1 1 100%;
  text-align: center;
  font-size: 0.88rem;
  padding: 0.5rem;
  background: var(--surface2);
  border-radius: 8px;
}
.mm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
  justify-content: center;
}
.mm-tab {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
}
.mm-tab.active {
  border-color: var(--accent);
  background: rgba(74, 158, 255, 0.12);
}
/* Välilehdet pinotaan samaan ruudukkosoluun — korkeus = suurin paneeli, ei pomppimista */
.mm-tab-stage {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  margin-bottom: 0.5rem;
}
.mm-tab-stage > .mm-tab-panel {
  grid-area: 1 / 1;
  min-width: 0;
}
.mm-tab-panel:not(.mm-tab-panel--active) {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}
.mm-farm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  max-width: 22rem;
  margin: 0 auto 1rem;
}
.mm-plot {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.35rem;
  border-radius: 12px;
  border: 2px solid #5a8f4a;
  background: linear-gradient(145deg, #7cb86a, #5a9448);
  color: #fff;
  cursor: pointer;
  font-size: 0.72rem;
  position: relative;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
}
.mm-plot:hover {
  filter: brightness(1.06);
}
.mm-plot-empty {
  border-style: dashed;
  opacity: 0.92;
}
.mm-plot-ready {
  border-color: #ffd54f;
  box-shadow: 0 0 12px rgba(255, 213, 79, 0.55);
  animation: mm-pulse 1.2s ease infinite;
}
@keyframes mm-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}
.mm-plot-locked {
  background: linear-gradient(145deg, #888, #666);
  border-color: #555;
}
.mm-plot-emoji {
  font-size: 1.75rem;
  line-height: 1;
}
.mm-plot-bar {
  position: absolute;
  bottom: 4px;
  left: 6px;
  right: 6px;
  height: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 2px;
  overflow: hidden;
}
.mm-plot-bar div {
  height: 100%;
  background: #fff59d;
  border-radius: 2px;
}
.mm-plot-tag {
  font-weight: 700;
  font-size: 0.65rem;
  background: #ffd54f;
  color: #333;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.mm-crop-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-bottom: 1rem;
}
.mm-material-shop {
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem;
  border: 2px solid rgba(74, 158, 255, 0.45);
  border-radius: 12px;
  background: rgba(74, 158, 255, 0.06);
}
.mm-material-shop .kp-hand-label {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: 0.82rem;
}
.mm-material-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.mm-material-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  text-align: left;
  min-width: 9rem;
}
.mm-material-btn:hover {
  border-color: var(--accent);
}
.mm-material-btn small {
  display: block;
  opacity: 0.85;
  font-size: 0.72rem;
}
.mm-material-emoji {
  font-size: 1.4rem;
  line-height: 1;
}
.mm-forage-wrap,
.mm-fishing-wrap {
  margin: 0 auto 1rem;
  max-width: 24rem;
}
.mm-forage,
.mm-fishing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 2px solid rgba(74, 158, 255, 0.4);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.1), rgba(90, 143, 74, 0.08));
}
.mm-forage {
  border-color: rgba(106, 168, 79, 0.45);
  background: linear-gradient(135deg, rgba(106, 168, 79, 0.13), rgba(126, 87, 194, 0.08));
}
.mm-forage.used,
.mm-fishing.used {
  border-color: rgba(90, 143, 74, 0.45);
  background: rgba(90, 143, 74, 0.08);
}
.mm-forage p,
.mm-fishing p {
  margin: 0.15rem 0 0;
}
.mm-forage-result,
.mm-fishing-result {
  font-size: 0.84rem;
  font-weight: 700;
  color: #8fd694;
}
.mm-neighbor-wrap {
  margin-bottom: 1rem;
}
.mm-neighbor {
  padding: 0.75rem 0.85rem;
  border: 2px solid rgba(106, 168, 79, 0.45);
  border-radius: 12px;
  background: rgba(106, 168, 79, 0.07);
}
.mm-neighbor-head {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.mm-neighbor-emoji {
  font-size: 1.8rem;
  line-height: 1;
}
.mm-neighbor-done {
  font-size: 0.85rem;
  font-weight: 600;
  color: #8fd694;
  margin: 0.35rem 0;
}
.mm-neighbor-offline {
  margin: 0.25rem 0 0.4rem;
  font-size: 0.78rem;
}
.mm-neighbor-recent {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.75rem;
  opacity: 0.85;
}
.mm-neighbor-meta {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
}
.mm-stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.mm-stats-summary div {
  text-align: center;
  padding: 0.55rem 0.4rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.mm-stats-summary strong {
  display: block;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.mm-stats-summary span {
  font-size: 0.72rem;
  opacity: 0.85;
}
.mm-achievement {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  opacity: 0.75;
}
.mm-achievement.unlocked {
  opacity: 1;
  border-color: rgba(255, 213, 79, 0.45);
  background: rgba(255, 213, 79, 0.08);
}
.mm-achievement-emoji {
  font-size: 1.6rem;
  line-height: 1;
}
.mm-achievement-body {
  flex: 1;
  min-width: 0;
}
.mm-achievement-body p {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.8rem;
  opacity: 0.9;
}
.mm-achievement-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 0.2rem;
}
.mm-achievement-bar div {
  height: 100%;
  background: var(--accent);
}
.mm-achievement-done {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffd54f;
}
.mm-achievement-reward {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: #8fd694;
}
.mm-crop-btn {
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  font-size: 0.82rem;
  touch-action: manipulation;
}
.mm-crop-btn.selected {
  border-color: var(--accent);
  background: rgba(74, 158, 255, 0.15);
}
.mm-crop-btn small {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
}
.mm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}
.mm-barn-storage {
  margin: 0.75rem 0 0;
}
.mm-barn-box {
  padding: 0.7rem 0.85rem;
  border: 2px solid rgba(160, 120, 60, 0.4);
  border-radius: 12px;
  background: rgba(160, 120, 60, 0.08);
}
.mm-barn-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.mm-barn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}
.mm-barn-stock {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.mm-building {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  margin-bottom: 0.5rem;
}
.mm-building-head {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}
.mm-building-emoji {
  font-size: 1.75rem;
}
.mm-building-desc {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.mm-lvl {
  font-size: 0.75rem;
  color: var(--muted);
}
.mm-expansion {
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
}
.mm-expansion.unlocked {
  border-style: solid;
  border-color: #5a8f4a;
  background: rgba(90, 143, 74, 0.08);
}
.mm-exp-progress {
  margin: 0.35rem 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.mm-exp-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}
.mm-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.65rem 1.1rem;
  background: #1a2332;
  color: #fff;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  max-width: min(92vw, 24rem);
  text-align: center;
}
.mm-toast.ok {
  background: #2d6a4f;
}
.mm-toast.expansion {
  background: #5c4d9a;
}
.mm-toast.err {
  background: #8b2635;
}
.mm-toast.hidden {
  display: none;
}
.btn-sm {
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
}
.mm-save-panel {
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
}
.mm-save-panel textarea {
  width: 100%;
  min-height: 4rem;
  font-family: monospace;
  font-size: 0.75rem;
  margin: 0.5rem 0;
}
@media (max-width: 400px) {
  .mm-farm-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
