/* =========================================================
   The Phonograph's Whisper - Game-Specific Styles
   Sumi-e Idle Mystery
   ========================================================= */

/* --- Container --- */
#game-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
}

/* --- Header --- */
#header {
  margin-bottom: 24px;
}

/* --- Phonograph Click Area --- */
#phonograph-area {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto 24px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#phonograph-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#click-feedback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* --- Counter --- */
#counter {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#counter-label {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.2rem;
  color: var(--ink-wash);
}

#whisper-seal {
  width: 80px;
  height: 80px;
  font-size: 1.1rem;
}

#wps {
  font-size: 0.9rem;
  color: var(--ink-wash);
}

/* --- Upgrades Panel --- */
#upgrades {
  margin-top: 32px;
  text-align: left;
  border-top: 1px solid var(--water);
  padding-top: 16px;
}

.upgrade-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--ink-wash);
  margin-bottom: 10px;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  background: var(--paper);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.upgrade-card:hover {
  background: rgba(26, 26, 46, 0.05);
}

.upgrade-card.affordable {
  border-color: var(--ink);
}

.upgrade-card.unaffordable {
  opacity: 0.5;
  cursor: default;
  border-style: dashed;
}

.upgrade-card.unaffordable:hover {
  background: var(--paper);
}

.upgrade-info {
  flex: 1;
}

.upgrade-name {
  font-family: 'Noto Serif JP', serif;
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}

.upgrade-desc {
  font-size: 0.8rem;
  color: var(--ink-wash);
  margin-top: 2px;
}

.upgrade-stats {
  font-size: 0.75rem;
  color: var(--ink-wash);
}

.upgrade-cost {
  text-align: right;
  white-space: nowrap;
  margin-left: 16px;
}

.upgrade-cost .cost-value {
  font-family: 'Noto Serif JP', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--vermillion);
}

.upgrade-cost .owned {
  font-size: 0.75rem;
  color: var(--ink-wash);
}

/* --- Story Panel --- */
#story {
  margin-top: 32px;
  text-align: left;
  border-top: 1px solid var(--water);
  padding-top: 16px;
}

.story-entry {
  padding: 16px 0;
  border-bottom: 1px solid var(--water);
  animation: brush-write 1.5s ease-out;
}

.story-entry .milestone {
  font-size: 0.8rem;
  color: var(--vermillion);
  font-weight: 700;
  margin-bottom: 4px;
}

.story-entry .text {
  font-family: 'Noto Serif JP', serif;
  line-height: 1.8;
  color: var(--ink);
}

/* --- Click Feedback Floating Text --- */
.click-float {
  position: absolute;
  pointer-events: none;
  font-family: 'Noto Serif JP', serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--vermillion);
  animation: float-up 1s ease-out forwards;
  z-index: 10;
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px);
  }
}

/* --- Phonograph Pulse --- */
.phonograph-pulse {
  animation: pulse-scale 0.15s ease-out;
}

@keyframes pulse-scale {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

/* --- Offline Earnings Message --- */
#offline-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 24px 32px;
  text-align: center;
  z-index: 200;
  max-width: 320px;
  animation: ink-spread 0.5s ease-out;
}

#offline-message .title {
  font-family: 'Noto Serif JP', serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 8px;
}

#offline-message .amount {
  font-family: 'Noto Serif JP', serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--vermillion);
  margin-bottom: 16px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  #game-container {
    padding: 16px 12px;
  }

  #phonograph-area {
    width: 220px;
    height: 220px;
  }

  .upgrade-card {
    padding: 10px 12px;
  }

  .upgrade-name {
    font-size: 0.9rem;
  }

  .upgrade-desc {
    font-size: 0.75rem;
  }

  .upgrade-cost .cost-value {
    font-size: 1rem;
  }

  #whisper-seal {
    width: 70px;
    height: 70px;
    font-size: 1rem;
  }
}
