body {
  margin: 0;
  background: #d8eaf7;
  font-family: 'Segoe UI', Verdana, Arial, sans-serif;
  color: #233;
}
.btn-upgrade, .btn-brand {
  background: linear-gradient(90deg, #72b7f2 70%, #3896e3 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1em;
  border: none;
  border-radius: 8px;
  padding: 7px 13px;
  cursor: pointer;
  box-shadow: 0 2px 6px #6fc1f022;
  transition: background .18s, transform .13s;
  outline: none;
  font-family: inherit;
}
.btn-upgrade:active, .btn-brand:active {
  background: #1973ad;
  transform: scale(.97);
}
header {
  display: flex;
  align-items: center;
  background: #5a90c8;
  color: #fff;
  padding: 11px 17px 10px 23px;
  border-bottom: 2px solid #0a345d18;
  font-size: 1.21em;
  user-select: none;
}

header h1 {
  font-weight: 800;
  margin: 0;
  letter-spacing: 1px;
}
header .remastered {
  font-size: .5em;
  font-weight: 400;
  color: #ffe24b;
  background: #304e81;
  border-radius: 7px;
  padding: 1px 8px 1px 8px;
  margin-left: 8px;
}

.container {
  display: flex;
  align-items: flex-start;
  max-width: 1380px;
  margin: 23px auto 0 auto;
  gap: 36px;
  padding: 0 14px 0 14px;
}

aside {
  flex: 0 0 260px;
  min-width: 220px;
  margin-bottom: 22px;
  background: #eaf3fc;
  border-radius: 13px;
  padding: 16px 14px 19px 14px;
  box-shadow: 0 2px 18px #99b9d822;
}

#center {
  flex: 1 1 auto;
  min-width: 340px;
  background: #f7fcfe;
  border-radius: 13px;
  padding: 22px 18px 21px 21px;
  box-shadow: 0 2px 20px #bae0ef28;
}

.stats {
  display: flex;
  gap: 20px;
  font-size: 1.07em;
  margin-bottom: 12px;
}
.stats > div {
  background: #e3f2ff;
  border-radius: 8px;
  padding: 4px 10px;
  font-weight: 600;
}

#event-banner {
  color: #f45b12;
  font-weight: 700;
  text-align: center;
  margin: 9px 0 7px 0;
  font-size: 1.11em;
  min-height: 24px;
}

.queue-section {
  margin-bottom: 17px;
  overflow-x: auto;
  background: #f8fbff;
  border-radius: 10px;
  min-height: 110px;
  max-width: 700px;
  width: 98%;
}
#queue {
  display: flex;
  flex-direction: row;
  gap: 8px;
  min-height: 102px;
  width: max-content;
}
.customer {
  background: #fff;
  border: 2px solid #a4b6c8;
  border-radius: 14px;
  padding: 7px 9px 6px 9px;
  min-width: 84px;
  min-height: 89px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 7px #9992;
  font-size: 1.17em;
  position: relative;
  line-height: 1.15;
}
.customer.vip { border-color: #ffd94b; }
.customer.angry { border-color: #d82029; }
.customer .avatar {
  font-size: 2.1em;
  margin-bottom: 2px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}
.customer .brand-tag {
  font-size: .92em;
  color: #1973ad;
  font-weight: 700;
}
.customer .timer {
  font-size: .92em;
  color: #334a;
}

.actions {
  margin: 17px 0 13px 0;
  display: flex;
  gap: 18px;
}

.main-action, #serve-btn, #restock-all-btn, #save-btn, #load-btn, #reset-btn, #btn-username {
  background: linear-gradient(90deg, #72b7f2 70%, #3896e3 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1em;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  margin-bottom: 7px;
  box-shadow: 0 2px 6px #6fc1f022;
  transition: background .18s, transform .13s;
  outline: none;
  font-family: inherit;
}
.main-action:active, #serve-btn:active, #restock-all-btn:active {
  background: #256bc2;
  transform: scale(.98);
}
#serve-btn { font-size: 1.25em; padding: 13px 28px; }
#combo {
  margin: 7px 0 0 0;
  font-weight: 700;
  color: #1d8f2c;
  font-size: 1.11em;
  text-align: right;
}

.brands, .store {
  margin-top: 13px;
  margin-bottom: 9px;
}
.brand-row, .upgrade, .inv {
  background: #f4f9fd;
  border-radius: 9px;
  margin: 6px 0;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 13px;
  justify-content: space-between;
  font-size: 1em;
  box-shadow: 0 1px 7px #d2e2ff0e;
}
.brand-row { font-weight: 700; }
.upgrade { color: #245dbb; }
#inventory input[type="number"] {
  width: 38px;
  padding: 2px 3px;
  border-radius: 7px;
  border: 1px solid #b4e2f2;
  background: #eef9fd;
  font-size: .97em;
}

