:root{
  --bg: #0f1720;
  --panel: #293b55ff;
  --muted: rgba(255,255,255,0.6);
  --accent: #10b981;
}

html,body{
  height:100%;
  margin:0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg, #071022 0%, var(--bg) 100%);
  color: white;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

.app {
  min-height:100vh;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:12px;
  box-sizing:border-box;
}

header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.title {
  font-size:1.2rem;
  font-weight:600;
  letter-spacing:0.2px;
  font-weight: bolder;
}

.status {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:0.85rem;
  color:var(--muted);
}

.dot {
  width:10px;
  height:10px;
  border-radius:50%;
  background: #f59e0b;
}
.dot.connected { background: var(--accent); }
.dot.disconnected { background: #ef4444; }

.stage {
  flex:1;
  position:relative;
  display:flex;
  gap:8px;
  align-items:stretch;
  overflow: auto; 
}

canvas#game {
  width:100%;
  height:100%;
  border-radius:8px;
  background-color: rgb(73, 102, 143); /* need to change on JS too */
  cursor: url('./user.png') 16 16 , auto; 
  touch-action: none;
}

.controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  line-height: 1.6rem;
  font-weight: 600;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--panel);
  z-index: 100;
}

.btn {
  background:var(--panel);
  border: none;
  color: white;
  padding:8px 12px;
  border-radius:10px;
  font-weight:600;
  font-size:0.9rem;
}
.hint {
  font-size:0.85rem;
  color:var(--muted);
}

@media (min-width:720px){
  .title { font-size:1.2rem; }
  .btn { padding:10px 14px; }
  .scroll-controls, .scroll-btn { display: none; }
  .stage {
    justify-content: center; 
    align-items: center;    
  }
  .controls, .hint { display: none;}
}

.scroll-controls {
  display: flex;
  gap: 4px;
}

.scroll-btn {
  background: var(--panel);
  border: none;
  color: white;
  padding: 4px 24px;
  border-radius: 6px;
  font-size: 1rem;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 8px 12px 0 12px;
  z-index: 50;
}

.text-input {
  width: min(720px, 100%);
  max-width: 900px;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(41,59,85,0.9); 
  color: white;
  border: 1px solid rgba(255,255,255,0.06);
  outline: none;
  font-size: 0.95rem;
  font-weight: 600;
  caret-color: var(--accent);
  transition: box-shadow 0.12s ease, transform 0.06s ease;
}

.text-input:focus {
  box-shadow: 0 6px 18px rgba(16,185,129,0.06);
  transform: translateY(-1px);
  border-color: rgba(16,185,129,0.28);
}

.char-count {
  min-width: 36px;
  text-align: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.03);
}

@media (max-width:420px) {
  .input-row { margin-left: 8px; margin-right: 8px; gap: 6px; }
  .text-input { padding: 9px 10px; font-size: 0.9rem; }
  .char-count { font-size: 0.8rem; padding: 5px 7px; }
}