html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background-color: #718c5a;
}

html {
  overflow: hidden
}

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline
}

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  line-height: 1;
  color: white;
}

.canvas_div {
  position: absolute;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch
}

canvas {
  padding: 0;
  display: block;
  width: 100%;
  height: calc(100% - 30px);
  position: absolute;
}

.bar>.scoreboard {
  display: flex;
  align-items: center;
  margin-right: 60px;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bar>.scoreboard .score {
  width: 45px;
  overflow: hidden;
  text-align: center;
  font-size: 1.4rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.bar>.scoreboard .teamicon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.bar>.scoreboard .teamicon.blue {
  background: linear-gradient(135deg, #74b9ff, #0984e3);
}

.bar>.scoreboard .teamicon.red {
  background: linear-gradient(135deg, #ff7675, #d63031);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 26, 22, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 24px;
  border-radius: 0 0 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  font: 900 22px 'Arial Black', Arial, sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.game-timer-view {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.game-timer-view>.overtime {
  margin-right: 20px;
  visibility: hidden
}

.game-timer-view>.overtime.on {
  visibility: visible;
  animation: 0.4s linear overtime-appear
}

.game-timer-view>.digit {
  width: 15px;
  text-align: center
}

.game-timer-view.time-warn {
  animation: 0.3s infinite alternate linear time-warn
}

@keyframes time-warn {
  from {
    color: white
  }

  to {
    color: #ff8080
  }
}

@keyframes overtime-appear {
  from {
    opacity: 0;
    transform: translateY(-25px)
  }
}

.bar-container {
  position: absolute;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 1
}

input {
  cursor: pointer;
  left: 0%;
}

/* Classic Haxball Style UI */
.hax-lobby {
  position: fixed;
  inset: 0;
  background-color: #718c5a;
  /* HaxBall Grass */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  font-family: Arial, Tahoma, sans-serif;
  color: #e8e8e8;
}

.hax-lobby.hidden,
.hax-window-content.hidden,
.hidden {
  display: none !important;
}

.hax-window {
  background: #2b2b2b;
  border: 1px solid #111;
  border-radius: 4px;
  width: 600px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.hax-window-header {
  background: #1e1e1e;
  border-bottom: 1px solid #111;
  padding: 8px 12px;
  font-weight: bold;
  font-size: 14px;
  color: #fff;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.hax-window-content {
  padding: 20px;
}

.hax-row {
  margin-bottom: 15px;
}

.hax-row.center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hax-row label {
  font-size: 14px;
  margin-right: 10px;
  color: #ccc;
}

.hax-input {
  background: #1e1e1e;
  border: 1px solid #404040;
  color: #fff;
  padding: 6px 10px;
  border-radius: 2px;
  font-size: 14px;
  outline: none;
}

.hax-input:focus {
  border-color: #5ebd5e;
}

.hax-btn {
  background: linear-gradient(to bottom, #444, #333);
  border: 1px solid #111;
  color: #fff;
  padding: 6px 15px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  text-shadow: 0 1px 1px #000;
}

.hax-btn:hover {
  background: linear-gradient(to bottom, #4d4d4d, #3c3c3c);
}

.hax-btn:active {
  background: #2b2b2b;
}

.hax-btn.large {
  padding: 10px 20px;
  font-size: 15px;
}

.hax-btn.start-btn {
  background: linear-gradient(to bottom, #5ebd5e, #3a7c3a);
}

.hax-btn.start-btn:hover {
  background: linear-gradient(to bottom, #6cd16c, #428d42);
}

.mt-5 {
  margin-top: 5px;
}

.mb-5 {
  margin-bottom: 5px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-10 {
  margin-bottom: 10px;
}

.ml-10 {
  margin-left: 10px;
}

.full-width {
  width: 100%;
  box-sizing: border-box;
}

.hax-layout {
  display: flex;
  gap: 20px;
}

.hax-left-panel {
  flex: 2;
  background: #222;
  border: 1px solid #111;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
}

.hax-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hax-panel-title {
  background: #1e1e1e;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: bold;
  border-bottom: 1px solid #111;
  color: #999;
}

.hax-room-list {
  min-height: 200px;
  max-height: 200px;
  overflow-y: auto;
  padding: 5px;
}

.room-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px;
  background: #2b2b2b;
  border-bottom: 1px solid #1f1f1f;
  font-size: 13px;
}

.room-list-item:hover {
  background: #333;
}

.room-join-btn {
  background: #444;
  border: 1px solid #111;
  color: white;
  border-radius: 2px;
  padding: 3px 8px;
  cursor: pointer;
}

.room-join-btn:hover {
  background: #5ebd5e;
}

.hax-box {
  background: #222;
  border: 1px solid #111;
  border-radius: 3px;
  padding: 10px;
  font-size: 13px;
  color: #ccc;
}

.hax-btn-group {
  display: flex;
  gap: 5px;
}

.hax-btn-group .hax-btn {
  flex: 1;
}

.hax-lobby-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.room-title {
  font-size: 18px;
  font-weight: bold;
}

.highlight {
  color: #5ebd5e;
}

.hax-players-box {
  background: #222;
  border: 1px solid #111;
  border-radius: 3px;
  min-height: 150px;
  margin-bottom: 15px;
}

.hax-teams-container {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  gap: 15px;
  min-height: 150px;
}

.hax-team-box {
  flex: 1;
  background: #2b2b2b;
  border: 1px solid #1f1f1f;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
}

.team-header {
  padding: 6px;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  border-bottom: 1px solid #1f1f1f;
  text-shadow: 1px 1px 0 #000;
}

.team-header.red {
  background: linear-gradient(135deg, #a73c3c, #852222);
  color: white;
}

.team-header.blue {
  background: linear-gradient(135deg, #3c65a7, #224385);
  color: white;
}

.team-header.spec {
  background: linear-gradient(135deg, #5ebd5e, #3a7c3a);
  color: white;
}

.hax-player-list {
  list-style: none;
  margin: 0;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 100px;
}

.hax-player-list li {
  padding: 5px;
  background: #2b2b2b;
  border: 1px solid #1f1f1f;
  border-radius: 2px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-name {
  margin-left: 5px;
  flex: 1;
}

.hax-room-footer {
  text-align: right;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 40px;
}

.hax-waiting {
  color: #fbd38d;
  font-size: 13px;
}

.hax-error {
  color: #fc8181;
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
}

.game-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.game-screen.hidden {
  display: none !important;
}

/* Admin actions next to player names */
.player-admin-btns {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.btn-admin-small {
  padding: 4px 8px;
  border: 1px solid #111;
  border-radius: 2px;
  font-weight: bold;
  font-size: 0.75rem;
  cursor: pointer;
  background: linear-gradient(to bottom, #444, #333);
  color: #fff;
}

.btn-admin-small:hover {
  background: linear-gradient(to bottom, #4d4d4d, #3c3c3c);
}

.btn-admin-small.team-red:hover {
  background: #e56e56;
}

.btn-admin-small.team-blue:hover {
  background: #5689e5;
}

.btn-admin-small.kick {
  color: #ffeaa7;
}

.btn-admin-small.ban {
  color: #ff7675;
}

.btn-admin-small.kick:hover {
  background: #ffeaa7;
  color: #2d3436;
}

.btn-admin-small.ban:hover {
  background: #ff7675;
  color: #fff;
}

/* Chat System - Fixed Overlay */
.chat-container {
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 200px;
  background: rgba(0, 0, 0, 0.4);
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  display: flex;
  flex-direction: column;
  z-index: 101;
  font-family: Arial, Tahoma, sans-serif;
}

.chat-container.hidden {
  display: none;
}

.chat-header {
  display: none;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  font-size: 13px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  display: flex;
  flex-direction: column;
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.4);
}

.chat-messages .chat-msg {
  margin-bottom: 4px;
  word-break: break-word;
}

.chat-messages .chat-msg .chat-name {
  color: #ffeb3b;
  font-weight: bold;
}

.chat-messages .chat-msg.own .chat-name {
  color: #aeea00;
}

.chat-form {
  display: flex;
  padding: 5px;
  background: rgba(0, 0, 0, 0.3);
}

.chat-form input {
  flex: 1;
  padding: 4px 6px;
  border: 1px solid #222;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  outline: none;
  font-family: inherit;
}

.chat-form input:focus {
  border-color: #555;
}

.chat-send-btn {
  display: none;
}

/* System Chat Message */
.system-msg {
  color: #ffeb3b !important;
  font-style: italic;
  font-weight: bold;
}

/* Admin In-Game Settings Button */
.game-admin-settings-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #5ebd5e;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.game-admin-settings-btn.hidden {
  display: none !important;
}

.game-admin-settings-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: #72d672;
}

/* In-Game Admin Modal */
.in-game-admin-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.in-game-admin-modal.hidden {
  display: none !important;
}