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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #e0e5ec 0%, #d5dae3 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.header {
  background: #e0e5ec;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.header-content {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-left, .header-right { flex: 1; }
.header-left { display: flex; justify-content: flex-start; }
.header-center { flex: 1; display: flex; justify-content: center; }
.header-right { display: flex; justify-content: flex-end; }
.back-btn {
  background: #e0e5ec;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 6px 6px 12px #bec3c9, -6px -6px 12px #ffffff;
  transition: all 0.1s ease;
}
.back-btn:active { box-shadow: inset 6px 6px 12px #bec3c9, inset -6px -6px 12px #ffffff; }
.back-btn svg { width: 24px; height: 24px; fill: #4a5568; }
.header-logo {
  width: 45px;
  height: 45px;
  background: #e0e5ec;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 6px 6px 12px #bec3c9, -6px -6px 12px #ffffff;
  font-size: 24px;
}
.header-title {
  font-size: 20px;
  font-weight: bold;
  color: #4a5568;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}
.header-title span { display: block; }
.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.container { width: 100%; max-width: 420px; }
.calculator-wrap {
  background: #e0e5ec;
  border-radius: 40px;
  padding: 30px;
  box-shadow: 20px 20px 60px #bec3c9, -20px -20px 60px #ffffff;
}
.coin-section {
  background: #ffffff;
  border-radius: 25px;
  padding: 40px;
  margin-bottom: 20px;
  box-shadow: inset 8px 8px 16px #d1d9e6, inset -8px -8px 16px #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.coin {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: bold;
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.6s;
  transform-style: preserve-3d;
  margin-bottom: 20px;
}
.coin.flipping {
  animation: flip 1s ease-in-out;
}
@keyframes flip {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(1800deg); }
}
.result-text {
  font-size: 24px;
  font-weight: bold;
  color: #2d3748;
  margin-bottom: 10px;
}
.result-emoji {
  font-size: 36px;
}
.stats-section {
  background: #ffffff;
  border-radius: 25px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: inset 8px 8px 16px #d1d9e6, inset -8px -8px 16px #ffffff;
}
.section-label {
  font-size: 14px;
  font-weight: 600;
  color: #718096;
  margin-bottom: 12px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat-box {
  background: #e0e5ec;
  padding: 15px;
  border-radius: 15px;
  text-align: center;
  box-shadow: inset 4px 4px 8px #d1d9e6, inset -4px -4px 8px #ffffff;
}
.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #667eea;
}
.stat-label {
  font-size: 12px;
  color: #718096;
  margin-top: 5px;
}
.buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.btn {
  background: #e0e5ec;
  border: none;
  border-radius: 18px;
  padding: 18px;
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
  cursor: pointer;
  transition: all 0.1s ease;
  box-shadow: 8px 8px 16px #bec3c9, -8px -8px 16px #ffffff;
}
.btn:active { box-shadow: inset 8px 8px 16px #bec3c9, inset -8px -8px 16px #ffffff; }
.btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  grid-column: span 2;
}
.btn.primary:active { box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.2); }
@media (max-width: 480px) {
  .calculator-wrap { padding: 20px; }
  .coin { width: 160px; height: 160px; font-size: 36px; }
}