@charset "UTF-8";
.animation-size-expand {
  position: relative;
  -webkit-transition: transform 300ms ease-in;
  -webkit-transform: scale(1);
  -ms-transition: transform 300ms ease-in;
  -ms-transform: scale(1);
  -moz-transition: transform 300ms ease-in;
  -moz-transform: scale(1);
  transition: transform 300ms ease-in;
  transform: scale(1);
}

.animation-size-expand-hover:hover.animation-size-expand, .animation-size-expand-hover:hover .animation-size-expand {
  z-index: 1000;
  -webkit-transition: transform 100ms ease-in;
  -webkit-transform: scale(1.3);
  -ms-transition: transform 100ms ease-in;
  -ms-transform: scale(1.3);
  -moz-transition: transform 100ms ease-in;
  -moz-transform: scale(1.3);
  transition: transform 100ms ease-in;
  transform: scale(1.3);
}

.animation-size-expand-hover-small:hover.animation-size-expand, .animation-size-expand-hover-small:hover .animation-size-expand {
  z-index: 1000;
  -webkit-transition: transform 100ms ease-in;
  -webkit-transform: scale(1.1);
  -ms-transition: transform 100ms ease-in;
  -ms-transform: scale(1.1);
  -moz-transition: transform 100ms ease-in;
  -moz-transform: scale(1.1);
  transition: transform 100ms ease-in;
  transform: scale(1.1);
}

.animation-size-expand-hover-tiny:hover.animation-size-expand, .animation-size-expand-hover-tiny:hover .animation-size-expand {
  z-index: 1000;
  -webkit-transition: transform 100ms ease-in;
  -webkit-transform: scale(1.05);
  -ms-transition: transform 100ms ease-in;
  -ms-transform: scale(1.05);
  -moz-transition: transform 100ms ease-in;
  -moz-transform: scale(1.05);
  transition: transform 100ms ease-in;
  transform: scale(1.05);
}

.btn {
  margin-top: 5px;
  margin-bottom: 5px;
  border: none;
  color: white;
  padding: 13px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  width: 100%;
  cursor: pointer;
}
.btn :focus {
  outline: 0;
}

.btn-remove-player {
  display: none;
}

.btn-clean {
  background-color: Transparent;
  background-repeat: no-repeat;
  border: none;
  cursor: pointer;
  overflow: hidden;
  outline: none;
}

.btn-slim {
  padding: 5px 15px;
  font-size: 13px;
}

