
  .river-page {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #0f2a35;
    position: relative;
  }

  #game-container, #game-canvas {
    width: 100%;
    height: 100%;
    display: block;
  }

  .hud {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
  }

  .hud-top {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .hud-box {
    background: rgba(15, 42, 53, 0.75);
    border: 1px solid rgba(240, 230, 211, 0.15);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
  }

  .hud-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8aa8b5;
  }

  .hud-value {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0e6d3;
  }

  #festival-banner {
    border-color: rgba(212, 168, 83, 0.5);
    background: rgba(212, 168, 83, 0.15);
  }

  #festival-banner .hud-value {
    color: #d4a853;
  }

  .hud-bottom {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    pointer-events: auto;
  }

  .hud-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1.5px solid rgba(240, 230, 211, 0.25);
    background: rgba(15, 42, 53, 0.75);
    backdrop-filter: blur(8px);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hud-btn:hover {
    transform: scale(1.1);
    background: rgba(240, 230, 211, 0.15);
  }

  .hud-btn:active {
    transform: scale(0.95);
  }

  .drift-feed {
    position: fixed;
    left: 1rem;
    bottom: 6rem;
    z-index: 11;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 280px;
    pointer-events: none;
  }

  .feed-item {
    background: rgba(15, 42, 53, 0.85);
    border: 1px solid rgba(240, 230, 211, 0.1);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #a8c5d0;
    animation: feedIn 0.3s ease, feedOut 0.5s ease 4s forwards;
    backdrop-filter: blur(8px);
  }

  @keyframes feedIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
  }

  @keyframes feedOut {
    to { opacity: 0; transform: translateX(-20px); }
  }

  .collection-panel, .sandcastle-panel {
    position: fixed;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 320px;
    max-height: 70vh;
    background: rgba(15, 42, 53, 0.95);
    border: 1px solid rgba(240, 230, 211, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    z-index: 20;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .sandcastle-panel {
    right: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(500px, 90vw);
  }

  .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(240, 230, 211, 0.1);
  }

  .panel-header h2 {
    font-family: 'Nunito', sans-serif;
    color: #f0e6d3;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
  }

  .panel-close {
    background: none;
    border: none;
    color: #8aa8b5;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.15s;
  }

  .panel-close:hover {
    background: rgba(255,255,255,0.1);
    color: #f0e6d3;
  }

  .collection-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    overflow-y: auto;
  }

  .collection-item {
    aspect-ratio: 1;
    background: rgba(240, 230, 211, 0.05);
    border: 1px solid rgba(240, 230, 211, 0.1);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 1.5rem;
  }

  .collection-item:hover {
    background: rgba(240, 230, 211, 0.12);
  }

  .collection-item span {
    font-size: 0.6rem;
    color: #8aa8b5;
    text-align: center;
  }

  .collection-item.empty {
    opacity: 0.3;
    cursor: default;
  }

  .sandcastle-canvas {
    min-height: 300px;
    margin: 1rem;
    border: 2px dashed rgba(240, 230, 211, 0.2);
    border-radius: 12px;
    position: relative;
    background: linear-gradient(180deg, rgba(212,168,83,0.1), rgba(212,168,83,0.05));
  }

  .sandcastle-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8aa8b5;
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
  }

  .hidden { display: none !important; }

  .loading {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #0f2a35;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .loading-inner {
    text-align: center;
    color: #8aa8b5;
  }

  .loading-icon {
    font-size: 3rem;
    display: block;
    animation: bob 2s ease-in-out infinite;
  }

  @keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
  }

  .loading p {
    margin-top: 1rem;
    font-size: 0.9rem;
  }

*{box-sizing:border-box}html,body{margin:0;background:#132b2f;color:#fff2d9;font:16px system-ui,sans-serif;overflow:hidden}a{color:inherit}
.river-page{height:100dvh}#game-canvas{touch-action:none}.mast{pointer-events:auto;position:absolute;inset:0 0 auto;padding:9px max(12px,env(safe-area-inset-left));background:#122c31e8;display:flex;align-items:center;justify-content:space-between;gap:8px}.mast a{display:flex;align-items:center;gap:8px;font-weight:750}.mast img{border-radius:8px}
.hud-top{top:70px!important;gap:6px;flex-wrap:wrap}.hud-bottom{max-width:100%;flex-wrap:wrap;justify-content:center;bottom:max(14px,env(safe-area-inset-bottom))}.hud-btn{font:750 .8rem system-ui;width:auto;min-width:51px;min-height:44px;height:44px;padding:0 10px;color:#fff0d6;border-radius:10px}.collection-panel{max-width:calc(100vw - 24px)}.panel-close{min-height:44px;min-width:44px}.hidden{display:none!important}
:focus-visible{outline:3px solid #f9cd85;outline-offset:3px}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition:none!important}}
