* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans', sans-serif;
  background: #1a1a1a;
  color: #fff;
  overflow: hidden;
  height: 100vh;
  touch-action: manipulation;
  padding: 8px;
}

#app {
  height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  position: relative;
  border: 6px solid #fff;
  border-radius: 16px;
  box-shadow: 0 0 0 3px #000, 0 0 0 9px #fff, 0 8px 24px rgba(0, 0, 0, 0.6);
  background: #000;
  overflow: hidden;
}

.top-bar {
  display: flex;
  justify-content: space-around;
  padding: 12px 8px;
  background: #222;
  border-bottom: 4px solid #fff;
  flex-wrap: wrap;
  gap: 8px;
}

.stat {
  font-size: 16px;
  font-weight: bold;
  white-space: nowrap;
  text-shadow: 2px 2px 0 #000;
}

.badge-count {
  color: #ffd700;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

#log {
  margin-bottom: 20px;
  padding: 12px;
  background: #0a0a0a;
  border-radius: 12px;
  border: 3px solid #333;
  max-height: 150px;
  overflow-y: auto;
  box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.1);
}

.log-entry {
  padding: 8px;
  margin-bottom: 6px;
  background: #1a1a1a;
  border-radius: 6px;
  border: 2px solid #333;
  font-size: 14px;
  animation: slideIn 0.3s;
  box-shadow: 2px 2px 0 rgba(255, 255, 255, 0.05);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.log-entry.success {
  border-left: 4px solid #4caf50;
  background: #0a1a0a;
}

.log-entry.info {
  border-left: 4px solid #2196f3;
  background: #0a0a1a;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #111;
  border: 5px solid #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 0 0 2px #000, 0 0 0 7px #fff, 0 8px 32px rgba(0, 0, 0, 0.8);
}

.modal-content h2 {
  margin-bottom: 20px;
  text-align: center;
  text-shadow: 3px 3px 0 #000;
}

#achievement-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.achievement-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #1a1a1a;
  border-radius: 10px;
  border: 3px solid #333;
  box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.1);
}

.achievement-item.unlocked {
  border-color: #ffd700;
  background: #1a1a0a;
  box-shadow: 3px 3px 0 rgba(255, 215, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.2);
}

.achievement-item.locked {
  opacity: 0.6;
}

.achievement-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.achievement-info {
  flex: 1;
}

.achievement-name {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 4px;
}

.achievement-desc {
  font-size: 13px;
  color: #888;
}

.modal-close {
  width: 100%;
  padding: 12px;
  background: #333;
  border: 3px solid #555;
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

.modal-close:active {
  background: #444;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.badge-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  animation: badgeSlideIn 0.4s ease-out;
}

.badge-notification.hidden {
  display: none;
}

@keyframes badgeSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-30px) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) rotate(0deg);
  }
}

.badge-notification-content {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #000;
  padding: 16px 24px;
  border-radius: 12px;
  border: 4px solid #fff;
  box-shadow: 0 0 0 2px #000, 0 0 0 6px #ffd700, 0 8px 32px rgba(255, 215, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
}

.badge-icon {
  font-size: 32px;
  animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.badge-text {
  font-size: 14px;
  line-height: 1.4;
}

.badge-text strong {
  display: block;
  font-size: 16px;
  margin-bottom: 2px;
  font-weight: 900;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-btn {
  background: #1a1a1a;
  border: 4px solid #fff;
  border-radius: 14px;
  padding: 16px;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
  position: relative;
}

.action-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #555;
}

.action-btn:disabled:active {
  transform: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.action-btn .icon {
  font-size: 32px;
  margin-bottom: 8px;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.3));
}

.action-btn .label {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
  text-shadow: 1px 1px 0 #000;
}

.action-btn .cost {
  font-size: 11px;
  color: #aaa;
  line-height: 1.3;
  font-weight: bold;
}

