/* ============================================================================
   styles.css — the APPEARANCE of the Blockwatch page.

   CSS (Cascading Style Sheets) controls how things look: colour, size, spacing,
   position. It does not add content and it does not add behaviour.

   Every CSS rule has the same shape:

       selector { property: value; property: value; }

   The SELECTOR says which elements to style. The things inside the braces are
   DECLARATIONS, each one a property and the value to give it.

   Selectors used in this file:
       body        a tag name  — every <body> element
       .card       a class     — every element with class="card"
       #id         an id       — the one element with that id (not used here)
       .btn:hover  a pseudo-class — only while the mouse is over it
       a b         a descendant — a <b> anywhere inside an <a>
       a > b       a direct child — a <b> whose immediate parent is an <a>

   "Cascading" means that when two rules target the same element, the more
   specific one wins, and on a tie the one written later in the file wins.

   This is an EXTERNAL stylesheet: it is its own file, and index.html pulls it in
   with <link rel="stylesheet" href="styles.css">. The alternative would be
   "embedded" CSS inside a <style> block in the HTML, or "inline" CSS in a
   style="..." attribute on one tag. External is both tidier and required here,
   because the page's Content Security Policy sets style-src 'self'.
   ============================================================================ */


/* ---------------------------------------------------------------------------
   DESIGN TOKENS
   :root is a selector for the <html> element, i.e. the very top of the page.
   The names starting with -- are CSS CUSTOM PROPERTIES, usually called
   "variables." Declaring them on :root makes them readable from every element
   on the page, because custom properties are inherited by children.

   The point is single-source-of-truth: the green accent colour appears a dozen
   times below, but it is written out once here. Change this one line and every
   green thing on the site changes with it. Everywhere else it is referenced as
   var(--accent).
   --------------------------------------------------------------------------- */
:root{
  --bg:#0f1419; --panel:#171e26; --panel-2:#1e2732; --line:#2b3643;
  /* Colours are hex codes: #RRGGBB, two hex digits each for red, green, blue.
     #0f1419 is a very dark blue-grey — the page background.
     --panel and --panel-2 are the two slightly lighter card backgrounds, and
     --line is the border colour that separates them. */
  --text:#e8edf2; --dim:#9aa7b4; --accent:#5ad15a; --accent-2:#6cb8e8;
  /* --text is near-white body text, --dim is grey secondary text,
     --accent is the Minecraft-ish green, --accent-2 the blue used for links. */
  --warn:#ffb648; --bad:#ff5f5f; --radius:12px;
  /* --radius is not a colour: it is the standard corner rounding, in pixels.
     Reusing one value keeps every box looking like part of the same set. */
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --sans:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  /* FONT STACKS. The browser tries each name in order and uses the first one
     installed on that computer. These are all fonts that ship with an operating
     system, so nothing has to be downloaded — which is why this page makes no
     requests to Google Fonts or any other outside domain. */
}

*{box-sizing:border-box}
/* * is the universal selector: every element on the page.
   box-sizing:border-box changes how width is measured. By default, setting
   width:200px plus 20px of padding produces an element 240px wide, which makes
   layouts very hard to reason about. With border-box, width:200px means the
   element really is 200px including its padding and border. Setting this
   globally is one of the first things almost every stylesheet does. */

html{-webkit-text-size-adjust:100%}
/* Stops iOS Safari from silently enlarging text when you rotate to landscape. */

body{margin:0;background:var(--bg);color:var(--text);font-family:var(--sans);line-height:1.55}
/* margin:0 removes the ~8px gap browsers put around the page by default.
   var(--bg) reads the variable defined up in :root.
   color sets the default text colour, which all child elements inherit.
   line-height:1.55 means each line of text is 1.55x the font size tall. Loose
   line spacing like this is the cheapest readability improvement there is. */

.wrap{max-width:860px;margin:0 auto;padding:32px 16px 64px}
/* The centring container.
   max-width:860px — grow to fill the window, but never exceed 860px. On a wide
   monitor this stops lines of text from running uncomfortably long.
   margin:0 auto — shorthand for "0 top and bottom, automatic left and right."
   Automatic left/right margins split the leftover space evenly, which is what
   actually centres the block.
   padding:32px 16px 64px — three values means top, left-and-right, bottom.
   (Margin is space OUTSIDE an element's border; padding is space INSIDE it.) */

header{margin-bottom:28px}
h1{font-size:1.9rem;margin:0 0 4px;letter-spacing:-.02em}
/* rem = "root em," a multiple of the browser's base font size (normally 16px),
   so 1.9rem is about 30px. Sizing in rem rather than px means the page respects
   a visitor who has increased their default font size for readability.
   letter-spacing:-.02em pulls the letters very slightly together, which stops
   large headings from looking loose. em here means "relative to this font size." */
