/*
 * Legacy Console Edition–inspired UI (CSS-only; no game textures).
 * "Mojangles" face: self-hosted WOFF2 from npm typeface-minecraft (MIT)
 * https://github.com/bs-community/typeface-minecraft — bitmap Minecraft-style glyphs.
 */

@font-face {
  font-family: "Mojangles";
  src: url("fonts/mojangles.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --dirt-dark: #3c2e1f;
  --dirt-mid: #5c4033;
  --dirt-light: #6b4c3a;
  --panel-top: #a89878;
  --panel-mid: #7d6e56;
  --panel-bottom: #5c5040;
  --panel-inset: #2a2218;
  --slot-bg: #101010;
  --slot-border-light: #a0a0a0;
  --slot-border-dark: #202020;
  --text-white: #ffffff;
  --text-shadow: #3f3f3f;
  --gold: #ffff55;
  --gold-dim: #c9c040;
  --stone-top: #d0d0d0;
  --stone-mid: #8b8b8b;
  --stone-bottom: #5a5a5a;
  --danger: #ff5555;
  --danger-shadow: #3f0000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Mojangles", ui-monospace, monospace;
  font-size: 1.55rem;
  line-height: 1.4;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
  color: var(--text-white);
  text-shadow: 2px 2px 0 var(--text-shadow);
  /* Dirt-like layered browns (console pause / menu feel) */
  background-color: var(--dirt-dark);
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 35%, rgba(0, 0, 0, 0.35) 100%),
    repeating-linear-gradient(
      0deg,
      var(--dirt-dark) 0px,
      var(--dirt-mid) 1px,
      var(--dirt-dark) 2px,
      var(--dirt-light) 3px,
      var(--dirt-mid) 5px
    ),
    radial-gradient(ellipse 120% 80% at 50% 20%, #6b5344 0%, var(--dirt-dark) 55%);
  background-attachment: fixed;
}

/* Vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 50% 45%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
  /* Wide enough for uid path lines on one row inside the card */
  max-width: min(100% - 1.5rem, 58rem);
  margin: 0 auto;
  padding: 2.1rem 1.15rem 2.75rem;
}

h1 {
  font-size: 2.35rem;
  font-weight: normal;
  margin: 0 0 0.45rem;
  letter-spacing: 0.02em;
  color: var(--gold);
  text-shadow: 2px 2px 0 #3f3f00, 3px 3px 0 rgba(0, 0, 0, 0.45);
  text-align: center;
}

.sub {
  font-size: 1.35rem;
  color: #e0e0e0;
  margin: 0 0 1.5rem;
  text-align: center;
  text-shadow: 2px 2px 0 var(--text-shadow);
}

/* Inventory / chest-style panel */
.card {
  background: linear-gradient(180deg, var(--panel-top) 0%, var(--panel-mid) 45%, var(--panel-bottom) 100%);
  border: 5px solid;
  border-color: #d8c8a8 var(--panel-inset) var(--panel-inset) #d8c8a8;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.2),
    inset -1px -1px 0 rgba(0, 0, 0, 0.35),
    0 7px 0 rgba(0, 0, 0, 0.4),
    0 12px 28px rgba(0, 0, 0, 0.5);
  padding: 1.35rem 1.15rem 1.45rem;
  color: var(--text-white);
}

.card label {
  text-shadow: 2px 2px 0 var(--text-shadow);
}

label {
  display: block;
  font-size: 1.25rem;
  color: #f5f0e0;
  margin-bottom: 0.45rem;
}

/* Slot-style fields (hotbar / text field) */
input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 4px solid;
  border-color: var(--slot-border-dark) #505050 #707070 var(--slot-border-dark);
  font-family: inherit;
  font-size: 1.35rem;
  color: #ffffff;
  background: var(--slot-bg);
  text-shadow: 2px 2px 0 #000;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.6);
}

input[type="text"]::placeholder {
  color: #707070;
  text-shadow: none;
}

input[type="text"]:focus {
  outline: none;
  border-color: #000 var(--gold-dim) var(--gold-dim) #000;
  box-shadow:
    inset 2px 2px 0 rgba(0, 0, 0, 0.6),
    0 0 0 2px rgba(255, 255, 85, 0.35);
}

button {
  font-family: inherit;
  font-size: 1.3rem;
  cursor: pointer;
  margin-top: 0.8rem;
  text-shadow: 2px 2px 0 #000;
}

/* Stone button (primary actions) */
.btn-primary {
  width: 100%;
  padding: 0.65rem 1rem;
  color: #ffffff;
  border: 4px solid;
  border-color: #ffffff #303030 #303030 #ffffff;
  background: linear-gradient(180deg, var(--stone-top) 0%, var(--stone-mid) 45%, var(--stone-bottom) 100%);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #e8e8e8 0%, #9a9a9a 45%, #6a6a6a 100%);
  color: var(--gold);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: #ccc;
}