.tt-parent { position: relative; cursor: pointer; }
.tt {
  display: none;
  position: absolute;
  left: 0; top: 29px;
  background: #f8ffe1;
  color: #155;
  border: 1px solid #bdfed9;
  border-radius: 7px;
  padding: 6px 9px;
  font-size: .95em;
  z-index: 20;
  width: 182px;
  box-shadow: 0 2px 12px #6fd99423;
}
.tt-parent:hover .tt { display: block; }

#prestige-panel {
  background: #f6f2e9;
  border-radius: 9px;
  padding: 7px 11px;
  margin-bottom: 13px;
  font-size: 1em;
  box-shadow: 0 1px 7px #e6e5e216;
}
#prestige-btn {
  margin-top: 10px;
  width: 96%;
  background: linear-gradient(90deg, #ebc244 70%, #ffbc43 100%);
  color: #252012;
  font-weight: 700;
}

#progress-bar {
  width: 98%;
  height: 17px;
  background: #e0f3fa;
  border-radius: 8px;
  margin-bottom: 2px;
  margin-top: 2px;
  box-shadow: 0 1px 5px #b8e0f422;
}
#progress-fill {
  height: 17px;
  border-radius: 8px;
  background: linear-gradient(90deg, #81f49d 80%, #56d46c 100%);
  width: 15%;
  transition: width .22s;
}
#progress-info {
  font-size: 1em;
  margin-bottom: 11px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin: 28px 0 21px 0;
}
#ver {
  margin-left: 27px;
  font-size: .97em;
  color: #888;
}

.floating-btns {
  position: fixed;
  bottom: 36px;
  left: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 9002;
}
.float-btn {
  background: #2777b9;
  border-radius: 50%;
  width: 51px; height: 51px;
  color: #fff;
  border: 3px solid #ffd94b;
  box-shadow: 0 2px 16px #c7b21225;
  cursor: pointer;
  transition: background .13s, box-shadow .12s, transform .12s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.float-btn:hover { background: #0a345d; transform: scale(1.09); }
.float-emoji {
  font-size: 1.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.float-box {
  position: fixed;
  top: 54%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 38px #0002, 0 0px 1px #0003;
  min-width: 310px;
  max-width: 96vw;
  min-height: 120px;
  display: none;
  padding: 20px 18px;
}
.float-box.open { display: block !important; }
@media (max-width: 700px) {
  .float-box { width: 98vw !important; min-width: unset; max-width:98vw; }
}
.float-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.16em;
  background: #f2f8ff;
  border-radius: 10px 10px 0 0;
  padding: 7px 9px 7px 13px;
  margin: -20px -18px 12px -18px;
  border-bottom: 1px solid #eee;
}

#chat-messages {
  height: 160px;
  overflow-y: auto;
  background: #f2f8ff;
  border-radius: 7px;
  padding: 6px 7px 7px 7px;
  margin-bottom: 8px;
  font-size: 1em;
}
#chat-input { width: 73%; border-radius: 7px; border: 1px solid #b4e2f2; padding: 4px 6px; }
#chat-send-btn { margin-left: 5px; }
#achievements-list {
  max-height: 280px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}
.ach-icon { font-size: 1.27em; margin-right: 9px; }
.ach-locked { color: #bfb9b9; }
#leaderboard-list {
  max-height: 290px;
  overflow-y: auto;
  font-size: 1.04em;
  padding: 3px 0;
}
.toast-ach {
  background: #fff9e2;
  color: #9e780c;
  border: 2px solid #ffe24b;
  border-radius: 11px;
  padding: 9px 13px 7px 13px;
  box-shadow: 0 2px 14px #eddc952a;
  font-size: 1.09em;
  position: fixed;
  right: 34px; bottom: 49px;
  z-index: 10999;
  min-width: 172px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  animation: toastIn .4s;
}
@keyframes toastIn {
  0% { opacity: 0; transform: translateY(60px);}
  100% { opacity: 1; transform: translateY(0);}
}
#achievement-toast.show { display: block; }
#achievement-toast:not(.show) { display: none; }

