/* 동전 던지기 */
.cn-layout { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .cn-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }

.cn-stage {
  --cs: 170px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 18px;
  min-height: 260px; padding: 56px 12px 30px; border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 50% 30%, var(--surface) 0%, var(--surface-2) 75%);
  border: 1px solid var(--border); cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
}
.cn-stage.is-n1 { --cs: clamp(150px, 44vw, 200px); }
.cn-stage.is-n2 { --cs: clamp(88px, 25vw, 120px); }
.cn-stage.is-n4 { --cs: clamp(70px, 20vw, 92px); gap: 14px 16px; }
.cn-stage.is-n7 { --cs: clamp(54px, 15vw, 70px); gap: 12px 14px; padding-top: 40px; }
.cn-stage:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.game-shell.is-full .cn-stage.is-n1 { --cs: clamp(180px, 34vw, 260px); }

.cn-wrap { position: relative; width: var(--cs); height: var(--cs); flex: none; }
.cn-toss { position: absolute; inset: 0; perspective: 800px; z-index: 1; }
.cn-coin { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1.5s cubic-bezier(.2, .7, .25, 1); }
.cn-edge { position: absolute; inset: 0; border-radius: 50%; background: #b3861f; }
.cn-face {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2%;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.cn-front {
  transform: translateZ(3px); color: #5b3b00;
  background: radial-gradient(circle at 35% 30%, #fff2bd 0%, #f4c64f 42%, #d39a1d 100%);
  box-shadow: inset 0 0 0 calc(var(--cs) * .045) #e2ad2f, inset 0 0 0 calc(var(--cs) * .062) #fff0b3, inset 0 -6px 14px rgba(120, 70, 0, .25);
}
.cn-back {
  transform: rotateX(180deg) translateZ(3px); color: #283042;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #dadfe9 45%, #9ca6bb 100%);
  box-shadow: inset 0 0 0 calc(var(--cs) * .045) #b2bbcc, inset 0 0 0 calc(var(--cs) * .062) #f4f6fb, inset 0 -6px 14px rgba(20, 30, 60, .2);
}
.cn-emoji { font-size: calc(var(--cs) * .34); line-height: 1; }
.cn-label {
  font-weight: 900; font-size: max(11px, calc(var(--cs) * .14)); line-height: 1.15; letter-spacing: -0.02em;
  max-width: 76%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cn-stage.is-n7 .cn-emoji { display: none; }
.cn-stage.is-n7 .cn-label { font-size: calc(var(--cs) * .22); }
.cn-shadow {
  position: absolute; left: 12%; right: 12%; bottom: -12px; height: 14px; border-radius: 50%;
  background: rgba(0, 0, 0, .26); filter: blur(5px);
}
.cn-wrap.is-flipping .cn-toss { animation: cn-toss 1.5s cubic-bezier(.3, .6, .35, 1) var(--delay, 0ms) both; }
.cn-wrap.is-flipping .cn-shadow { animation: cn-shadow 1.5s cubic-bezier(.3, .6, .35, 1) var(--delay, 0ms) both; }
@keyframes cn-toss {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-32%) scale(1.18); }
  78% { transform: translateY(0) scale(1); }
  88% { transform: translateY(-5%) scale(1); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes cn-shadow {
  0% { transform: scale(1); opacity: 1; }
  40% { transform: scale(.5); opacity: .35; }
  78%, 100% { transform: scale(1); opacity: 1; }
}

.cn-result { text-align: center; min-height: 86px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.cn-big { font-size: clamp(28px, 8vw, 44px); font-weight: 900; letter-spacing: -0.03em; line-height: 1.2; word-break: keep-all; }
.cn-sub { color: var(--text-2); font-weight: 700; font-size: 15px; min-height: 1.4em; }
.cn-actions { flex-wrap: nowrap; }
.cn-actions .btn-xl:not(.grow) { padding: 0 20px; flex: none; }

.cn-labels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cn-label-field { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 6px; min-width: 0; }
.cn-label-field .input { grid-column: 1 / -1; min-width: 0; }
.cn-lf-e { font-size: 18px; line-height: 1; }

.cn-bar { display: flex; height: 28px; border-radius: 999px; overflow: hidden; background: var(--surface-3); margin: 10px 0 8px; }
.cn-bar-a, .cn-bar-b { display: grid; place-items: center; font-size: 14px; min-width: 0; overflow: hidden; transition: width .4s ease; }
.cn-bar-a { background: linear-gradient(180deg, #f7d36a, #dfa82a); }
.cn-bar-b { background: linear-gradient(180deg, #e4e8f0, #a9b2c4); }
.cn-stat-text { margin: 0 0 4px; font-weight: 700; font-size: 14.5px; }
.cn-hist { display: flex; flex-wrap: wrap; gap: 6px; }
.cn-h {
  padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border);
}
.cn-h.is-a { border-color: #dfa82a; }
.cn-h.is-b { border-color: #9ca6bb; }
.cn-h:first-child { background: var(--primary-soft); }
