:root {
  --bg-color: #a5ceff;
  --panel-bg: #5ba7ff;
  --panel-border: #ffffff;
  --green: #4ade80;
  --red: #f87171;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background-color: var(--bg-color);
  background-image:
    radial-gradient(at 50% 0%, rgba(255, 255, 255, 0.3) 0%, transparent 75%),
    radial-gradient(at 100% 100%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  color: #fff;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  user-select: none;
}

button {
  font: inherit;
}

.page-shell {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem;
}

.panel {
  background: var(--panel-bg);
  border: 6px solid var(--panel-border);
  border-radius: 2rem;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.15);
}

.left-column {
  display: flex;
  width: 350px;
  flex-direction: column;
  gap: 1.5rem;
}

.title-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

h1,
h2 {
  margin: 0;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

h1 {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  line-height: 2rem;
}

.colors-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
}

.color-list {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 1rem;
}

.color-row {
  display: flex;
  height: 5rem;
  align-items: center;
  border: 2px solid #fff;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.4);
  padding: 0.75rem;
  transition: background-color 0.2s ease;
}

.color-row:hover {
  background: rgba(255, 255, 255, 0.6);
}

.button-image-wrap {
  display: flex;
  width: 150px;
  height: 3rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.button-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.18));
}

.side-dot {
  display: flex;
  width: 3rem;
  height: 3rem;
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.side-dot.green,
.coin.green {
  background: var(--green);
}

.side-dot.red,
.coin.red {
  background: var(--red);
}

.side-dot svg,
.coin-center svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #fff;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.side-dot svg:not(.skull-icon) path:first-child,
.coin-center svg:not(.skull-icon) path:first-child,
.skull-shape {
  fill: currentColor;
  stroke: currentColor;
}

.skull-eye {
  fill: rgba(80, 20, 20, 0.72);
  stroke: none;
}

.main-panel {
  display: flex;
  width: 100%;
  min-height: 550px;
  max-width: 42rem;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.coin-stack {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result-label {
  display: flex;
  min-height: 3.5rem;
  margin-bottom: 2.5rem;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.coin-area {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.result-label span {
  display: inline-block;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.1);
  padding: 0 1rem;
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  animation: label-in 0.35s ease both;
}

.coin {
  position: relative;
  display: flex;
  width: 16rem;
  height: 16rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border: 8px solid #fff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  color: #fff;
  transition:
    background-color 0.5s ease,
    box-shadow 0.5s ease,
    opacity 0.2s ease;
}

.coin.green {
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 35px rgba(74, 222, 128, 0.2);
}

.coin.red {
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 35px rgba(248, 113, 113, 0.2);
}

.coin-idle {
  animation: coin-in 0.5s ease both;
}

.coin.flipping {
  cursor: default;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  animation: flip 1s ease-in-out both;
}

.coin-center {
  display: flex;
  width: 7rem;
  height: 7rem;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
}

.coin.flipping .coin-center {
  background: rgba(255, 255, 255, 0.6);
  animation: pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.coin-center svg {
  width: 4rem;
  height: 4rem;
}

.idle-dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
}

.action-wrap {
  width: 100%;
  max-width: 28rem;
  margin-top: 2.5rem;
}

.flip-button {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 0;
  border-bottom: 8px solid rgba(0, 0, 0, 0.2);
  border-radius: 1rem;
  background: linear-gradient(to bottom, #facc15, #f59e0b);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  color: #fff;
  cursor: pointer;
  padding: 1.5rem;
  font-size: 1.875rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 2.25rem;
  text-transform: uppercase;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    background 0.15s ease,
    border-width 0.15s ease;
}

.flip-button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.2), transparent);
}

.flip-button span {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 1px rgba(0, 0, 0, 0.3);
}

.flip-button:hover:not(:disabled) {
  background: linear-gradient(to bottom, #fde047, #fbbf24);
}

.flip-button:active:not(:disabled) {
  transform: translateY(0.25rem);
  border-bottom-width: 4px;
}

.flip-button:disabled {
  cursor: not-allowed;
  transform: scale(0.95);
  background: #a1a1aa;
  opacity: 0.5;
}

footer {
  position: fixed;
  right: 1.5rem;
  bottom: 1rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

@keyframes coin-in {
  from {
    opacity: 0;
    transform: scale(0.8) rotateY(0);
  }
  to {
    opacity: 1;
    transform: scale(1) rotateY(360deg);
  }
}

@keyframes flip {
  0% {
    transform: translateY(0) scale(1) rotateY(0);
  }
  25% {
    transform: translateY(-40px) scale(1.1) rotateY(720deg);
  }
  50% {
    transform: translateY(-60px) scale(1.2) rotateY(1440deg);
  }
  75% {
    transform: translateY(-40px) scale(1.1) rotateY(2160deg);
  }
  100% {
    transform: translateY(0) scale(1) rotateY(2160deg);
  }
}

@keyframes label-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}

@media (max-width: 767px) {
  .page-shell {
    flex-direction: column;
    padding: 1.5rem;
  }

  .left-column {
    width: 100%;
  }

  .main-panel {
    min-height: 550px;
  }

  .coin {
    width: 12rem;
    height: 12rem;
  }

  .coin-center {
    width: 5rem;
    height: 5rem;
  }

  .coin-center svg {
    width: 3rem;
    height: 3rem;
  }
}