.modal {
  display: none;
  position: fixed;
  z-index: 9988;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: #1b2e4959;
  justify-content: center;
  align-items: center;
}
.modal.open { display: flex !important; }
.modal-content {
  background: #fff;
  border-radius: 14px;
  padding: 27px 23px 18px 23px;
  max-width: 97vw;
  box-shadow: 0 2px 32px #5dc7e233;
  min-width: 180px;
  min-height: 82px;
  position: relative;
}
.modal-content button {
  background: linear-gradient(90deg, #72b7f2 70%, #3896e3 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1em;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  margin: 9px 4px 0 0;
  box-shadow: 0 2px 6px #6fc1f022;
  transition: background .18s, transform .13s;
  outline: none;
  font-family: inherit;
}
.modal-content button:active { background: #256bc2; }

.skilltree-container {
  display: flex;
  flex-direction: column; /* instead of row/wrap */
  gap: 28px;
  overflow-y: auto;
  max-height: 80vh; /* or another suitable value */
  padding-right: 12px;
}
.skilltree-branch {
  min-width: unset;
  width: 99%;
}
.skilltree-branch-header {
  font-size: 1.15em;
  font-weight: 700;
  margin-bottom: 13px;
  color: #8449ff;
  background: #efe6ff;
  border-radius: 7px;
  padding: 5px 8px 5px 12px;
}
.skilltree-node2 {
  background: #fff;
  border-radius: 10px;
  padding: 10px 9px;
  margin-bottom: 13px;
  border: 2.3px solid #bfa9ea;
  text-align: center;
  box-shadow: 0 1px 10px #dfd3fd25;
  font-size: 1.04em;
  cursor: pointer;
  position: relative;
  transition: box-shadow .14s, border .12s;
}
.skilltree-node2.unlocked {
  border: 2.3px solid #43cf5e;
  box-shadow: 0 2px 8px #98e1b333;
  background: #f0fff7;
  color: #29a63b;
}
.skilltree-node2.available {
  border: 2.3px solid #ffd94b;
  box-shadow: 0 2px 8px #ffe24b55;
  background: #fffef4;
  color: #c59a09;
}
.skilltree-node2.locked {
  border: 2.3px solid #d0d0d0;
  background: #f8f7fc;
  color: #c4b1e3;
  opacity: .56;
}
.skilltree-node2.cosmetic, .skilltree-branch-cosmetic {
  border: 2.3px solid #d45bed;
  background: #fbeeff;
  color: #d45bed;
}
.skilltree-branch-cosmetic {
  color: #bc19e2;
  background: #f7eaff;
  border-radius: 7px;
  font-weight: 700;
  margin-bottom: 13px;
  padding: 5px 8px 5px 12px;
  border-left: 8px solid #d45bed;
}
.skilltree-node2 .unlocked-text {
  color: #29a63b;
  font-size: .95em;
  font-weight: 700;
}
.skilltree-node2 .locked-icon {
  font-size: 1.25em;
  color: #d9b6ef;
}
.skilltree-connect {
  width: 3px;
  height: 25px;
  background: #bfa9ea;
  margin: 0 auto;
  border-radius: 3px;
}

.mini-challenge {
  background: #ecfddc;
  border-radius: 8px;
  padding: 5px 12px;
  margin-top: 11px;
  font-size: .98em;
  color: #256b28;
  font-weight: 600;
}
.mini-challenge.done {
  background: #d3f9ff;
  color: #4aa2c5;
  text-decoration: line-through;
}

#modal-minigame .modal-content {
  background:rgba(25, 115, 173, 0.98);
  color: #fff;
  font-weight: 700;
  font-size: 1em;
  border: none;
  border-radius: 8px;
  padding: 14px 18px;
  min-width: 220px;
  min-height: 90px;
  box-shadow: 0 2px 8px #b85ed122;
}
#minigame-btn, #minigame-submit {
  background: white;
  color: rgba(25, 115, 173, 0.98);
  font-weight: 700;
  font-size: 1em;
  border: none;
  border-radius: 8px;
  padding: 7px 15px 8px 15px;
  cursor: pointer;
  margin-top: 11px;
  box-shadow: 0 2px 6px #e287ff22;
  line-height: 1.2;
}
#minigame-btn:active, #minigame-submit:active {
  background: #b85ed1;
}
#minigame-result {
  margin-top: 14px;
  font-size: 1.15em;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .container { flex-direction: column; }
  aside, #center { max-width: 99vw; width: 99vw; }
  .skilltree-container { max-width: 99vw; }
}
@media (max-width: 680px) {
  header { flex-direction: column; align-items: flex-start; }
  .container { flex-direction: column; gap: 11px; }
  aside, #center { max-width: 100vw; width: 100vw; }
  .float-btn { width: 41px; height: 41px; font-size: 1.41em; }
  .queue-section { max-width: 98vw; }
}
