:root{
  --bg:#121213; --tile:#121213; --text:#d7dadc;
  --tile-border:#3a3a3c; --absent:#3a3a3c; --present:#b59f3b; --correct:#538d4e;
}
*{box-sizing:border-box}
html,body{height:100%;}
body{
  margin:0;padding:24px;font-family:system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;
  background:var(--bg);color:var(--text);display:flex;align-items:flex-start;justify-content:center;
}
main{width:100%;max-width:700px}
h1{margin:0 0 8px;font-weight:700}
.subtitle{margin:0 0 18px;color:#9aa0a6}

#game{display:flex;flex-direction:column;gap:18px;align-items:center}
#board{display:grid;grid-template-rows:repeat(6,1fr);gap:5px}
.row{display:flex;gap:5px}
.tile{width:64px;height:64px;border:2px solid var(--tile-border);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:32px;text-transform:uppercase;background:var(--tile);color:var(--text);transition:background 0.3s,border-color 0.3s}
.tile.correct{background:var(--correct);border-color:var(--correct)}
.tile.present{background:var(--present);border-color:var(--present)}
.tile.absent{background:var(--absent);border-color:var(--absent)}

/* keyboard */
#keyboard{display:flex;flex-direction:column;gap:8px}
.keyrow{display:flex;gap:6px;justify-content:center}
.key{min-width:43px;padding:14px 6px;border-radius:6px;background:#818384;color:#fff;border:none;font-weight:700;cursor:pointer;text-transform:uppercase;font-size:14px}
.key.wide{min-width:65px;padding:14px 12px}
.key.absent{background:var(--absent)}
.key.present{background:var(--present)}
.key.correct{background:var(--correct)}

#message{min-height:1.5em;margin-top:6px;color:#fff}
.controls{margin-top:12px}
button{font-weight:700;padding:8px 12px;border-radius:6px;border:none;cursor:pointer}

@media (max-width:520px){
  body{padding:16px 12px}
  .tile{width:48px;height:48px;font-size:24px}
  /* let the keys share the row instead of overflowing the screen */
  #keyboard{width:100%}
  .keyrow{gap:4px}
  .keyrow:nth-child(2){padding:0 5%}
  .key{flex:1 1 0;min-width:0;padding:14px 0;font-size:13px}
  .key.wide{flex:1.5 1 0;min-width:0;padding:14px 0;font-size:11px}
}
@media (max-width:350px){
  .key.wide{font-size:9px}
}
