/* ============================================================================
   Rafting War — style.css
   Only the page shell, the preloader and the rotation hint live here; the
   entire game is rendered on the canvas.
   ============================================================================ */
:root {
  --ink: #041e30;
  --ink-2: #07304c;
  --gold: #ffd166;
  --sky: #4cc9f0;
  --coral: #ff5a5f;
  --cream: #fff6e0;
  --font: ui-rounded, "Segoe UI Variable Display", "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--ink);
  overflow: hidden;
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}
#wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
canvas {
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: #041e30;
}

/* ------------------------------------------------------------------ boot */
.boot {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
  transition: opacity .6s ease, visibility .6s ease;
}
.boot.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #0d5f92 0%, #3fa9dd 42%, #a8dcf7 72%, #dcf3fd 100%);
}
.boot-sun {
  position: absolute; top: 10%; left: 50%; width: 120px; height: 120px; margin-left: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8cf 0%, rgba(255,240,170,.85) 42%, rgba(255,240,170,0) 72%);
  filter: blur(1px);
  animation: sunPulse 5s ease-in-out infinite;
}
@keyframes sunPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.boot-clouds { position: absolute; inset: 0; }
.boot-clouds span {
  position: absolute; height: 34px; border-radius: 20px; background: rgba(255,255,255,.85);
  box-shadow: 34px 8px 0 -6px rgba(255,255,255,.85), -38px 10px 0 -8px rgba(255,255,255,.85), 8px -16px 0 -2px rgba(255,255,255,.9);
  animation: drift linear infinite;
}
.boot-clouds span:nth-child(1) { width: 78px; top: 18%; left: -20%; animation-duration: 34s; }
.boot-clouds span:nth-child(2) { width: 58px; top: 30%; left: -20%; animation-duration: 46s; animation-delay: -12s; opacity: .8; }
.boot-clouds span:nth-child(3) { width: 96px; top: 9%; left: -20%; animation-duration: 58s; animation-delay: -30s; opacity: .7; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(150vw); } }
.boot-logo { position: relative; text-align: center; transform: translateY(-6vh); }
.boot-title {
  font-size: clamp(38px, 9vw, 92px); line-height: .92; font-weight: 900; letter-spacing: 2px;
  color: #fff; text-shadow: 0 6px 0 rgba(8,59,92,.55), 0 12px 26px rgba(3,20,36,.45);
}
.boot-title span { display: block; color: var(--gold); }
.boot-tag {
  margin-top: 14px; font-size: clamp(11px, 1.6vw, 16px); font-weight: 800; letter-spacing: 5px;
  color: rgba(255,255,255,.94); text-shadow: 0 3px 0 rgba(8,59,92,.5);
}
.boot-bar {
  position: relative; width: min(340px, 64vw); height: 12px; margin-top: 34px;
  border-radius: 8px; background: rgba(4,30,48,.5); overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.35), 0 2px 0 rgba(255,255,255,.18);
}
.boot-bar i {
  display: block; height: 100%; width: 0%; border-radius: 8px;
  background: linear-gradient(180deg, #ffe08a, var(--gold) 55%, #d9a02c);
  transition: width .25s ease;
}
.boot-status { position: relative; margin-top: 12px; font-size: 13px; font-weight: 700; letter-spacing: 1px; color: rgba(255,255,255,.85); text-shadow: 0 2px 0 rgba(8,59,92,.4); }
.boot-start {
  position: relative; margin-top: 26px; padding: 15px 46px; border: 0; cursor: pointer;
  border-radius: 16px; font-family: var(--font); font-weight: 900;
  background: linear-gradient(180deg, #ffc93f, #ff9f1c 55%, #e07b06);
  color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.28);
  box-shadow: 0 6px 0 rgba(3,20,36,.4), inset 0 2px 0 rgba(255,255,255,.35);
  animation: popIn .45s cubic-bezier(.2,1.6,.5,1) both, bob 2.4s ease-in-out infinite 0.45s;
}
.boot-start:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(3,20,36,.4); }
.boot-start-label { display: block; font-size: 20px; letter-spacing: 2px; }
.boot-start-sub { display: block; margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: rgba(255,255,255,.9); }
@keyframes popIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.boot-foot { position: absolute; bottom: 14px; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.7); text-shadow: 0 2px 0 rgba(8,59,92,.4); }
.boot-water { position: absolute; bottom: 0; left: 0; right: 0; height: 90px; }
.boot-water i { position: absolute; inset: 0; display: block; background: rgba(255,255,255,.28); animation: waveSlide linear infinite; }
.boot-water i:nth-child(1) { animation-duration: 9s; }
.boot-water i:nth-child(2) { animation-duration: 13s; opacity: .6; }
.boot-water i:nth-child(3) { animation-duration: 18s; opacity: .4; }
@keyframes waveSlide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ------------------------------------------------------- rotate hint */
.rotate {
  position: fixed; inset: 0; z-index: 30; display: none;
  align-items: center; justify-content: center; text-align: center;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 20px; line-height: 1.6;
  padding: 30px;
}
.rotate span { font-size: 14px; font-weight: 700; color: rgba(255,255,255,.7); }
/* only nudge phones held in portrait with a very narrow viewport */
@media (max-width: 700px) and (orientation: portrait) {
  .rotate { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .boot-sun, .boot-clouds span, .boot-start, .boot-water i { animation: none !important; }
}
