<?php
/**
 * Módulo Información — Nexora V6 Custom (glass, alto contraste).
 */
if (!defined('access') || !access) {
	die();
}

$h = function ($s) {
	return htmlspecialchars((string) $s, ENT_QUOTES, 'UTF-8');
};

$nex_cfg = function ($key) {
	$v = config($key, true);
	return (function_exists('check_value') && check_value($v)) ? htmlspecialchars((string) $v, ENT_QUOTES, 'UTF-8') : '—';
};

$t_page = $h(lang('module_titles_txt_17'));
$t_intro = $h(nexora_lang('nexora_info_intro', 'Tarifas del servidor, Chaos Machine, bonus de party y comandos en un solo lugar.'));
$_gi = function_exists('lang') ? lang('modals_info_server_1', true) : '';
$t_general = $h((function_exists('check_value') && check_value($_gi) && $_gi !== 'ERROR') ? $_gi : nexora_lang('nexora_info_general_short', 'Información general'));
$t_chaos = $h(nexora_lang('nexora_info_chaos', 'Chaos Machine'));
$t_party = $h(nexora_lang('nexora_info_party', 'Party Bonus Experience'));
$t_cmds = $h(nexora_lang('nexora_info_commands', 'Commands'));
$t_video = $h(nexora_lang('nexora_info_video', 'Video'));
$t_col_combo = $h(nexora_lang('nexora_info_col_combo', 'Combination'));
$t_col_max = $h(nexora_lang('nexora_info_col_max_rate', 'Maximum Success Rate'));
$t_col_norm = $h(nexora_lang('nexora_info_col_normal', 'Normal'));
$t_col_gold = $h(nexora_lang('nexora_info_col_gold', 'Gold'));
$t_col_mem = $h(nexora_lang('nexora_info_col_members', 'Members'));
$t_col_exp = $h(nexora_lang('nexora_info_col_exp_rate', 'Experience Rate'));
$t_col_same = $h(nexora_lang('nexora_info_col_same_class', 'Same Character Classes'));
$t_col_diff = $h(nexora_lang('nexora_info_col_diff_class', 'Different Classes'));
$t_vid_iframe = $h(nexora_lang('nexora_info_video_iframe', 'Video promocional del servidor'));

$lbl_ver = $h(nexora_lang('nexora_info_version', 'Versión'));
$lbl_exp = $h(nexora_lang('nexora_info_experience', 'Progresión'));
$lbl_master = $h(nexora_lang('nexora_info_masterexp', 'Experiencia Maestra'));
$lbl_drop = $h(nexora_lang('nexora_info_drop', 'Drop'));

echo '<div class="nex-info">';
echo '<header class="nex-info-head nex-glass-panel">';
echo '<p class="nex-info-eyebrow">' . $h(nexora_lang('nexora_info_eyebrow', 'Server dossier')) . '</p>';
echo '<h1 id="nex-info-title" class="nex-info-title">' . $t_page . '</h1>';
echo '<p class="nex-info-lead">' . $t_intro . '</p>';
echo '</header>';

echo '<section class="nex-info-section" aria-labelledby="nex-info-general-title">';
echo '<div class="nex-info-stats nex-glass-panel">';
echo '<h2 id="nex-info-general-title" class="nex-info-section-title">' . $t_general . '</h2>';
echo '<ul class="nex-info-stats-grid" role="list">';
echo '<li class="nex-info-stat"><span class="nex-info-stat__lbl">' . $lbl_ver . '</span><strong class="nex-info-stat__val">' . $nex_cfg('server_info_season') . '</strong></li>';
echo '<li class="nex-info-stat"><span class="nex-info-stat__lbl">' . $lbl_exp . '</span><strong class="nex-info-stat__val">' . $nex_cfg('server_info_exp') . '</strong></li>';
echo '<li class="nex-info-stat"><span class="nex-info-stat__lbl">' . $lbl_master . '</span><strong class="nex-info-stat__val">' . $nex_cfg('server_info_masterexp') . '</strong></li>';
echo '<li class="nex-info-stat"><span class="nex-info-stat__lbl">' . $lbl_drop . '</span><strong class="nex-info-stat__val">' . $nex_cfg('server_info_drop') . '</strong></li>';
echo '</ul></div></section>';

$chaos_rows = array(
	array('Item Luck', '70%', '85%'),
	array('Items +10, +11, +12', '70% + Luck', '85% + Luck'),
	array('Items +13, +14, +15', '65% + Luck', '75% + Luck'),
	array('Wings Level 1', '75% + Luck', '85% + Luck'),
	array('Wings Level 2', '75%', '85%'),
	array('Wings Level 3', '75%', '85%'),
	array('Wings Level 4', 'N/A%', 'N/A%'),
	array('Cape of Lord Mix', '75%', '85%'),
	array('Socket Weapon Mix', '75%', '85%'),
	array('Fragment of Horn Mix', '100%', '100%'),
	array('Broken Horn Mix', '100%', '100%'),
	array('Horn of Fenrir Mix', '100%', '100%'),
	array('Feather of Condor', '60%', '75%'),
	array("Ancient Hero's Soul", 'N/A%', 'N/A%'),
);