.btn-select {
  background: url(http://i62.tinypic.com/15xvbd5.png) no-repeat 96% 0;
}

.btn-primary {
  background-color: #689F38;
}

.btn-secondary {
  background-color: #757575;
}

.flex, .canvas-overlay-text {
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  flex-wrap: wrap;
}

.flex-no-wrap {
  flex-wrap: nowrap;
}

.flex-column {
  flex-direction: column;
}

.flex-start {
  justify-content: start;
}

.flex-space-between {
  justify-content: space-between;
}

.flex-align-end {
  align-items: flex-end;
}

.flex-align-center {
  align-items: center;
}

.flex-center {
  justify-content: center;
}

.flex-self-center {
  align-self: center;
}

.flex-self-end {
  align-self: flex-end;
}

.flex-grow-1 {
  flex-grow: 1;
}

.flex-grow-2 {
  flex-grow: 2;
}

.flex-center-xy, .canvas-overlay-text {
  align-items: center;
  justify-content: center;
}

.flex-2x2 {
  min-height: 100%;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
}

.flex-2x2 > * {
  display: flex;
  flex-basis: calc(50% - 40px);
  justify-content: center;
  flex-direction: column;
}

.flex, .canvas-overlay-text {
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  flex-wrap: wrap;
}

.flex-no-wrap {
  flex-wrap: nowrap;
}

.flex-column {
  flex-direction: column;
}

.flex-start {
  justify-content: start;
}

.flex-space-between {
  justify-content: space-between;
}

.flex-align-end {
  align-items: flex-end;
}

.flex-align-center {
  align-items: center;
}

.flex-center {
  justify-content: center;
}

.flex-self-center {
  align-self: center;
}

.flex-self-end {
  align-self: flex-end;
}

.flex-grow-1 {
  flex-grow: 1;
}

.flex-grow-2 {
  flex-grow: 2;
}

.flex-center-xy, .canvas-overlay-text {
  align-items: center;
  justify-content: center;
}

.flex-2x2 {
  min-height: 100%;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
}

.flex-2x2 > * {
  display: flex;
  flex-basis: calc(50% - 40px);
  justify-content: center;
  flex-direction: column;
}

.canvas-container {
  position: relative;
}

.map-canvas-z-index {
  z-index: 100 !important;
}

.power-up-canvas-z-index {
  z-index: 200;
}

.worm-body-canvas-1-z-index {
  z-index: 300;
}

.worm-body-canvas-2-z-index {
  z-index: 310;
}

.worm-body-canvas-3-z-index {
  z-index: 320;
}

.worm-head-canvas-z-index {
  z-index: 400;
}

.border-canvas-z-index {
  z-index: 500;
}

.canvas-overlay-container, .canvas-overlay-container-round {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 450;
  color: #689F38;
}

.canvas-overlay-container-round {
  border-radius: 50%;
}

.canvas-overlay-faded-bg, .canvas-overlay-hover-wrapper:hover .canvas-overlay-hover-effect {
  background-color: rgba(255, 255, 255, 0.5);
}

.canvas-overlay-text {
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  text-align: center;
}

.round-over-text-circle-map {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

.canvas-overlay-hover-wrapper:hover .canvas-overlay-hover-effect {
  opacity: 1;
  z-index: 450 !important;
}

table {
  line-height: inherit;
}

body {
  padding: 0;
  background-color: #faf7ed;
}

.page-main {
  margin-right: auto;
  margin-left: auto;
  max-width: 1200px;
  padding-left: 20px;
  padding-right: 20px;
}

/**
 * Select
 */
.select {
  background: url(http://i62.tinypic.com/15xvbd5.png) no-repeat 96% 0;
  height: 29px;
  overflow: hidden;
  width: 240px;
}
.select select {
  color: white;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: none;
  font-size: 14px;
  height: 29px;
  padding-left: 5px; /* If you add too much padding here, the options won't show in IE */
  width: 268px;
}
.select select option {
  background-color: #689F38;
  color: white;
}

.select-primary {
  background-color: #689F38;
}

/**
 * Input
 */
.input {
  background-color: Transparent;
  background-repeat: no-repeat;
  border: none;
  cursor: text;
  overflow: hidden;
  outline: none;
  border-bottom: 2px dotted #000000;
}

/**
 * Icons
*/
.icon-remove {
  fill: "green";
}

/**
* Table
*/
.table {
  width: 100%;
}
.table td {
  padding: 8px;
}

.table-round-score {
  width: 100%;
}
.table-round-score .round-score {
  font-size: 10px;
  width: 15px;
}
.table-round-score tr {
  height: 25px;
}
.table-round-score .col-tie-score {
  position: relative;
}
.table-round-score .col-tie-score .tie-info {
  display: none;
  position: absolute;
  right: 46px;
  top: 3px;
  font-size: 13px;
  color: white;
  background-color: black;
  border-radius: 3px;
  padding-left: 8px;
  padding-right: 8px;
  padding-top: 3px;
  padding-bottom: 2px;
  white-space: nowrap;
}
.table-round-score .col-tie-score {
  min-width: 37px;
}
.table-round-score .col-tie-score .tie {
  background-color: #689F38;
  color: white;
  padding: 3px;
  border-radius: 5px;
  cursor: default;
  float: right;
}
.table-round-score .col-tie-score img {
  float: right;
}
.table-round-score .col-tie-score:hover .tie-info {
  display: inline;
}

/**
 * Player settings table
*/
.table-player .col-bot {
  width: 10%;
}
.table-player .col-color {
  width: 10%;
}
.table-player .col-name {
  width: 40%;
}
.table-player .col-keybinding {
  width: 20%;
  min-width: 66px;
  text-align: center;
}
.table-player .col-selected {
  outline: 4px solid;
  outline-offset: -4px;
  background-color: lightblue;
}
.table-player .col-remove {
  min-width: 40px;
}
.table-player .col-ready {
  color: #689F38;
}
.table-player tbody tr:hover td:not(:last-child) {
  background-color: lightblue;
}
.table-player tbody tr:hover .btn-remove-player {
  display: block;
}

.table-score {
  width: 100%;
}
.table-score tr {
  height: 43px;
}
.table-score td:nth-child(1) {
  width: 27px;
}
.table-score td:nth-child(3) {
  text-align: center;
}

.new-match-preview {
  position: relative;
  width: 100%;
  padding-top: 100%;
  height: 0px;
}
.new-match-preview .preview-canvas-container {
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0px;
  left: 0px;
  bottom: 0px;
  right: 0px;
}

.score-graph-outer-wrapper {
  position: relative;
  width: 100%;
  padding-top: 66.667%;
  height: 0px;
}
.score-graph-outer-wrapper .score-graph-inner-wrapper {
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0px;
  left: 0px;
  bottom: 0px;
  right: 0px;
}

.match-over-replay {
  width: 208px;
  height: 208px;
  margin: auto;
}

.canvas-container canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.color-picker {
  width: 25px;
  height: 25px;
  position: relative;
  float: left;
  cursor: pointer;
}

.color-picker-selected {
  width: 25px;
  height: 25px;
}

.color-picker-list {
  position: absolute;
  z-index: 1;
  top: 0px;
  left: 25px;
  width: 300px;
}

.max-score {
  max-width: 110px;
}
.max-score img {
  height: 29px;
  margin-right: 10px;
}
.max-score input {
  width: 4em;
  margin-bottom: 1px;
  text-align: center;
}

.heading h1 {
  margin-bottom: 0;
  text-align: center;
}
.heading {
  margin-bottom: 10px;
  border-bottom: 1px solid;
  border-color: #bdbdbd;
}

.hidden {
  display: none;
}

.multi-player-enter {
  display: flex;
  flex-direction: column;
  width: 30%;
  margin: auto;
}
.multi-player-enter input {
  text-align: center;
}

.replay-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.round-replay {
  cursor: pointer;
  position: relative;
}

.round-replay:hover .round-watch-replay {
  display: flex;
}

.facebook-page-link svg:hover :first-child {
  fill: #365899;
}

.fb-like span {
  margin-bottom: 4px;
}

.m-b-2 {
  margin-bottom: 10px;
}

.m-b-3 {
  margin-bottom: 20px;
}

.m-l-1 {
  margin-left: 5px;
}

.m-l-2 {
  margin-left: 10px;
}

.m-r-3 {
  margin-right: 20px;
}

.m-t-2 {
  margin-top: 10px;
}

.m-x-2 {
  margin-left: 10px;
  margin-right: 10px;
}

.m-t-0 {
  margin-top: 0;
}

.m-b-0 {
  margin-bottom: 0;
}

.m-t-3 {
  margin-top: 20px;
}

.m-x-3 {
  margin-left: 20px;
  margin-right: 20px;
}

.hidden {
  display: none;
}

.opacity-0 {
  opacity: 0;
}

.opacity-25 {
  opacity: 0.25;
}

.opacity-5 {
  opacity: 0.5;
}

.selected {
  background-color: lightblue;
}

/* ------------------------------------------------------------------
 * Mobile responsive styles
 * ------------------------------------------------------------------ */
@media (max-width: 900px), (pointer: coarse) {
  body {
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
  }
  .page-main {
    padding-left: 8px;
    padding-right: 8px;
    /* Breathing room at the bottom of scrollable pages; respect iOS home indicator. */
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
    max-width: 100%;
  }
  /* Header collapses to a compact bar; hide Facebook stuff on mobile. */
  .heading {
    margin-bottom: 6px;
  }
  .heading h1 {
    font-size: 22px;
    margin: 4px 0;
  }
  .heading .fb-like,
  .heading .facebook-page-link {
    display: none !important;
  }
  /* New-match: stack everything into a single column */
  .new-match {
    flex-direction: column;
  }
  .new-match > div {
    flex-basis: auto !important;
    min-width: 0 !important;
    width: 100%;
  }
  .new-match-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .player-card-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
  }
  .player-card-mobile .player-card-color {
    flex-shrink: 0;
  }
  .player-card-mobile .player-card-name {
    flex: 1 1 auto;
    min-width: 0;
  }
  .player-card-mobile .player-card-name input {
    width: 100%;
    font-size: 16px; /* avoid iOS zoom */
    padding: 6px 0;
  }
  .player-card-mobile .player-card-type-btn {
    flex-shrink: 0;
    padding: 8px;
  }
  .player-card-mobile .player-card-type-btn img {
    width: 32px;
    height: 32px;
  }
  .player-card-mobile .player-card-remove {
    flex-shrink: 0;
  }
  .new-match-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .new-match-mobile-map {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .new-match-mobile-map .map-choice {
    aspect-ratio: 1/1;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    position: relative;
  }
  .new-match-mobile-map .map-choice.selected {
    border-color: #689F38;
  }
  .new-match-mobile-controls-hint {
    font-size: 13px;
    color: #757575;
    text-align: center;
    padding: 8px 4px;
    line-height: 1.4;
  }
  /* Local game mobile: full-screen canvas + invisible touch zones */
  .local-game-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    overflow: hidden;
    z-index: 1000;
    /* Suppress Android haptic feedback / context menus / text selection on
       long-press during play. */
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .local-game-mobile * {
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }
  .local-game-mobile-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Square fit to smallest viewport edge */
    width: min(100vw, 100vh);
    height: min(100vw, 100vh);
  }
  .local-game-mobile-topbar {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 700;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 6px;
    padding: 4px 8px;
    pointer-events: none;
  }
  .local-game-mobile-topbar .max-score {
    display: none;
  }
  .local-game-mobile-topbar table td {
    padding: 1px 4px;
    font-size: 12px;
  }
  .local-game-mobile-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 6px;
    z-index: 700;
  }
  .local-game-mobile-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.85);
    color: #000;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    padding: 0;
  }
  /* The page-main wrapper should not constrain the fullscreen game */
  .page-main:has(.local-game-mobile) {
    padding: 0;
    max-width: none;
  }
  /* Hide header behind game on mobile to maximise space */
  .page-main.in-game-mobile {
    padding: 0;
  }
  .page-main.in-game-mobile .heading {
    display: none;
  }
  /* game-over + match-over on mobile: stack canvas + score */
  .game-over-mobile,
  .match-over-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .game-over-mobile .canvas-wrapper,
  .match-over-mobile .canvas-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    aspect-ratio: 1/1;
  }
  .game-over-mobile .side,
  .match-over-mobile .side {
    width: 100%;
  }
  /* game-over on mobile reuses the fullscreen .local-game-mobile layout so the map
     stays in the exact same place/size as during play (no flicker).

     The action area is pinned to the bottom of the screen so in portrait it lives
     entirely in the black letterbox band *below* the square map -- never covering
     gameplay. It stays non-tappable for ~1s after mount so reflexive turn-taps at
     round-end are ignored, then fades + slides up into view. */
  .game-over-mobile-actions {
    position: absolute;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom, 18px));
    transform: translateX(-50%) translateY(10px);
    z-index: 700;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: min(320px, 82vw);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s ease;
  }
  .game-over-mobile-actions.armed {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
  }
  .game-over-mobile-actions {
    /* Primary "Start next game": large rounded pill, prominent shadow */
  }
  .game-over-mobile-actions .btn-primary {
    margin: 0;
    padding: 16px 24px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background-color: #689F38;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  }
  .game-over-mobile-actions {
    /* Secondary actions become low-key ghost chips, side-by-side under the CTA */
  }
  .game-over-mobile-actions .game-over-mobile-actions-secondary {
    display: flex;
    gap: 8px;
  }
  .game-over-mobile-actions .game-over-mobile-actions-secondary .btn-secondary {
    flex: 1 1 0;
    margin: 0;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: none;
  }
  .match-over-rounds-heading-mobile {
    margin: 8px 0;
    font-size: 16px;
  }
  .match-over-rounds-mobile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .match-over-rounds-mobile .round-replay {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
  }
  .match-over-rounds-mobile {
    /* Force the inner fixed-size .match-over-replay to fill the grid cell */
  }
  .match-over-rounds-mobile .match-over-replay {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1/1;
    margin: 0 !important;
  }
  .match-over-rounds-mobile .match-over-replay .canvas-container {
    position: relative;
    width: 100% !important;
    height: 100% !important;
  }
  /* Score graph: only shown for ≥3 rounds; force a shorter aspect for mobile */
  .match-over-score-graph-mobile .score-graph-outer-wrapper {
    padding-top: 50%; /* 2:1 aspect instead of 3:2 */
  }
  /* Buttons large on mobile */
  .btn {
    padding: 14px 16px;
    font-size: 15px;
  }
  /* Prevent text size adjustments inside table inputs */
  .input {
    font-size: 16px;
  }
}
/* When the canvas-container is fullscreen, make sure its child canvases fill it */
.canvas-container-fullscreen canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
