* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Ubuntu', sans-serif;
  font-weight: 700;
  user-select: none;
  -webkit-user-drag: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #dbdbdb; 
  touch-action: none;
}

#home-screen {
  background-color: #dbdbdb;
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.08) 0.5px, transparent 2px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0.5px, transparent 2px);
  background-size: 50px 50px;
}

canvas {
  display: block;
}

#game {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.arras-text, .title-text, button, .xp-label, #level-text, #leaderboard-title {
  color: white;
  paint-order: stroke fill;
  stroke: #333333;
  stroke-width: 5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  -webkit-text-stroke: 1.5px #333333; 
}

.title-text {
  font-size: 52px;
  margin-bottom: 10px;
  stroke-width: 8px;
  -webkit-text-stroke: 2px #333333;
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(219, 219, 219, 0.5);
}

.overlay {
  background: rgba(0, 0, 0, 0.4); 
}

.hidden {
  display: none !important;
}

.panel {
  width: 380px;
  background: #eeeeee;
  border: 5px solid #444;
  border-radius: 8px;
  padding: 30px 25px;
  text-align: center;
  box-shadow: 0 8px 0 rgba(0,0,0,0.1); 
}

.small-text {
  font-size: 15px;
  color: #555;
  margin-bottom: 20px;
}

#username-input {
  width: 100%;
  padding: 12px;
  font-size: 18px;
  text-align: center;
  color: #333;
  background: #fff;
  border: 4px solid #444;
  border-radius: 6px;
  outline: none;
  margin-bottom: 12px;
}

button {
  width: 100%;
  padding: 12px;
  font-size: 22px;
  cursor: pointer;
  border: 4px solid #444;
  border-radius: 6px;
  transition: transform 0.05s, border-bottom 0.05s;
  border-bottom: 8px solid #444; /* 3D effect */
  margin-top: 5px;
}

.btn-green { background: #7bd46e; }
.btn-grey { background: #a3a3a3; }

button:active {
  transform: translateY(4px);
  border-bottom: 4px solid #444;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 6px solid #ccc;
  border-top-color: #7bd46e;
  border-radius: 50%;
  margin: 20px auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#xp-ui {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: 350px;
  z-index: 10;
  pointer-events: none;
}

#xp-header {
  display: flex;
  justify-content: center;
  margin-bottom: 5px;
}

#level-text {
  font-size: 20px;
}

.bar-wrap {
  width: 100%;
  border: 4px solid #444;
  border-radius: 6px;
  overflow: hidden;
  background: #555;
  margin-top: 4px;
}

.xp-bar-wrap { height: 16px; }
.hp-bar-wrap { height: 22px; }

#xp-bar { width: 0%; height: 100%; background: #ffe46b; transition: width 0.3s; }
#hp-bar { width: 100%; height: 100%; background: #85e37d; transition: width 0.2s; }

#leaderboard-ui {
  position: fixed;
  top: 15px;
  right: 15px;
  width: 180px;
  padding: 8px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.3);
  border: 4px solid #444;
  border-radius: 4px;
}

#leaderboard-title {
  text-align: center;
  font-size: 16px;
  margin-bottom: 6px;
  border-bottom: 2px solid rgba(255,255,255,0.1);
}

.lb-entry {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 2px;
}

#notif-container {
  position: fixed;
  left: 20px;
  bottom: 100px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 20;
}

.notif {
  background: rgba(0, 0, 0, 0.4);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  border-left: 4px solid #7bd46e;
  font-size: 13px;
  animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

#minimap-wrap {
  position: fixed;
  right: 15px;
  bottom: 15px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.1);
  border: 4px solid #444;
  border-radius: 4px;
}

@font-face {
    font-family: 'Game';
    src: url('https://static.florr.io/f73aca8408fb6cc409607f0ffe7c0e93aa88a4c5/Ubuntu-B.ttf') format('truetype');
    font-weight: 700;
}

:root {
    --g-bg-dark: #7e7e7e;
    --g-bg-light: #b7b7b7;
    --g-border: rgba(0, 0, 0, 0.2);
    --g-stroke: #4a4a4a;
    --btn-red: #BB5555;
    --btn-red-hover: #C16666;
}

.settings-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 46px;
    height: 46px;
    background-color: var(--florr-bg-light);
    border: 5px solid var(--florr-stroke);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    padding: 0;
    transition: filter 0.1s;
}

.settings-btn:hover {
    filter: brightness(1.1);
}

.settings-icon-bg {
    width: 30px;
    height: 30px;
    background-color: #2c2c2c;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.settings-icon-bg img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 75px;
    left: 15px;
    width: 340px;
    background-color: var(--g-bg-dark);
    border: 10px solid var(--g-border); 
    border-radius: 8px;
    pointer-events: auto;
    font-family: 'Game', 'Ubuntu', sans-serif;
    transition: transform 0.25s cubic-bezier(0, 0, 0.2, 1), opacity 0.2s;
    transform-origin: top left;
}

.modal-overlay.hidden .modal-content {
    transform: translateY(-20px) scaleY(0);
    opacity: 0;
    pointer-events: none;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
}

.modal-tabs {
    display: flex;
    gap: 6px;
    padding: 8px;
}

.tab-btn {
    padding: 8px 16px;
    border: 4px solid var(--g-stroke);
    border-radius: 8px;
    background: var(--g-bg-dark);
    color: #eee;
    font-family: 'Game', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: 0.1s;
}

.tab-btn.active {
    background: var(--g-bg-light);
    color: #333;
}

.modal-body {
    background: var(--g-bg-light);
    margin: 10px;
    border-radius: 5px;
    padding: 15px;
    min-height: 150px;
    border: 4px solid var(--g-stroke);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.close-btn {
    width: 34px;
    height: 34px;
    background-color: var(--btn-red);
    border: 4px solid #974545;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-btn:hover { background-color: var(--btn-red-hover); }

.close-btn::before, .close-btn::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 5px;
    background-color: #ccc;
    border-radius: 2px;
}
.close-btn::before { transform: rotate(45deg); }
.close-btn::after { transform: rotate(-45deg); }

.legal-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--g-bg-dark);
    border: 4px solid var(--g-stroke);
    border-radius: 6px;
    color: white;
    font-family: 'Game', sans-serif;
    cursor: pointer;
}

.stat-line {
    font-family: 'Game', sans-serif;
    font-size: 14px;
    margin-bottom: 5px;
    color: #222;
}

.token-box {
    background: #181818;
    color: #00ff41;
    padding: 8px;
    font-size: 11px;
    border: 3px solid var(--g-border);
    border-radius: 4px;
    word-break: break-all;
}

#turnstile-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #181818;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  gap: 20px;
}

#turnstile-overlay {
  color: #ffffff;
  font-family: 'Ubuntu', sans-serif;
  font-weight: bold;
  font-size: 70px;
  letter-spacing: 3px;
  user-select: none;
}

.verified-hidden {
  display: none !important;
}

.cf-turnstile {
  transform: scale(1.2);
}