h1 span{color:var(--accent)}
/* A descendant selector: any <span> inside the <h1>. This is the single rule
   that paints "watch" green while "Block" stays white. */
h2{font-size:1.05rem;margin:0 0 14px}
h2.spaced{margin-top:26px}
/* h2.spaced with no space between them means "an <h2> that ALSO has
   class='spaced'" — not an <h2> containing one. It adds breathing room above
   the "Recommended start command" heading, which follows other content. */
.tag{color:var(--dim);font-size:.95rem;margin:0}


/* ---------------------------------------------------------------------------
   TAB BAR
   --------------------------------------------------------------------------- */
nav{display:flex;gap:4px;background:var(--panel);padding:4px;border-radius:var(--radius);
  margin:24px 0;border:1px solid var(--line);flex-wrap:wrap}
/* display:flex turns on FLEXBOX, a layout mode that arranges children in a row
   and lets them share the available space. It is the modern replacement for the
   old float-based tricks.
   gap:4px puts 4px between the children without needing margins on each one.
   flex-wrap:wrap lets the buttons drop onto a second line instead of being
   squashed when the window is too narrow.
   border:1px solid var(--line) is shorthand for width, style, colour. */
nav button{flex:1;min-width:120px;background:none;border:0;color:var(--dim);font:inherit;
  font-size:.92rem;padding:10px 12px;border-radius:9px;cursor:pointer}
/* flex:1 tells each button to take an equal share of the row's width.
   min-width:120px stops them shrinking below a tappable size.
   background:none and border:0 strip the operating system's default button
   chrome so we can draw our own.
   font:inherit is important — form controls like <button> do NOT inherit the
   page font by default, so without this the tabs would render in the browser's
   default UI font and look out of place.
   cursor:pointer shows the little hand, signalling "this is clickable." */
nav button:hover{color:var(--text)}
/* :hover is a PSEUDO-CLASS: a condition on when the rule applies. These
   declarations only take effect while the pointer is over the element. */
nav button[aria-selected="true"]{background:var(--panel-2);color:var(--text)}
/* An ATTRIBUTE SELECTOR: only buttons whose aria-selected attribute is exactly
   "true". This is a neat trick — app.js already has to update aria-selected for
   screen readers, and this rule makes that same attribute drive the visible
   highlight too, so the accessible state and the visual state can never
   disagree with each other. */


/* ---------------------------------------------------------------------------
   CARDS AND FORM CONTROLS
   --------------------------------------------------------------------------- */
.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:20px;margin-bottom:16px}
/* The rounded dark panel that each section sits inside. */
label{display:block;font-size:.85rem;color:var(--dim);margin-bottom:6px}
/* display:block makes each label occupy its own full-width line, so the input
   box sits underneath it rather than beside it. */
input[type=text],select{width:100%;background:var(--bg);border:1px solid var(--line);color:var(--text);
  font:inherit;padding:11px 12px;border-radius:9px}
/* A comma means "apply to both of these." Text inputs and dropdowns get
   identical styling so the form looks consistent.
   width:100% makes them fill their column. */
input[type=text]:focus,select:focus,button:focus-visible{outline:2px solid var(--accent-2);outline-offset:1px}
/* ACCESSIBILITY, and worth understanding. :focus is the state of the control you
   are currently typing in or have tabbed to. Browsers draw a default focus ring,
   and a very common mistake is to delete it because it looks ugly — which makes
   the site unusable for anyone navigating by keyboard, because they can no
   longer see where they are. The right move is this one: replace it with a
   clearer ring of your own. :focus-visible is the smarter variant for buttons —
   it shows the ring for keyboard users but not after a mouse click. */
input[type=range]{width:100%;accent-color:var(--accent)}
/* accent-color recolours the browser's own slider thumb and track to match the
   site's green, with no custom styling needed. */


/* ---------------------------------------------------------------------------
   ROW LAYOUT
   --------------------------------------------------------------------------- */
