/**
 * style.css
 * Styling for the Coin Flip game.
 */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at center, #2d5a2d 0%, #143314 100%);
  color: #eef2ee;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.shell {
  max-width: 560px;
  width: 100%;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.header {
  text-align: center;
}

.header h1 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffd75a;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.header .sub {
  font-size: 13px;
  color: #b9c9b9;
}

.game-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 3px solid #3e5c3e;
  border-radius: 14px;
  padding: 20px 16px 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.status {
  font-size: 15px;
  color: #cfd8cf;
  min-height: 22px;
}

/* ---- 3D coin ---- */

.coin-stage {
  width: 150px;
  height: 150px;
  perspective: 900px;
  position: relative;
}

.coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(0deg);
}

.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 50%;
  border: 4px solid #8a6d3b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 900;
  user-select: none;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5), 0 6px 18px rgba(0, 0, 0, 0.45);
}

.coin-heads {
  background: linear-gradient(135deg, #d4af37, #f2d14a, #b8860b);
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  transform: rotateX(0deg) translateZ(1px);
}

.coin-tails {
  background: linear-gradient(135deg, #7a7a7a, #c0c0c0, #6e6e6e);
  color: #eef2ee;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  transform: rotateX(180deg) translateZ(1px);
}

/* ---- Controls ---- */

.prediction {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.pred-btn {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #3e5c3e;
  color: #eef2ee;
  border: 2px solid #6ea06e;
}

.pred-btn:hover:not(:disabled) {
  background: #4ea04e;
  border-color: #9fd09f;
}

.pred-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #2b3a2b;
}

.pred-btn.active {
  background: #8a6d3b;
  border-color: #e2c66b;
  color: #fff3bf;
}

.controls {
  display: flex;
  justify-content: center;
  width: 100%;
}

.btn-flip {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 30px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #8a6d3b;
  color: #fff3bf;
  border: 2px solid #c9a227;
}

.btn-flip:hover:not(:disabled) {
  background: #a07d4b;
  border-color: #e2c66b;
}

.btn-flip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #2b3a2b;
}

.btn-again {
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #3e5c3e;
  color: #eef2ee;
  border: 2px solid #6ea06e;
}

.btn-again:hover:not(:disabled) {
  background: #4ea04e;
  border-color: #9fd09f;
}

.btn-again:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #2b3a2b;
}

/* ---- Result ---- */

.result {
  font-size: 20px;
  font-weight: 800;
  min-height: 26px;
}

.result.win {
  color: #a8d08a;
}

.result.loss {
  color: #f08080;
}

.hidden {
  display: none !important;
}

.score {
  font-size: 15px;
  font-weight: 700;
  color: #cfd8cf;
}

.footer {
  margin-top: 10px;
  font-size: 12px;
  color: #8a9a8a;
  text-align: center;
}

@media (max-width: 560px) {
  .shell {
    padding: 8px;
  }
  .coin-stage {
    width: 130px;
    height: 130px;
  }
  .pred-btn, .btn-flip {
    width: 100%;
    max-width: 220px;
  }
}
