@import url(fonts/clear-sans.css);

/* Suika — Combo Edition. Mobile-first: canvas scales to viewport (works at
 * 320px), touch aim + tap to drop, keyboard for desktop. */

html, body { margin: 0; background: #faf8ef; color: #776e65; font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif; font-size: 18px; }

.container { width: 100%; max-width: 520px; margin: 0 auto; padding: 20px 16px 80px; box-sizing: border-box; }

.heading { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.title { font-size: 44px; margin: 0; color: #776e65; line-height: 1; }
.title-accent { color: #e8834a; }
.tagline { color: #a0948a; font-size: 14px; }

.scores-container { display: flex; gap: 6px; }
.score-container, .best-container {
  background: #bbada0; padding: 6px 12px; border-radius: 4px;
  color: #f9f6f2; font-weight: 700; font-size: 20px; min-width: 44px; text-align: center; position: relative; }
.best-container { background: #d8cdc4; }
.score-addition { position: absolute; top: -6px; right: -2px; color: #e8834a; font-size: 14px; font-weight: 700; opacity: 0; transition: opacity 200ms; }
.score-addition.show { opacity: 1; }

.above-game { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.game-intro { margin: 0; font-size: 13px; color: #a0948a; line-height: 1.4; }
.restart-button {
  background: #8f7a66; color: #f9f6f2; border: none; border-radius: 4px;
  padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.restart-button:hover { background: #9f8b77; }
.restart-button:focus-visible { outline: 3px solid #f2b179; }

/* stats bar (shared language with 2048 + snake) */
.stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  background: #fdfbf7; border: 2px solid #eee4da; border-radius: 8px;
  padding: 8px 10px; margin-bottom: 12px; }
.stat { text-align: center; }
.stat-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #a0948a; }
.stat-value { display: block; font-size: 18px; font-weight: 700; color: #776e65; }

/* game board */
.game-container { position: relative; }
.suika-canvas {
  width: 100%; aspect-ratio: 1 / 1.35; display: block;
  border-radius: 8px; touch-action: none; cursor: pointer; }

/* message overlay */
.game-message {
  position: absolute; inset: 0; z-index: 5; background: rgba(238, 228, 218, 0.78);
  border-radius: 8px; display: none; text-align: center; }
.game-message.visible { display: block; }
.game-message p { margin-top: 34%; font-size: 34px; font-weight: 700; color: #776e65; }
.game-message .lower { margin-top: 18px; }
.game-message .lower a {
  display: inline-block; background: #8f7a66; color: #f9f6f2; border-radius: 3px;
  padding: 0 16px; height: 40px; line-height: 40px; text-decoration: none; font-weight: 700; margin: 0 4px; cursor: pointer; }
.game-message .lower a.lb-cta-button { background: #e8834a; }

/* combo popup (floating feedback: "Combo! x2", "Precision +25") */
.combo-popup {
  position: absolute; left: 0; right: 0; top: 40%; z-index: 150;
  text-align: center; font-size: 40px; font-weight: bold; color: #f9f6f2;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  opacity: 0; pointer-events: none; }
.combo-popup.combo-show {
  -webkit-animation: combo-float 900ms ease-out;
  animation: combo-float 900ms ease-out; }

@-webkit-keyframes combo-float {
  0% { opacity: 0; -webkit-transform: scale(0.6); }
  20% { opacity: 1; -webkit-transform: scale(1.1); }
  100% { opacity: 0; -webkit-transform: scale(1) translateY(-30px); } }
@keyframes combo-float {
  0% { opacity: 0; transform: scale(0.6); }
  20% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1) translateY(-30px); } }

/* aim + drop legend */
.controls-hint {
  margin: 10px 0 0; font-size: 12px; color: #a0948a; text-align: center; line-height: 1.5; }
.controls-hint kbd {
  background: #eee4da; border-radius: 3px; padding: 1px 6px;
  font-family: inherit; font-size: 12px; color: #776e65; }

.social-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; gap: 10px; }
.share-button {
  display: inline-block; background: #1d9bf0; border-radius: 3px;
  padding: 10px 18px; text-decoration: none; color: #fff;
  font-weight: bold; text-align: center; }
.share-button:hover { background: #1a8cd8; }
.hub-link { color: #776e65; font-weight: bold; text-decoration: underline; white-space: nowrap; }

.game-credit { margin-top: 12px; font-size: 12px; color: #a0948a; text-align: center; }
.game-credit a { color: #776e65; font-weight: bold; }
.game-explanation { font-size: 14px; line-height: 1.5; color: #776e65; }

@media (min-width: 641px) {
  .container { padding: 20px 20px 80px; }
  .combo-popup { font-size: 48px; }
}

/* reduced motion: skip the popup animation */
@media (prefers-reduced-motion: reduce) {
  .combo-popup.combo-show { animation: none; opacity: 1; transition: opacity 300ms; }
}
