/* Feather718 webclient shell - dark RuneScape-style theme */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #050504; overflow: hidden; }
body { font-family: Verdana, Geneva, sans-serif; color: #e8dcc0; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#display { position: absolute; inset: 0; }
#display canvas { display: block; }

/* ---- loading ---- */
#loading {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; background: radial-gradient(ellipse at center, #1a1408 0%, #050504 70%);
  padding: 24px; text-align: center;
}
#app[data-state="game"] #loading, #app[data-state="login"] #loading { display: none; }
#status { font-size: 15px; color: #d8c58a; letter-spacing: .5px; }
#error-details {
  max-width: 90%; max-height: 40%; overflow: auto; font-size: 11px;
  background: #140f08; border: 1px solid #4a3a1e; padding: 10px; text-align: left;
  white-space: pre-wrap; color: #e09090;
}
#cache-progress { width: min(420px, 86vw); }
.progress-track {
  position: relative; height: 26px; border: 1px solid #6b5426;
  background: #0d0a05; border-radius: 3px; overflow: hidden;
}
#cache-progress-value {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: linear-gradient(180deg, #c8a548, #8a6d24); transition: width .2s;
}
#loading-progress-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; text-shadow: 0 1px 2px #000;
}
#cache-progress-text { margin-top: 6px; font-size: 11px; color: #9a8a5e; min-height: 14px; }

/* ---- buttons ---- */
.primary-action, .secondary-action {
  font-family: inherit; cursor: pointer; border-radius: 3px; padding: 9px 18px;
  font-size: 13px; border: 1px solid #6b5426;
}
.primary-action {
  background: linear-gradient(180deg, #c8a548, #8a6d24); color: #120e04;
  font-weight: bold; text-transform: uppercase; letter-spacing: 1px;
}
.primary-action:hover { filter: brightness(1.12); }
.primary-action:disabled { opacity: .5; cursor: default; }
.secondary-action { background: #1d1608; color: #d8c58a; }
.secondary-action:hover { background: #2a2010; }

/* ---- login ---- */
#login-panel {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 5, 4, .72);
}
#login-form {
  display: flex; flex-direction: column; gap: 12px; width: min(320px, 88vw);
  background: #14100a; border: 1px solid #4a3a1e; border-radius: 4px;
  padding: 26px 26px 20px; box-shadow: 0 8px 40px #000c;
}
#login-title {
  margin: 0; text-align: center; color: #e8c860; font-size: 22px;
  text-shadow: 0 2px 6px #000; letter-spacing: 2px;
}
#login-message { margin: 0; min-height: 16px; font-size: 12px; text-align: center; color: #c89080; }
#login-message.ok { color: #90c880; }
#login-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #b8a878; }
#login-form input {
  background: #0d0a05; border: 1px solid #4a3a1e; color: #f0e6c8;
  padding: 9px 10px; border-radius: 2px; font-size: 15px; outline: none;
}
#login-form input:focus { border-color: #c8a548; }
.auth-mode-switch {
  background: none; border: none; color: #9a8a5e; font-size: 12px; cursor: pointer;
  font-family: inherit; padding: 4px;
}
.auth-mode-switch span { color: #e8c860; text-decoration: underline; }

/* ---- shell controls ---- */
#shell-controls { position: absolute; top: 8px; right: 8px; z-index: 40; display: flex; gap: 6px; }
.shell-control {
  width: 38px; height: 38px; border-radius: 4px; border: 1px solid #4a3a1e;
  background: #14100acc; cursor: pointer; display: flex; align-items: center;
  justify-content: center; padding: 0;
}
.shell-control svg { width: 20px; height: 20px; fill: none; stroke: #d8c58a; stroke-width: 2; }
.shell-control .exit-fullscreen { display: none; }
body.fullscreen .enter-fullscreen { display: none; }
body.fullscreen .exit-fullscreen { display: block; }

/* ---- overlays ---- */
.shell-overlay {
  position: absolute; inset: 0; z-index: 50; display: flex; align-items: center;
  justify-content: center; background: rgba(0,0,0,.75);
}
.shell-card {
  width: min(360px, 90vw); background: #14100a; border: 1px solid #4a3a1e;
  border-radius: 6px; padding: 28px; text-align: center;
}
.shell-card h1 { margin: 0 0 10px; font-size: 18px; color: #e8c860; }
.shell-card p { font-size: 13px; color: #b8a878; line-height: 1.5; }
.rotate-device { font-size: 44px; color: #e8c860; margin-bottom: 8px; }
.orientation-preference {
  display: flex; gap: 8px; align-items: center; justify-content: center;
  font-size: 12px; color: #9a8a5e; margin: 14px 0;
}
#version {
  position: absolute; bottom: 6px; right: 10px; z-index: 40;
  font-size: 10px; color: #5a4c2e;
}

@media (max-width: 700px) {
  #login-form { padding: 18px; }
  .primary-action, .secondary-action { padding: 12px 14px; font-size: 14px; }
}