.row{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
/* align-items:flex-end lines the children up along their BOTTOM edges. That is
   what makes the "Check" button sit level with the bottom of the input box,
   even though the input has a label above it and the button does not. */
.row>div{flex:1;min-width:180px}
/* The > is a CHILD selector: only <div>s that are immediate children of .row,
   not ones nested deeper. flex:1 shares the width equally between them. */
.row>div.narrow{flex:0 0 140px;min-width:140px}
/* flex:0 0 140px means "do not grow, do not shrink, stay 140px." The Edition
   dropdown does not need as much room as the address box. */
.row.sliders{margin-top:14px}


/* ---------------------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------------------- */
.btn{background:var(--accent);color:#08140a;border:0;font:inherit;font-weight:600;
  padding:11px 20px;border-radius:9px;cursor:pointer;white-space:nowrap}
/* The primary green button. color:#08140a is a near-black used on top of the
   green — dark text on a bright background has far better contrast than white
   would, which matters for readability.
   white-space:nowrap stops the label breaking onto two lines. */
.btn:hover{filter:brightness(1.08)}
/* filter:brightness() lightens whatever colour is already there by 8%. Using a
   filter rather than a second hard-coded hex means the hover effect keeps
   working if the --accent variable is ever changed. */
.btn.ghost{background:var(--panel-2);color:var(--text);border:1px solid var(--line);font-weight:500}
/* A secondary variant. An element with class="btn ghost" gets both rules, and
   because .btn.ghost is more specific than .btn, its background wins. */
.btn:disabled{opacity:.5;cursor:default;filter:none}
/* :disabled applies when JavaScript has set the button's disabled property.
   app.js does exactly that while a lookup is in flight, so the button visibly
   greys out and stops responding until the response arrives. */
.copied{color:var(--accent);font-size:.85rem;margin-left:10px}


/* ---------------------------------------------------------------------------
   STAT BOXES
   --------------------------------------------------------------------------- */
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin-top:16px}
/* CSS GRID, the other main layout system. Flexbox arranges things in one
   direction; grid handles rows and columns together.
   repeat(auto-fit, minmax(130px, 1fr)) is a self-adjusting column definition:
   "make as many columns as will fit, each at least 130px wide, sharing the
   leftover space equally." 1fr means one FRACTION of the free space.
   The result is responsive with no @media query: four boxes across on a laptop,
   two on a phone, and nothing in the HTML or JavaScript has to know which. */
.stat{background:var(--panel-2);border:1px solid var(--line);border-radius:10px;padding:12px}
.stat .k{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--dim)}
/* The small grey caption, e.g. "PLAYERS". text-transform:uppercase capitalises
   it in the display only — the underlying text in the HTML is unchanged, which
   is better than typing it in caps because screen readers may spell out
   all-caps words letter by letter.
   The positive letter-spacing counteracts how cramped small uppercase looks. */
.stat .v{font-size:1.25rem;font-weight:600;margin-top:2px;word-break:break-word}
/* The large value underneath. word-break:break-word lets a long unbroken string
   (a version name with no spaces, say) wrap instead of overflowing the box. */


/* ---------------------------------------------------------------------------
   MOTD BOX  (MOTD = "message of the day," the text a Minecraft server shows in
   the multiplayer list)
   --------------------------------------------------------------------------- */
.motd{background:#0b0e12;border:1px solid var(--line);border-radius:10px;padding:14px;
  font-family:var(--mono);font-size:.9rem;margin-top:16px;white-space:pre-wrap;overflow-x:auto}
/* Monospace font and a darker background, to look like a terminal.
   white-space:pre-wrap keeps the server's own line breaks and runs of spaces
   (normally HTML collapses those) while still wrapping long lines.
   overflow-x:auto adds a horizontal scrollbar within this box if something is
   too wide, rather than letting it stretch the whole page sideways. */
.motd .lbl{color:var(--dim);font-family:var(--sans);font-size:.72rem;text-transform:uppercase;
  letter-spacing:.06em;display:block;margin-bottom:6px}


/* ---------------------------------------------------------------------------
   ONLINE / OFFLINE PILL
   --------------------------------------------------------------------------- */
.pill{display:inline-flex;align-items:center;gap:7px;font-size:.85rem;font-weight:600;padding:5px 12px;border-radius:999px}
/* border-radius:999px is a standard trick for a fully rounded "pill" shape: any
   radius larger than half the height gets clamped to a perfect semicircle, so
   one absurdly large number works at any height. */
.pill.on{background:rgba(90,209,90,.15);color:var(--accent)}
/* rgba() is red, green, blue, alpha. The fourth value is opacity from 0 to 1, so
   .15 is 15% opaque — a faint green tint over the dark background. */
.pill.off{background:rgba(255,95,95,.15);color:var(--bad)}
.dot{width:8px;height:8px;border-radius:50%;background:currentColor}
/* border-radius:50% on a square makes a circle.
   currentColor is a keyword meaning "whatever this element's text colour is."
   Because the dot sits inside .pill.on or .pill.off, it automatically comes out
   green or red without needing a rule of its own for each case. */


/* ---------------------------------------------------------------------------
   MESSAGE BANNERS
   --------------------------------------------------------------------------- */
.msg{padding:12px 14px;border-radius:9px;font-size:.9rem;margin-top:14px}
/* Shared base. app.js writes class="msg err", "msg warn" or "msg info", so each
   banner picks up this rule plus exactly one of the three below. */