/* Secondary / sign out — flat brown chip */
.btn-ghost {
  background: linear-gradient(180deg, #6a5a48 0%, #4a3d32 100%);
  border: 4px solid;
  border-color: #8a7a68 #2a2218 #2a2218 #8a7a68;
  color: #e8dcc8;
  margin-top: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.8rem;
  font-size: 1.2rem;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.btn-ghost:hover {
  color: var(--gold);
}

.btn-ghost:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: linear-gradient(180deg, #5a6a78 0%, #3a4550 100%);
  border: 4px solid;
  border-color: #7a8a98 #1a2228 #1a2228 #7a8a98;
  color: #e8eef4;
  padding: 0.45rem 0.65rem;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.btn-secondary:hover {
  color: var(--gold);
}

.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-small {
  margin-top: 0.75rem;
  font-size: 1.05rem;
}

.cloud-save .cloud-save-buttons {
  flex-wrap: wrap;
}

.cloud-save-status {
  margin-top: 0.5rem;
  font-size: 1.1rem;
  line-height: 1.35;
}

.cloud-save-status.muted {
  color: #b8a898;
}

.btn-danger {
  background: transparent;
  border: none;
  color: var(--danger);
  padding: 0.35rem 0.6rem;
  margin: 0;
  font-size: 1.2rem;
  text-shadow: 2px 2px 0 var(--danger-shadow);
  box-shadow: none;
}

.btn-danger:hover {
  color: #ff8888;
  text-decoration: underline;
}

.row {
  display: flex;
  gap: 0.55rem;
  align-items: flex-end;
  margin-top: 1rem;
}

.row input {
  flex: 1;
  margin: 0;
}

.row .btn-primary {
  width: auto;
  margin: 0;
  white-space: nowrap;
  min-width: 5.5rem;
}

.error {
  margin-top: 0.8rem;
  padding: 0.6rem 0.75rem;
  background: #3f1515;
  border: 4px solid;
  border-color: #8b3030 #201010 #201010 #8b3030;
  color: #ffaaaa;
  font-size: 1.2rem;
  text-shadow: 2px 2px 0 #300000;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.hidden {
  display: none !important;
}

/* Multi-page nav */
.site-header {
  position: relative;
  z-index: 2;
  max-width: min(100% - 1.5rem, 58rem);
  margin: 0 auto;
  padding: 1rem 1.15rem 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  padding: 0.5rem 0.65rem;
  background: linear-gradient(180deg, var(--panel-top) 0%, var(--panel-mid) 45%, var(--panel-bottom) 100%);
  border: 4px solid;
  border-color: #d8c8a8 var(--panel-inset) var(--panel-inset) #d8c8a8;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.2),
    inset -1px -1px 0 rgba(0, 0, 0, 0.35),
    0 4px 0 rgba(0, 0, 0, 0.4);
}

.site-nav .nav-link {
  font-size: 1.25rem;
  color: #f5f0e0;
  text-decoration: none;
  text-shadow: 2px 2px 0 var(--text-shadow);
  padding: 0.2rem 0.35rem;
  border-bottom: 2px solid transparent;
}

.site-nav .nav-link:hover {
  color: var(--gold);
  text-shadow: 2px 2px 0 #3f3f00;
}

.site-nav .nav-link-active {
  color: var(--gold);
  text-shadow: 2px 2px 0 #3f3f00;
  border-bottom-color: var(--gold-dim);
  pointer-events: none;
}

.inline-link {
  color: var(--gold);
  text-decoration: underline;
  text-shadow: 2px 2px 0 #3f3f00;
}

.inline-link:hover {
  color: #ffffaa;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.dashboard-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.28) 100%);
  border: 4px solid;
  border-color: #c8b898 #2a2218 #2a2218 #c8b898;
  padding: 1rem 0.9rem 1.1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.05s ease, filter 0.05s ease;
}

.dashboard-card:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.dashboard-card h2 {
  font-size: 1.5rem;
  font-weight: normal;
  margin: 0 0 0.4rem;
  color: var(--gold);
  text-shadow: 2px 2px 0 #3f3f00;
}

.dashboard-card p {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  line-height: 1.35;
  color: #e8e0d8;
  text-shadow: 2px 2px 0 var(--text-shadow);
}

.dashboard-card-cta {
  font-size: 1.2rem;
  color: #b8e8ff;
  text-shadow: 2px 2px 0 #203040;
}

.session-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: #d8d0c8;
  text-shadow: 2px 2px 0 var(--text-shadow);
  padding: 0.45rem 0.3rem;
}

.session-bar strong {
  color: var(--gold);
  font-weight: normal;
  text-shadow: 2px 2px 0 #3f3f00;
}

.card #app-error,
.card #cloud-error {
  margin-top: 0.65rem;
}

/* Add friend / Friend requests / Friends — shared section chrome */
.social-section h2 {
  font-size: 1.45rem;
  font-weight: normal;
  margin: 1.25rem 0 0.35rem;
  color: var(--gold);
  text-shadow: 2px 2px 0 #3f3f00;
  border-bottom: 2px solid rgba(0, 0, 0, 0.35);
  padding-bottom: 0.25rem;
}

.social-section:first-of-type h2 {
  margin-top: 0;
}

.social-section-body {
  margin: 0;
  padding: 0.15rem 0 0.35rem;
}

.add-friend .add-friend-row {
  margin-top: 0;
  padding: 0.55rem 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.25);
}

