* {
    font-family: sans-serif;
    font-size: 14px;
}

html, body {
    background-color: #222;
    overflow: hidden;
}

html, body, canvas {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.4);
}

div {
    user-select: none; /* webkit (safari, chrome) browsers */
}

#split {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 100px;
    height: 100px;
    padding: 5px;
    border: none;
}

#feed {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 100px;
    height: 100px;
    padding: 5px;
    border: none;
}

#status {
    position: absolute;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    color: #FFF;
    font-size: 16.1px;
    top: 10px;
    right: 10px;
    font-weight: bold;
    text-align: center;
}

#status .title {
    font-size: 25px;
}

#status .me {
    color: #FF8888;
    font-size: 16.1px;
}

.chatbox {
    position: absolute;
    width: 300px;
    height: 320px;
    background: rgba(22, 22, 22, 0.7);
    bottom: 5px;
    left: 5px;
    border-radius: 5px;
    pointer-events: none;
}

.chatbox .chat-list {
    padding: 5px;
    margin: 0;
    list-style: none;
    box-sizing: border-box;
    height: 285px;
    overflow: hidden;
}

.chatbox .chat-list li {
    padding: 2px;
    margin: 3px;
}

.chatbox .chat-list li.me b {
    color: #ea6153;
}

.chatbox .chat-list li.friend b {
    color: #2ecc71;
}

.chatbox .chat-list li.system {
    color: #9b59b6;
    font-style: italic;
}

.chatbox .chat-list li.system:before {
    content: "» ";
}

.chatbox .chat-input {
    pointer-events: all;
    box-sizing: border-box;
    width: 100%;
    padding: 8px;
    background: transparent;
    border: none;
    border-top: 1px solid #DDD;
    outline: none;
}

#startMenu {
    position: relative;
    margin: auto;
    margin-top: 100px;
    width: 350px;
    padding: 20px;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    background-color: white;
    box-sizing: border-box;
}

#startMenu p {
    padding: 0;
    text-align: center;
    font-size: x-large;
    font-weight: bold;
}

#playerNameInput {
    width: 100%;
    text-align: center;
    padding: 10px;
    border: solid 1px #dcdcdc;
    transition: box-shadow 0.3s, border 0.3s;
    box-sizing: border-box;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    margin-bottom: 10px;
    outline: none;
}

#playerNameInput:focus, #playerNameInput.focus {
    border: solid 1px #CCCCCC;
    box-shadow: 0 0 3px 1px #DDDDDD;
}

#startButton, #spectateButton {
    position: relative;
    margin: auto;
    margin-top: 10px;
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    font-size: large;
    color: white;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    background: #2ecc71;
    border: 0;
    border-bottom: 2px solid #28be68;
    cursor: pointer;
    -webkit-box-shadow: inset 0 -2px #28be68;
    box-shadow: inset 0 -2px #28be68;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    margin-bottom: 10px;
}

#spectateButton:active, #spectateButton:hover,
#startButton:active, #startButton:hover {
    top: 1px;
    background: #55D88B;
    outline: none;
    -webkit-box-shadow: none;
    box-shadow: none;
}

#settingsButton {
    position: relative;
    margin: auto;
    margin-top: 10px;
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    font-size: large;
    color: white;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    background: #2ecc71;
    border: 0;
    border-bottom: 2px solid #28be68;
    cursor: pointer;
    -webkit-box-shadow: inset 0 -2px #28be68;
    box-shadow: inset 0 -2px #28be68;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    margin-bottom: 10px;
}

#settingsButton:active, #settingsButton:hover {
    top: 1px;
    background: #55D88B;
    outline: none;
    -webkit-box-shadow: none;
    box-shadow: none;
}

#settings, #startMenuWrapper {
    -webkit-transition: max-height 1s;
    -moz-transition: max-height 1s;
    -ms-transition: max-height 1s;
    -o-transition: max-height 1s;
    transition: max-height 1s;
    overflow: hidden;
}

#settings {
    max-height: 0;
}

#startMenu h3 {
    padding-bottom: 0;
    margin-bottom: 0;
}

#startMenu ul {
    margin: 10px;
    padding: 10px;
    margin-top: 0;
}

#startMenu .input-error {
    color: red;
    opacity: 0;
    font-size : 12px;
}

#startMenuWrapper {
    z-index: 2;
}

#gameAreaWrapper {
    position: absolute !important;
    top: 0;
    left: 0;
    opacity: 0;
}

@media only screen and (min-width: 1224px) {
  #mobile { display: none; }
}

@media only screen and (max-width: 1224px) {
  #chatbox { display: none; }
}

input [type="image"]:focus{
  border:none;
  outline: 1px solid transparent;
  border-style: none;
}

*:focus {
  outline: 1px solid transparent;
  border-style: none;
}

/* ===================================================================== */
/*  Skin selector      */
/* ===================================================================== */

#startMenuWrapper { position: relative; z-index: 3; }
#gameAreaWrapper  { z-index: 1; }            /* canvas behind menu      */
#startMenu img    { max-width: 100%; height: auto; }  /* no overflow     */

/* Selected state for emoji options (kept from your original) */
.emoji-skin-option.selected-emoji {
    outline: 3px solid #0078ff;
    box-shadow: 0 0 10px #0078ff44;
    border-color: #0078ff !important;
    z-index: 2;
}

/* Card container */
#skinSelection {
    margin: 1em 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8f8fa;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
}

/* Section (Color / Skin) */
#skinSelection .skin-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    width: 100%;
    margin-bottom: 1rem;
}

#skinSelection .section-title {
    font-weight: bold;
    font-size: 1.05rem;
    color: #222;
}

#skinSelection .color-chip {
    width: 120px;        
    height: 50px;        
    border: 2px solid #ddd;
    border-radius: 8px;  
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px #0001;
    padding: 0;
}


/* Emoji grid */
#skinSelection .emoji-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(64px, 1fr));
    gap: 16px 22px;
    justify-items: center;
    width: 100%;
}

@media (max-width: 380px) {
  #skinSelection .emoji-grid {
    grid-template-columns: repeat(2, minmax(64px, 1fr));
  }
}

#skinSelection .emoji-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    text-align: center;
}

#skinSelection .emoji-skin-option {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid #ff0000;
    cursor: pointer;
    background: #fff;
    transition: border 0.2s, box-shadow 0.2s, transform .05s ease-in-out;
}

#skinSelection .emoji-skin-option:hover {
    transform: translateY(-1px);
}

#skinSelection .emoji-item span {
    font-size: 0.8em;
    color: #666;
}

/* ===================================================================== */
/*  Play-without-name checkbox + disabled input visual                   */
/* ===================================================================== */

.allow-noname {
    display: inline-flex;
    gap: .5em;
    align-items: center;
    margin: .5em 0;
    user-select: none;
    cursor: pointer;
}

.allow-noname input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2ecc71;
}

#playerNameInput.name-disabled {
    opacity: 0.6;
}