.msg.err{background:rgba(255,95,95,.12);color:#ffb3b3;border:1px solid rgba(255,95,95,.3)}
.msg.warn{background:rgba(255,182,72,.12);color:#ffd79a;border:1px solid rgba(255,182,72,.3)}
.msg.info{background:var(--panel-2);color:var(--dim);border:1px solid var(--line)}


/* ---------------------------------------------------------------------------
   UTILITIES
   --------------------------------------------------------------------------- */
.hide{display:none}
/* Small but central to how the site works. display:none removes an element from
   the page entirely — invisible and taking up no space. The three tab panels all
   exist in the HTML from the moment the page loads; switching tabs is just
   app.js adding this one class to two of them and removing it from the third.
   Nothing is fetched or rebuilt, which is why tab switching is instant. */
.icon{width:64px;height:64px;border-radius:8px;image-rendering:pixelated;background:var(--panel-2);
  border:1px solid var(--line);flex:0 0 auto}
/* image-rendering:pixelated turns off the browser's smoothing when scaling an
   image up. A Minecraft server icon is a 64x64 pixel-art PNG, and smoothing
   would turn it into a blurry smear. */
.head{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:18px}
.host{font-family:var(--mono);font-size:.9rem;margin-top:6px;word-break:break-all}
/* word-break:break-all will split a long hostname mid-word if it has to, which
   is acceptable for an address and prevents it overflowing on a phone. */

pre.flags{background:#0b0e12;border:1px solid var(--line);border-radius:10px;padding:14px;
  font-family:var(--mono);font-size:.78rem;overflow-x:auto;white-space:pre-wrap;word-break:break-all;margin:14px 0 10px}
/* The generated java start command. It is very long, so it is allowed to wrap
   anywhere rather than forcing a scrollbar. */
code{font-family:var(--mono);font-size:.88em;background:var(--panel-2);padding:1px 5px;border-radius:4px}
/* Inline code snippets in the hint text, like server.jar. Note .88em rather than
   .88rem: em is relative to the SURROUNDING text, so the snippet stays slightly
   smaller than whatever it sits inside, at any size. */


/* ---------------------------------------------------------------------------
   SAVED SERVER LIST
   --------------------------------------------------------------------------- */
ul.servers{list-style:none;padding:0;margin:14px 0 0}
/* list-style:none removes the bullet points; padding:0 removes the indent the
   browser adds to lists by default. Using a <ul> is still correct HTML — it tells
   assistive technology "this is a list of N items" — we just do not want the
   default appearance. */
ul.servers li{display:flex;gap:10px;align-items:center;background:var(--panel-2);border:1px solid var(--line);
  border-radius:9px;padding:10px 12px;margin-bottom:8px}
/* Each saved server is a flex row: name on the left, two buttons on the right. */
ul.servers li.empty{color:var(--dim);display:block}
/* The "Nothing saved yet." placeholder. display:block overrides the flex above,
   because there are no buttons to line up. */
ul.servers li .nm{flex:1;font-family:var(--mono);font-size:.88rem;word-break:break-all}
/* flex:1 on the name makes it absorb all the spare width, which is what pushes
   the Check and × buttons over to the right edge. */
.x{background:none;border:0;color:var(--dim);cursor:pointer;font-size:1.3rem;line-height:1;padding:2px 8px;border-radius:6px}
/* The × delete button. line-height:1 keeps it vertically tight. */
.x:hover{color:var(--bad);background:rgba(255,95,95,.1)}
/* Turning red on hover is a deliberate warning that this action is destructive. */


/* ---------------------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------------------- */
footer{color:var(--dim);font-size:.82rem;margin-top:36px;text-align:center}
footer a{color:var(--accent-2)}
.hint{font-size:.8rem;color:var(--dim);margin-top:8px}


/* ---------------------------------------------------------------------------
   RESPONSIVE ADJUSTMENTS
   --------------------------------------------------------------------------- */
@media (max-width:560px){
/* A MEDIA QUERY. Everything inside these braces applies only when the condition
   is true — here, when the browser window is 560px wide or less, i.e. a phone.
   Everything above still applies; these rules just override a few values. This
   is the core of "responsive design": one stylesheet that adapts, rather than a
   separate mobile site. You can test it by narrowing your browser window, or
   with the device-toolbar button in DevTools. */
  .wrap{padding:24px 16px 48px}
  /* Less vertical padding, because screen space is scarce. */
  h1{font-size:1.6rem}
  /* A heading sized for a laptop is overbearing on a phone. */
  .row>div.narrow{flex:1 1 auto}
  /* Cancels the fixed 140px width set earlier, so the Edition dropdown can take
     a full-width line of its own once the row has wrapped. */
}
