.embed {
  height: 320px;
  background: #0b0e14;
  display: block;
}

.top-image {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.trade-zone {
  position: relative;
  margin-top: 20px;
  padding-top: 12px;
}

.stake-panel {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e131d;
  text-align: left;
}

.stake-panel label { margin-top: 0; }
.stake-panel input { font-size: 20px; font-weight: 800; text-align: right; }
.stake-summary { display: flex; justify-content: space-between; gap: 10px; color: var(--sub); font-size: 11px; }
.stake-summary strong { display: block; margin-top: 3px; color: var(--text); font-size: 14px; }
.stake-summary span:last-child { text-align: right; }
.stake-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 12px; }
.stake-presets button { padding: 8px 4px; font-size: 12px; }
.stake-presets .stake-reset { color: #ffd166; background: #3a3020; }

.game-session-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  margin-bottom: 14px;
}



.game-session-info {
  min-width: 210px;
  margin-left: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(19,23,34,.96);
  text-align: right;
}

.session-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.session-actions button { padding: 6px 9px; font-size: 11px; }
.session-balance { margin-top: 7px; color: var(--sub); font-size: 12px; }
.session-balance strong { margin-left: 5px; color: var(--text); font-size: 16px; }

.countdown-label,
.pending-label {
  color: var(--sub);
  font-size: 12px;
}

.countdown {
  margin: 4px 0;
  font-size: 30px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.pending-label {
  min-height: 18px;
  color: #ffd166;
}

.trade-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.trade-button {
  padding: 17px;
  font-size: 19px;
  color: white;
}



.trade-button.buy { order: 1; background: linear-gradient(135deg, #087f5b, #00c97b); }
.trade-button.sell { order: 2; background: linear-gradient(135deg, #9f1239, #ef4444); }
.buy-text { color: var(--green); }
.sell-text { color: #ff7085; }
.history-item .side { min-width: 34px; font-weight: 800; }

#result-animation {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 1px;
  z-index: 4;
  pointer-events: none;
}

.result-float {
  position: absolute;
  left: 0;
  white-space: nowrap;
  font-size: 42px;
  font-weight: 1000;
  text-shadow: 0 3px 0 #000, 0 0 16px currentColor;
  transform: translate(-50%, 10px) scale(.65);
  animation: result-one-up 1.65s cubic-bezier(.16,.78,.28,1) forwards;
}

.result-float.win { color: #5cff8d; }
.result-float.lose { color: #ff5876; }

@keyframes result-one-up {
  0% { opacity: 0; transform: translate(-50%, 18px) scale(.55); }
  18% { opacity: 1; transform: translate(-50%, -5px) scale(1.18); }
  32% { transform: translate(-50%, -18px) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -95px) scale(.9); }
}

@media (prefers-reduced-motion: reduce) {
  .result-float { animation-duration: .4s; }
}

@media (max-width: 800px) {
  .game-session-header { align-items: center; }
  .game-session-info { min-width: 0; }
}

/* Positions for the expanded game screen. */
@media (min-width: 801px) {
  .game-view { max-width:1180px; display:grid; grid-template-columns:minmax(0,1.8fr) minmax(320px,1fr); grid-template-rows:auto; gap:18px 22px; align-items:start; }
  .game-view > .game-session-header { grid-column:1 / -1; grid-row:1; margin:0; }
  .game-view > .simulation-note { grid-column: 1 / -1; grid-row: 2; }
  .game-view > .notice-board { grid-column: 1 / -1; grid-row: 3; margin: 0; }
  .game-view > .chart-card { grid-column: 1; grid-row: 4; margin: 0; }
  .game-view > .balance { grid-column:2; grid-row:4 / span 2; margin:0; position:sticky; top:24px; }
  .game-view > .history-card { grid-column: 1; grid-row: 5; }
  .game-view > .embed, .game-view > .top-image { grid-column: 1 / -1; grid-row: 6; }
}