echo '<section class="nex-info-section" aria-labelledby="nex-info-chaos-title">';
echo '<div class="nex-info-card nex-glass-panel nex-info-card--accent-purple">';
echo '<h2 id="nex-info-chaos-title" class="nex-info-section-title">' . $t_chaos . '</h2>';
echo '<div class="nex-info-matrix" role="region" aria-label="' . $t_chaos . '">';
echo '<div class="nex-info-matrix-head" aria-hidden="true">';
echo '<span class="nex-info-matrix-corner">' . $t_col_combo . '</span>';
echo '<span class="nex-info-matrix-banner">' . $t_col_max . '</span>';
echo '<span class="nex-info-matrix-sub nex-info-matrix-sub--a">' . $t_col_norm . '</span>';
echo '<span class="nex-info-matrix-sub nex-info-matrix-sub--b">' . $t_col_gold . '</span>';
echo '</div>';
foreach ($chaos_rows as $cr) {
	echo '<div class="nex-info-matrix-row">';
	echo '<span class="nex-info-matrix-name">' . $h($cr[0]) . '</span>';
	echo '<span class="nex-info-matrix-val">' . $h($cr[1]) . '</span>';
	echo '<span class="nex-info-matrix-val nex-info-matrix-val--gold">' . $h($cr[2]) . '</span>';
	echo '</div>';
}
echo '</div></div></section>';

$party_rows = array(
	array('2 Players', 'EXP% + 10%', 'EXP% + 5%'),
	array('3 Players', 'EXP% + 15%', 'EXP% + 10%'),
	array('4 Players', 'EXP% + 20%', 'EXP% + 15%'),
	array('5 Players', 'EXP% + 25%', 'EXP% + 20%'),
);

echo '<section class="nex-info-section" aria-labelledby="nex-info-party-title">';
echo '<div class="nex-info-card nex-glass-panel nex-info-card--accent-orange">';
echo '<h2 id="nex-info-party-title" class="nex-info-section-title">' . $t_party . '</h2>';
echo '<div class="nex-info-matrix nex-info-matrix--party" role="region" aria-label="' . $t_party . '">';
echo '<div class="nex-info-matrix-head" aria-hidden="true">';
echo '<span class="nex-info-matrix-corner">' . $t_col_mem . '</span>';
echo '<span class="nex-info-matrix-banner">' . $t_col_exp . '</span>';
echo '<span class="nex-info-matrix-sub nex-info-matrix-sub--a">' . $t_col_same . '</span>';
echo '<span class="nex-info-matrix-sub nex-info-matrix-sub--b">' . $t_col_diff . '</span>';
echo '</div>';
foreach ($party_rows as $pr) {
	echo '<div class="nex-info-matrix-row">';
	echo '<span class="nex-info-matrix-name">' . $h($pr[0]) . '</span>';
	echo '<span class="nex-info-matrix-val nex-info-matrix-val--muted">' . $h($pr[1]) . '</span>';
	echo '<span class="nex-info-matrix-val nex-info-matrix-val--muted">' . $h($pr[2]) . '</span>';
	echo '</div>';
}
echo '</div></div></section>';

$cmds = array(
	array('/reset', 'Reset your character.'),
	array('/whisper [on/off]', 'Enable / disable whisper.'),
	array('/clearpk', 'Clear killer status'),
	array('/post [message]', 'Sends a message to the whole server.'),
	array('/str [points]', 'Adds points to Strength.'),
	array('/addagi [points]', 'Adds points to Agility.'),
	array('/addvit [points]', 'Adds points to Life.'),
	array('/addene [points]', 'Adds points to Energy.'),
	array('/addcmd [points]', 'Adds points to Command.'),
	array('/requests [on/off]', 'Enable / disable requests in-game.'),
);

echo '<section class="nex-info-section" aria-labelledby="nex-info-cmds-title">';
echo '<div class="nex-info-card nex-glass-panel nex-info-card--accent-gold">';
echo '<h2 id="nex-info-cmds-title" class="nex-info-section-title">' . $t_cmds . '</h2>';
echo '<div class="nex-info-cmd-list" role="list">';
foreach ($cmds as $c) {
	echo '<div class="nex-info-cmd" role="listitem">';
	echo '<code class="nex-info-cmd-kbd">' . $h($c[0]) . '</code>';
	echo '<span class="nex-info-cmd-desc">' . $h($c[1]) . '</span>';
	echo '</div>';
}
echo '</div></div></section>';

echo '<section class="nex-info-section nex-info-section--video" aria-labelledby="nex-info-video-title">';
echo '<div class="nex-info-card nex-glass-panel">';
echo '<h2 id="nex-info-video-title" class="nex-info-section-title">' . $t_video . '</h2>';
echo '<div class="nex-info-video-wrap">';
echo '<div class="nex-info-video">';
echo '<iframe src="https://www.youtube.com/embed/Wp_Mne-aw5E?controls=0" title="' . $t_vid_iframe . '" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen loading="lazy"></iframe>';
echo '</div></div></div></section>';

echo '</div>';