.add-friend .add-friend-row .btn-primary {
  margin-top: 0;
}

.social-section-note {
  margin: 0.35rem 0 0;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1.35;
  color: #c0b8a8;
  text-shadow: 2px 2px 0 var(--text-shadow);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.friend-requests .empty {
  margin: 0;
  padding: 0.15rem 0 0.35rem;
}

#friend-requests-list {
  margin: 0;
}

.friend-request-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.friend-request-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.25);
  font-size: 1.25rem;
}

.friend-request-list li:last-child {
  border-bottom: none;
}

.friend-request-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.35rem;
  align-items: center;
}

.btn-icon {
  font-family: inherit;
  font-size: 1.35rem;
  line-height: 1;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  margin: 0;
  border: 3px solid;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.btn-icon:active {
  transform: translateY(1px);
}

.btn-accept {
  color: #fff;
  background: linear-gradient(180deg, #4caf50 0%, #2e7d32 100%);
  border-color: #a5d6a7 #1b5e20 #1b5e20 #a5d6a7;
  text-shadow: 2px 2px 0 #1b5e20;
}

.btn-accept:hover {
  background: linear-gradient(180deg, #66bb6a 0%, #388e3c 100%);
  color: #fff;
}

.btn-decline {
  color: #fff;
  background: linear-gradient(180deg, #e57373 0%, #c62828 100%);
  border-color: #ffcdd2 #5c0000 #5c0000 #ffcdd2;
  text-shadow: 2px 2px 0 #5c0000;
}

.btn-decline:hover {
  background: linear-gradient(180deg, #ef9a9a 0%, #d32f2f 100%);
  color: #fff;
}

#friend-list {
  margin: 0;
}

.friends .empty {
  margin: 0;
  padding: 0.15rem 0 0.35rem;
}

.friend-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.friend-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.25);
  font-size: 1.25rem;
}

.friend-list li:last-child {
  border-bottom: none;
}

.friend-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.friend-meta .name {
  color: #fff;
}

.friend-meta .id {
  font-size: 1.05rem;
  color: #b0a898;
  text-shadow: 1px 1px 0 #000;
  word-break: break-all;
}

.friend-meta .friend-status.pending {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
  font-weight: normal;
  color: var(--gold-dim);
  text-shadow: 2px 2px 0 #3f3f00;
}

.empty {
  color: #c0b8a8;
  font-size: 1.2rem;
  padding: 0.5rem 0;
  text-shadow: 2px 2px 0 var(--text-shadow);
}

.hint {
  font-size: 1.1rem;
  color: #d4c8b0;
  margin-top: 0.55rem;
  text-shadow: 2px 2px 0 var(--text-shadow);
}

.hint-paths {
  max-width: 100%;
}

.hint-paths .hint-row {
  margin: 0 0 0.4rem;
  max-width: 100%;
  line-height: 1.45;
  white-space: nowrap;
}

.hint-paths .hint-row:last-child {
  margin-bottom: 0;
}

.hint-path {
  display: inline;
  font-family: inherit;
  font-size: 0.95em;
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.1rem 0.3rem;
  border: 2px solid;
  border-color: #2a2218 #8a7a60 #8a7a60 #2a2218;
  text-shadow: none;
  white-space: nowrap;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hint-suffix {
  white-space: nowrap;
}

/* Login card: panel width follows the uid hint lines (one line each), up to main max-width */
#screen-login {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  overflow-x: auto;
}

/* Small phones: wrap paths again instead of a wide scroll */
@media (max-width: 26rem) {
  .hint-paths .hint-row {
    white-space: normal;
  }

  .hint-path,
  .hint-suffix {
    white-space: normal;
  }

  .hint-path {
    overflow-wrap: anywhere;
    word-break: break-all;
  }
}

.hint code {
  font-family: inherit;
  font-size: 0.92em;
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.05rem 0.25rem;
  border: 2px solid;
  border-color: #2a2218 #8a7a60 #8a7a60 #2a2218;
  text-shadow: none;
}
