/* Bonewyrms — site page chrome.
 * The battlefield itself lives in the iframe and owns its own styling; this
 * file only dresses the cabinet around it, in the site cyan-on-black scheme.
 * The site background belongs to body in cryptic.css and is never overridden. */

/* The hidden attribute is only display:none in the UA stylesheet, so any class
 * rule that sets display outranks it. Guard it explicitly. */
[hidden] { display: none !important; }

.bw-cabinet {
  display: block;
  margin: 0 auto;
  max-width: 1180px;
  text-align: left;
}

/* ---- toolbar ---- */

.bw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border: 1px solid #008b8b;
  border-radius: 10px;
  background: rgba(0, 30, 32, 0.55);
}

.bw-toolbar label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8fdede;
}

.bw-toolbar input {
  width: 15rem;
  padding: 7px 10px;
  border: 1px solid #007a7a;
  border-radius: 6px;
  background: #071416;
  color: #d8fbfb;
  font-family: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.bw-toolbar input:focus {
  outline: none;
  border-color: #00ffff;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.35);
}

.bw-toolbar input[aria-invalid="true"] {
  border-color: #ff4a3a;
  box-shadow: 0 0 8px rgba(255, 74, 58, 0.35);
}

#bwStatus {
  flex: 1 1 16rem;
  margin: 0;
  font-size: 0.86rem;
  color: #9fd8d8;
  opacity: 0.9;
}

.bw-fullscreen {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.bw-fullscreen small {
  color: #7fc4c4;
  opacity: 0.75;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
}

/* ---- buttons ---- */

.bw-cabinet button {
  padding: 8px 18px;
  border: 1px solid #00cccc;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(0, 90, 92, 0.55), rgba(0, 40, 42, 0.75));
  color: #d8fbfb;
  font-family: inherit;
  font-size: 0.88rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: color 0.2s, box-shadow 0.2s, border-color 0.2s;
  /* Never a bare cursor:pointer — a class rule outranks the site's element
     selectors and the skeleton-hand cursor silently disappears. */
  cursor:
    url('/images/cursors/hover.cur') 11 0,
    url('/images/cursors/hover.png') 11 0,
    pointer;
}

.bw-cabinet button:hover:not(:disabled) {
  color: #ffffff;
  border-color: #00ffff;
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.4);
}

.bw-cabinet button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---- battlefield frame ---- */

.bw-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid #008b8b;
  border-radius: 10px;
  overflow: hidden;
  background: #05070c;
  box-shadow: 0 0 26px rgba(0, 255, 255, 0.16), inset 0 0 60px rgba(0, 0, 0, 0.7);
}

.bw-screen iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.bw-lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(8, 22, 26, 0.94) 0%, rgba(3, 5, 9, 0.97) 70%);
}

.bw-lock strong {
  font-size: 1.15rem;
  letter-spacing: 0.24em;
  color: #00cccc;
  text-shadow: 0 0 12px rgba(0, 204, 204, 0.55);
}

.bw-lock span {
  max-width: 42ch;
  font-size: 0.9rem;
  color: #9fd8d8;
  opacity: 0.85;
}

/* ---- end screen ---- */

.bw-end {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(8, 22, 26, 0.93) 0%, rgba(3, 5, 9, 0.97) 72%);
}

.bw-end strong {
  font-size: 1.5rem;
  letter-spacing: 0.22em;
  color: #ff6a55;
  text-shadow: 0 0 14px rgba(255, 106, 85, 0.5);
}

.bw-end.is-won strong {
  color: #00cccc;
  text-shadow: 0 0 14px rgba(0, 204, 204, 0.6);
}

.bw-end span {
  font-size: 0.95rem;
  color: #9fd8d8;
  opacity: 0.88;
}

.bw-end dl {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 22px;
  margin: 6px 0 4px;
  font-size: 0.9rem;
}

.bw-end dt {
  color: #7fc4c4;
  text-align: right;
  letter-spacing: 0.04em;
}

.bw-end dd {
  margin: 0;
  color: #e4f7f7;
  text-align: left;
  font-weight: 700;
}

.bw-status-link {
  color: #00ffff;
  text-decoration: underline;
}

/* ---- leaderboard: the bordered cyan grid the shell standard requires ---- */

.game-divider {
  border: 0;
  border-top: 1px solid rgba(0, 204, 204, 0.35);
  margin: 34px 0 22px;
}

.leaderboard h2 {
  color: #00cccc;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}

.leaderboard > p {
  margin: 0 0 16px;
  font-size: 0.86rem;
  color: #9fd8d8;
  opacity: 0.8;
}

#lbTable {
  width: 100%;
  margin: 0 auto;
  border-collapse: collapse;
  border: 1px solid #008b8b;
  font-size: 0.92rem;
}

#lbTable th,
#lbTable td {
  border: 1px solid #008b8b;
  padding: 7px 12px;
  text-align: left;
}

#lbTable th {
  background: rgba(0, 204, 204, 0.14);
  color: #aefefe;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

#lbTable td {
  color: #d5eaea;
}

#lbTable tbody tr:nth-child(odd) td {
  background: rgba(0, 40, 42, 0.25);
}

#lbTable .empty-cell {
  font-style: italic;
  opacity: 0.65;
  text-align: center;
}

@media (max-width: 900px) {
  .bw-fullscreen { margin-left: 0; }
  .bw-toolbar input { width: 100%; }
}

/* How to Play — key names read as keys, not prose. */
.game-info kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 1px 6px;
  margin: 0 1px;
  border: 1px solid #008b8b;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(0, 40, 42, 0.7);
  color: #aefefe;
  font-family: ui-monospace, monospace;
  font-size: 0.86em;
  line-height: 1.5;
}

.game-info p { margin: 0 0 10px; }
.game-info ul { margin: 0 0 12px; }
